Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_CrsMatrixWrap_def.hpp
Go to the documentation of this file.
1// @HEADER
2//
3// ***********************************************************************
4//
5// Xpetra: A linear algebra interface package
6// Copyright 2012 Sandia Corporation
7//
8// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9// the U.S. Government retains certain rights in this software.
10//
11// Redistribution and use in source and binary forms, with or without
12// modification, are permitted provided that the following conditions are
13// met:
14//
15// 1. Redistributions of source code must retain the above copyright
16// notice, this list of conditions and the following disclaimer.
17//
18// 2. Redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution.
21//
22// 3. Neither the name of the Corporation nor the names of the
23// contributors may be used to endorse or promote products derived from
24// this software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact
39// Jonathan Hu (jhu@sandia.gov)
40// Andrey Prokopenko (aprokop@sandia.gov)
41// Ray Tuminaro (rstumin@sandia.gov)
42//
43// ***********************************************************************
44//
45// @HEADER
46
47// WARNING: This code is experimental. Backwards compatibility should not be expected.
48
49#ifndef XPETRA_CRSMATRIXWRAP_DEF_HPP
50#define XPETRA_CRSMATRIXWRAP_DEF_HPP
51
52#include <KokkosCompat_DefaultNode.hpp>
53
55#include <Teuchos_Hashtable.hpp>
56
57#include "Xpetra_ConfigDefs.hpp"
58#include "Xpetra_Exceptions.hpp"
59
60#include "Xpetra_MultiVector.hpp"
61#include "Xpetra_CrsGraph.hpp"
62#include "Xpetra_CrsMatrix.hpp"
64
65#include "Xpetra_Matrix.hpp"
66
68
69namespace Xpetra {
70 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
77
78 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
80 size_t maxNumEntriesPerRow)
81 : finalDefaultView_ (false)
82 {
83 matrixData_ = CrsMatrixFactory::Build (rowMap, maxNumEntriesPerRow);
85 }
86
87 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
89 const ArrayRCP<const size_t>& NumEntriesPerRowToAlloc)
90 : finalDefaultView_ (false)
91 {
92 matrixData_ = CrsMatrixFactory::Build(rowMap, NumEntriesPerRowToAlloc);
94 }
95
96 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
98 : finalDefaultView_(false)
99 {
100 // Set matrix data
101 matrixData_ = CrsMatrixFactory::Build(rowMap, colMap, maxNumEntriesPerRow);
102
103 // Default view
105 }
106
107 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
109 : finalDefaultView_(false)
110 {
111 // Set matrix data
112 matrixData_ = CrsMatrixFactory::Build(rowMap, colMap, NumEntriesPerRowToAlloc);
113
114 // Default view
116 }
117
118#ifdef HAVE_XPETRA_TPETRA
119 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
121 : finalDefaultView_(false)
122 {
123 // Set matrix data
124 matrixData_ = CrsMatrixFactory::Build(rowMap, colMap, lclMatrix, params);
125
126 // Default view
128 }
129
130 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
132 const RCP<const Map>& domainMap, const RCP<const Map>& rangeMap,
134 : finalDefaultView_(false)
135 {
136 // Set matrix data
137 matrixData_ = CrsMatrixFactory::Build(lclMatrix, rowMap, colMap, domainMap, rangeMap, params);
138
139 // Default view
141 }
142#else
143#ifdef __GNUC__
144#warning "Xpetra Kokkos interface for CrsMatrix is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
145#endif
146#endif
147
148 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
150 : finalDefaultView_(matrix->isFillComplete())
151 {
152 // Set matrix data
153 matrixData_ = matrix;
154
155 // Default view
157 }
158
159 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
161 : finalDefaultView_(false)
162 {
163 // Set matrix data
164 matrixData_ = CrsMatrixFactory::Build(graph, paramList);
165
166 // Default view
168 }
169
170 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
172
173 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
175 matrixData_->insertGlobalValues(globalRow, cols, vals);
176 }
177
178 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
180 matrixData_->insertLocalValues(localRow, cols, vals);
181 }
182
183 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
186 const ArrayView<const Scalar> &vals) { matrixData_->replaceGlobalValues(globalRow, cols, vals); }
187
188 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
191 const ArrayView<const Scalar> &vals) { matrixData_->replaceLocalValues(localRow, cols, vals); }
192
193 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
194 void CrsMatrixWrap<Scalar,LocalOrdinal,GlobalOrdinal,Node>::setAllToScalar(const Scalar &alpha) { matrixData_->setAllToScalar(alpha); }
195
196 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
198 matrixData_->scale(alpha);
199 }
200
201 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
203 matrixData_->resumeFill(params);
204 }
205
206 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
208 matrixData_->fillComplete(domainMap, rangeMap, params);
209
210 // Update default view with the colMap because colMap can be <tt>null</tt> until fillComplete() is called.
211 updateDefaultView();
212 }
213
214 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
216 matrixData_->fillComplete(params);
217
218 // Update default view with the colMap because colMap can be <tt>null</tt> until fillComplete() is called.
219 updateDefaultView();
220 }
221
222 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
224 return matrixData_->getGlobalNumRows();
225 }
226
227 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
229 return matrixData_->getGlobalNumCols();
230 }
231
232 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
234 return matrixData_->getLocalNumRows();
235 }
236
237 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
239 return matrixData_->getGlobalNumEntries();
240 }
241
242 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
244 return matrixData_->getLocalNumEntries();
245 }
246
247 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
249 return matrixData_->getNumEntriesInLocalRow(localRow);
250 }
251
252 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
254 return matrixData_->getNumEntriesInGlobalRow(globalRow);
255 }
256
257 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
259 return matrixData_->getGlobalMaxNumRowEntries();
260 }
261
262 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
264 return matrixData_->getLocalMaxNumRowEntries();
265 }
266
267 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
269 return matrixData_->isLocallyIndexed();
270 }
271
272 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
274 return matrixData_->isGloballyIndexed();
275 }
276
277 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
279 return matrixData_->isFillComplete();
280 }
281
282 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
284 const ArrayView<LocalOrdinal> &Indices,
285 const ArrayView<Scalar> &Values,
286 size_t &NumEntries
287 ) const {
288 matrixData_->getLocalRowCopy(LocalRow, Indices, Values, NumEntries);
289 }
290
291 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
293 matrixData_->getGlobalRowView(GlobalRow, indices, values);
294 }
295
296 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
298 matrixData_->getLocalRowView(LocalRow, indices, values);
299 }
300
301 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
305
306 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
308 matrixData_->getLocalDiagOffsets(offsets);
309 }
310
311 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
315
316 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
320
321 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
325
326 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
330
331 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
333 return matrixData_->haveGlobalConstants();
334 }
335
336 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
339 Teuchos::ETransp mode,
340 Scalar alpha,
341 Scalar beta) const {
342
343 matrixData_->apply(X,Y,mode,alpha,beta);
344 }
345
346 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
349 Teuchos::ETransp mode,
350 Scalar alpha,
351 Scalar beta,
352 bool sumInterfaceValues,
353 const RCP<Import<LocalOrdinal, GlobalOrdinal, Node> >& regionInterfaceImporter,
354 const Teuchos::ArrayRCP<LocalOrdinal>& regionInterfaceLIDs
355 ) const{
356 matrixData_->apply(X,Y,mode,alpha,beta,sumInterfaceValues,regionInterfaceImporter,regionInterfaceLIDs);
357 }
358
359 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
363
364 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
368
369 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
371
372 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
374 TEUCHOS_TEST_FOR_EXCEPTION(Matrix::operatorViewTable_.containsKey(viewLabel) == false, Xpetra::Exceptions::RuntimeError, "Xpetra::Matrix.GetColMap(): view '" + viewLabel + "' does not exist.");
375 updateDefaultView(); // If CrsMatrix::fillComplete() have been used instead of CrsMatrixWrap::fillComplete(), the default view is updated.
376 return Matrix::operatorViewTable_.get(viewLabel)->GetColMap();
377 }
378
379 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
381 matrixData_->removeEmptyProcessesInPlace(newMap);
382 this->operatorViewTable_.get(this->GetCurrentViewLabel())->SetRowMap(matrixData_->getRowMap());
383 this->operatorViewTable_.get(this->GetCurrentViewLabel())->SetColMap(matrixData_->getColMap());
384 }
385
386 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
390
391 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
394 const CrsMatrixWrap & sourceWrp = dynamic_cast<const CrsMatrixWrap &>(source);
395 matrixData_->doImport(*sourceWrp.getCrsMatrix(), importer, CM);
396 }
397
398 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
401 const CrsMatrixWrap & destWrp = dynamic_cast<const CrsMatrixWrap &>(dest);
402 matrixData_->doExport(*destWrp.getCrsMatrix(), importer, CM);
403 }
404
405 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
408 const CrsMatrixWrap & sourceWrp = dynamic_cast<const CrsMatrixWrap &>(source);
409 matrixData_->doImport(*sourceWrp.getCrsMatrix(), exporter, CM);
410 }
411
412 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
415 const CrsMatrixWrap & destWrp = dynamic_cast<const CrsMatrixWrap &>(dest);
416 matrixData_->doExport(*destWrp.getCrsMatrix(), exporter, CM);
417 }
418
419 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
421 return "Xpetra::CrsMatrixWrap";
422 }
423
424 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
426 // Teuchos::EVerbosityLevel vl = verbLevel;
427 // if (vl == VERB_DEFAULT) vl = VERB_LOW;
428 // RCP<const Comm<int> > comm = this->getComm();
429 // const int myImageID = comm->getRank(),
430 // numImages = comm->getSize();
431
432 // if (myImageID == 0) out << this->description() << std::endl;
433
434 matrixData_->describe(out,verbLevel);
435
436 // Teuchos::OSTab tab(out);
437 }
438
439 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
442 matrixData_->setObjectLabel(objectLabel);
443 }
444
445#ifdef HAVE_XPETRA_TPETRA
446 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
451 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
454 return matrixData_->getLocalMatrixDevice();
455 }
456#else
457#ifdef __GNUC__
458#warning "Xpetra Kokkos interface for CrsMatrix is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
459#endif
460#endif
461
462 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
464
465
466 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
468
469
470 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
472
473// Default view is created after fillComplete()
474 // Because ColMap might not be available before fillComplete().
475 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
477
478 // Create default view
479 this->defaultViewLabel_ = "point";
480 this->CreateView(this->GetDefaultViewLabel(), matrixData_->getRowMap(), matrixData_->getColMap());
481
482 // Set current view
483 this->currentViewLabel_ = this->GetDefaultViewLabel();
484 }
485
486 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
488 if ((finalDefaultView_ == false) && matrixData_->isFillComplete() ) {
489 // Update default view with the colMap
490 Matrix::operatorViewTable_.get(Matrix::GetDefaultViewLabel())->SetColMap(matrixData_->getColMap());
491 finalDefaultView_ = true;
492 }
493 }
494
495
496 // Expert only
497 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
499 // Clear the old view table
501 Matrix::operatorViewTable_ = dummy_table;
502
503 finalDefaultView_ = M->isFillComplete();
504 // Set matrix data
505 matrixData_ = M;
506
507
508 // Default view
509 CreateDefaultView();
510 }
511
512
513 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
515 return matrixData_->GetStorageBlockSize();
516 }
517
518 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
525
526
527} //namespace Xpetra
528
529#endif //ifndef XPETRA_CRSMATRIXWRAP_DEF_HPP
virtual void setObjectLabel(const std::string &objectLabel)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty matrix (intended use is an import/export target - can't insert entries directly...
Concrete implementation of Xpetra::Matrix.
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
LocalOrdinal GetStorageBlockSize() const
Returns the block size of the storage mechanism, which is usually 1, except for Tpetra::BlockCrsMatri...
void residual(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &R) const
Compute a residual R = B - (*this) * X.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the specified global row.
RCP< const CrsGraph > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
void fillComplete(const RCP< const Map > &domainMap, const RCP< const Map > &rangeMap, const RCP< Teuchos::ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Get Frobenius norm of the matrix.
std::string description() const
Return a simple one-line description of this object.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs.
virtual local_matrix_type::HostMirror getLocalMatrixHost() const
size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
bool hasCrsGraph() const
Supports the getCrsGraph() call.
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this.
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs.
void resumeFill(const RCP< ParameterList > &params=null)
global_size_t getGlobalNumCols() const
Returns the number of global columns in the matrix.
RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
global_size_t getGlobalNumRows() const
Returns the number of global rows in this matrix.
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the matrix. Put into storage allocated by calli...
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
void setObjectLabel(const std::string &objectLabel)
const RCP< const Map > & getColMap() const
Returns the Map that describes the column distribution in this matrix. This might be null until fillC...
const Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
virtual local_matrix_type getLocalMatrixDevice() const
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void replaceCrsMatrix(RCP< CrsMatrix > &M)
Expert only.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
void doExport(const Matrix &dest, const Xpetra::Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
CrsMatrix::local_matrix_type local_matrix_type
void getLocalDiagCopy(Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
virtual ~CrsMatrixWrap()
Destructor.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs.
CrsMatrixWrap(const RCP< const Map > &rowMap)
Constructor for a dynamic profile matrix (Epetra only)
void doImport(const Matrix &source, const Xpetra::Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map > &newMap)
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
RCP< CrsMatrix > getCrsMatrix() const
virtual void apply(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
bool isFillComplete() const
Returns true if fillComplete() has been called and the matrix is in compute mode.
virtual void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalar.
virtual local_matrix_type::HostMirror getLocalMatrixHost() const =0
KokkosSparse::CrsMatrix< impl_scalar_type, LocalOrdinal, execution_space, void, typename local_graph_type::size_type > local_matrix_type
The specialization of Kokkos::CrsMatrix that represents the part of the sparse matrix on each MPI pro...
Exception throws to report errors in the internal logical of the program.
Xpetra-specific matrix class.
const viewLabel_t & GetCurrentViewLabel() const
const viewLabel_t & GetDefaultViewLabel() const
Teuchos::Hashtable< viewLabel_t, RCP< MatrixView > > operatorViewTable_
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Xpetra namespace
std::string viewLabel_t
size_t global_size_t
Global size_t object.
CombineMode
Xpetra::Combine Mode enumerable type.