Go to the documentation of this file.
46 #ifndef XPETRA_EPETRACRSMATRIX_HPP
47 #define XPETRA_EPETRACRSMATRIX_HPP
51 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
52 #ifdef HAVE_XPETRA_TPETRA
53 #include <Kokkos_View.hpp>
61 #include <Epetra_CrsMatrix.h>
62 #include <Epetra_Map.h>
77 template<
class EpetraGlobalOrdinal,
class Node>
79 :
public CrsMatrix<double, int, EpetraGlobalOrdinal, Node>
85 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
86 #ifdef HAVE_XPETRA_TPETRA
95 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
99 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
101 EpetraCrsMatrixT(
const Teuchos::RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
const Teuchos::RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
size_t maxNumEntriesPerRow,
ProfileType pftype=
DynamicProfile,
const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null) {
TEUCHOS_TEST_FOR_EXCEPTION(
true,
Xpetra::Exceptions::RuntimeError,
"Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with Node=Kokkos::Compat::KokkosSerialWrapperNode."); }
102 EpetraCrsMatrixT(
const Teuchos::RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
const Teuchos::RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc,
ProfileType pftype=
DynamicProfile,
const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null) {
TEUCHOS_TEST_FOR_EXCEPTION(
true,
Xpetra::Exceptions::RuntimeError,
"Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with Node=Kokkos::Compat::KokkosSerialWrapperNode."); }
110 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
118 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
127 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
136 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
138 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
139 #ifdef HAVE_XPETRA_TPETRA
142 const local_matrix_type& lclMatrix,
145 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
148 const local_matrix_type& lclMatrix,
149 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
150 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
151 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap = Teuchos::null,
152 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap = Teuchos::null,
155 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
210 void apply(
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X,
MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y,
Teuchos::ETransp mode=
Teuchos::NO_TRANS,
Scalar alpha=
ScalarTraits< Scalar >::one(),
Scalar beta=
ScalarTraits< Scalar >::zero())
const { }
219 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
232 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
236 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
237 #ifdef HAVE_XPETRA_TPETRA
238 local_matrix_type getLocalMatrix ()
const {
240 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
243 void setAllValues (
const typename local_matrix_type::row_map_type& ptr,
244 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
245 const typename local_matrix_type::values_type& val)
248 "Xpetra::EpetraCrsMatrix only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
252 #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."
259 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
262 :
public CrsMatrix <double, int, int, EpetraNode>
271 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
272 #ifdef HAVE_XPETRA_TPETRA
291 : isFillResumed_(false)
306 : isFillResumed_(false)
325 isFillResumed_(false)
330 const Epetra_Map* myDomainMap = (domainMap!=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(domainMap): 0;
331 const Epetra_Map* myRangeMap = (rangeMap !=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(rangeMap) : 0;
334 bool restrictComm=
false;
335 if(!params.is_null()) restrictComm = params->get(
"Restrict Communicator",restrictComm);
336 mtx_ =
Teuchos::rcp(
new Epetra_CrsMatrix(*tSourceMatrix.getEpetra_CrsMatrix(),*tImporter.getEpetra_Import(),myDomainMap,myRangeMap,restrictComm));
337 if(restrictComm && mtx_->NumMyRows()==0)
349 isFillResumed_(false)
354 const Epetra_Map* myDomainMap = (domainMap!=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(domainMap): 0;
355 const Epetra_Map* myRangeMap = (rangeMap !=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(rangeMap) : 0;
358 bool restrictComm=
false;
359 if(!params.is_null()) restrictComm = params->get(
"Restrict Communicator",restrictComm);
361 mtx_ =
Teuchos::rcp(
new Epetra_CrsMatrix(*tSourceMatrix.getEpetra_CrsMatrix(),*tExporter.getEpetra_Export(),myDomainMap,myRangeMap,restrictComm));
370 isFillResumed_(false)
376 const Epetra_Map* myDomainMap = (domainMap!=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(domainMap): 0;
377 const Epetra_Map* myRangeMap = (rangeMap !=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(rangeMap) : 0;
380 bool restrictComm=
false;
381 if(!params.
is_null()) restrictComm = params->
get(
"Restrict Communicator",restrictComm);
382 mtx_ =
Teuchos::rcp(
new Epetra_CrsMatrix(*tSourceMatrix.getEpetra_CrsMatrix(),*tImporter.getEpetra_Import(),tdImporter->getEpetra_Import().get(),myDomainMap,myRangeMap,restrictComm));
383 if(restrictComm && mtx_->NumMyRows()==0)
393 isFillResumed_(false)
399 const Epetra_Map* myDomainMap = (domainMap!=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(domainMap): 0;
400 const Epetra_Map* myRangeMap = (rangeMap !=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(rangeMap) : 0;
403 bool restrictComm=
false;
404 if(!params.
is_null()) restrictComm = params->
get(
"Restrict Communicator",restrictComm);
406 mtx_ =
Teuchos::rcp(
new Epetra_CrsMatrix(*tSourceMatrix.getEpetra_CrsMatrix(),*tExporter.getEpetra_Export(),tdExporter->getEpetra_Export().get(),myDomainMap,myRangeMap,restrictComm));
409 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
410 #ifdef HAVE_XPETRA_TPETRA
436 const local_matrix_type& lclMatrix,
438 EpetraCrsMatrixT(lclMatrix, rowMap, colMap, Teuchos::null, Teuchos::null, params)
442 const local_matrix_type& lclMatrix,
443 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
444 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
445 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap = Teuchos::null,
446 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap = Teuchos::null,
451 typedef typename local_matrix_type::value_type value_type;
452 typedef typename local_matrix_type::ordinal_type ordinal_type;
455 ordinal_type lclNumRows = lclMatrix.numRows ();
456 ordinal_type lclNumCols = lclMatrix.numCols ();
460 "Xpetra::EpetraCrsMatrixT: number of rows in local matrix and number of local entries in row map do not match!");
462 "Xpetra::EpetraCrsMatrixT: number of columns in local matrix and number of local entries in column map do not match!");
465 for (ordinal_type r = 0; r < lclNumRows; ++r) {
467 auto rowview = lclMatrix.row (r);
468 NumEntriesPerRowToAlloc[r] = rowview.length;
472 isFillResumed_ =
false;
473 Teuchos::Array<int> numEntriesPerRowToAlloc(NumEntriesPerRowToAlloc.begin(), NumEntriesPerRowToAlloc.end());
477 for (ordinal_type r = 0; r < lclNumRows; ++r) {
479 auto rowview = lclMatrix.row (r);
485 for(ordinal_type c = 0; c < rowview.length; c++) {
486 value_type value = rowview.value (c);
487 ordinal_type colidx = rowview.colidx (c);
490 "Xpetra::EpetraCrsMatrixT: local matrix contains column elements which are not in the provided column map!");
495 insertLocalValues(r, indout.view(0,indout.size()), valout.view(0,valout.size()));
499 if (!domainMap.is_null() && !rangeMap.is_null())
505 isInitializedLocalMatrix_ =
false;
536 const std::string tfecfFuncName(
"replaceGlobalValues");
538 ": Fill must be active in order to call this method. If you have already "
539 "called fillComplete(), you need to call resumeFill() before you can "
543 std::runtime_error,
": values.size() must equal indices.size().");
555 const std::string tfecfFuncName(
"replaceLocalValues");
557 ": Fill must be active in order to call this method. If you have already "
558 "called fillComplete(), you need to call resumeFill() before you can "
562 std::runtime_error,
": values.size() must equal indices.size().");
589 bool ownMemory =
false;
594 myColind.
Resize(numNonZeros);
595 colind = Teuchos::arcp(myColind.
Values(), lowerOffset, numNonZeros, ownMemory);
599 double *& myValues = mtx_->ExpertExtractValues();
601 myValues =
new double[numNonZeros];
602 values = Teuchos::arcp(myValues,lowerOffset,numNonZeros,ownMemory);
611 "An exception is thrown to let you know that the size of your rowptr array is incorrect.");
613 "An exception is thrown to let you know that you mismatched your pointers.");
616 if (values.
size() > 0) {
618 "An exception is thrown to let you know that you mismatched your pointers.");
620 "An exception is thrown to let you know that you mismatched your pointers.");
629 for (
size_t i = 0; i < N+1; i++)
630 myRowptr[i] = Teuchos::as<int>(rowptr[i]);
639 bool ownMemory =
false;
648 for (
size_t i = 0; i < n+1; i++)
649 (*const_cast<size_t*>(&rowptr[i])) = Teuchos::as<size_t>(myRowptr[i]);
652 colind = Teuchos::arcp(mtx_->ExpertExtractIndices().Values(), lowerOffset, nnz, ownMemory);
655 values = Teuchos::arcp(mtx_->ExpertExtractValues(), lowerOffset, nnz, ownMemory);
670 isFillResumed_ =
false;
676 if(!importer.is_null()) {
678 myimport = eImporter.getEpetra_Import().getRawPtr();
680 if(!exporter.is_null()) {
682 myexport = eExporter.getEpetra_Export().getRawPtr();
685 rv=mtx_->ExpertStaticFillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap), myimport, myexport);
699 isFillResumed_ =
true;
707 isFillResumed_ =
false;
709 bool doOptimizeStorage =
true;
710 if (params !=
null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
711 mtx_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap), doOptimizeStorage);
720 if (isFillResumed_ ==
true) { isFillResumed_ =
false;
return; }
722 bool doOptimizeStorage =
true;
723 if (params !=
null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
724 mtx_->FillComplete(doOptimizeStorage);
735 if(myImport==Teuchos::null)
736 rv=mtx_->ReplaceDomainMapAndImporter( toEpetra<GlobalOrdinal,Node>(newDomainMap),0);
738 rv=mtx_->ReplaceDomainMapAndImporter( toEpetra<GlobalOrdinal,Node>(newDomainMap),&*myImport);
810 NumEntries = numEntries;
819 NumEntries = numEntries;
830 XPETRA_ERR_CHECK(mtx_->ExtractGlobalRowView(GlobalRow, numEntries, eValues, eIndices));
831 if (numEntries == 0) { eValues = NULL; eIndices = NULL; }
845 XPETRA_ERR_CHECK(mtx_->ExtractMyRowView(LocalRow, numEntries, eValues, eIndices));
846 if (numEntries == 0) { eValues = NULL; eIndices = NULL; }
855 XPETRA_ERR_CHECK(mtx_->ExtractDiagonalCopy(toEpetra<GlobalOrdinal,Node>(diag)));
881 void apply(
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X,
MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y,
Teuchos::ETransp mode=
Teuchos::NO_TRANS,
Scalar alpha=
ScalarTraits< Scalar >::one(),
Scalar beta=
ScalarTraits< Scalar >::zero())
const {
900 XPETRA_ERR_CHECK(mtx_->Multiply(eTrans, *eX.getEpetra_MultiVector(), *tmp));
922 std::ostringstream oss;
925 oss <<
"{status = fill complete"
932 oss <<
"{status = fill not complete"
957 const int myImageID = comm->getRank(),
958 numImages = comm->getSize();
963 width = std::max<size_t>(width,11) + 2;
973 if (myImageID == 0) out << this->
description() << std::endl;
980 if (myImageID == 0) out <<
"\nRow map: " << std::endl;
985 if (myImageID == 0) out <<
"\nColumn map is row map.";
988 if (myImageID == 0) out <<
"\nColumn map: " << std::endl;
994 if (myImageID == 0) out <<
"\nDomain map is row map.";
997 if (myImageID == 0) out <<
"\nDomain map is row map.";
1000 if (myImageID == 0) out <<
"\nDomain map: " << std::endl;
1006 if (myImageID == 0) out <<
"\nRange map is domain map." << std::endl;
1009 if (myImageID == 0) out <<
"\nRange map is row map." << std::endl;
1012 if (myImageID == 0) out <<
"\nRange map: " << std::endl;
1016 if (myImageID == 0) out << std::endl;
1020 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
1021 if (myImageID == imageCtr) {
1022 out <<
"Node ID = " << imageCtr << std::endl;
1045 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
1046 if (myImageID == imageCtr) {
1047 out << std::setw(width) <<
"Node ID"
1048 << std::setw(width) <<
"Global Row"
1049 << std::setw(width) <<
"Num Entries";
1051 out << std::setw(width) <<
"(Index,Value)";
1057 out << std::setw(width) << myImageID
1058 << std::setw(width) << gid
1059 << std::setw(width) << nE;
1065 for (
size_t j=0; j < nE; ++j) {
1066 out <<
" (" << rowinds[j]
1067 <<
", " << rowvals[j]
1075 for (
size_t j=0; j < nE; ++j) {
1076 out <<
" (" <<
getColMap()->getGlobalElement(rowinds[j])
1077 <<
", " << rowvals[j]
1118 int err = mtx_->Import(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1131 int err = mtx_->Export(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1144 int err = mtx_->Import(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1158 int err = mtx_->Export(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1181 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1182 #ifdef HAVE_XPETRA_TPETRA
1183 local_matrix_type getLocalMatrix ()
const {
1185 if (isInitializedLocalMatrix_)
1186 return localMatrix_;
1190 const int numRows = matrix->
NumMyRows();
1191 const int numCols = matrix->
NumMyCols();
1201 typename local_matrix_type::row_map_type::non_const_type kokkosRowPtr(
"local row map", numRows+1);
1202 for (
size_t i = 0; i < kokkosRowPtr.size(); i++)
1203 kokkosRowPtr(i) = Teuchos::asSafe<typename local_matrix_type::row_map_type::value_type>(rowptr[i]);
1206 typename local_matrix_type::index_type kokkosColind(colind, nnz);
1207 typename local_matrix_type::values_type kokkosVals (vals, nnz);
1209 localMatrix_ = local_matrix_type(
"LocalMatrix", numRows, numCols, nnz, kokkosVals, kokkosRowPtr, kokkosColind);
1210 isInitializedLocalMatrix_ =
true;
1212 return localMatrix_;
1215 void setAllValues (
const typename local_matrix_type::row_map_type& ptr,
1216 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
1217 const typename local_matrix_type::values_type& val)
1220 "Xpetra::EpetraCrsMatrix::setAllValues is not implemented");
1224 mutable local_matrix_type localMatrix_;
1225 mutable bool isInitializedLocalMatrix_ =
false;
1228 #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."
1241 #endif //#ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
1243 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
1246 :
public CrsMatrix <double, int, long long, EpetraNode>
1255 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1256 #ifdef HAVE_XPETRA_TPETRA
1275 : isFillResumed_(false)
1290 : isFillResumed_(false)
1309 isFillResumed_(false)
1314 const Epetra_Map* myDomainMap = (domainMap!=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(domainMap): 0;
1315 const Epetra_Map* myRangeMap = (rangeMap !=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(rangeMap) : 0;
1318 bool restrictComm=
false;
1319 if(!params.is_null()) restrictComm = params->get(
"Restrict Communicator",restrictComm);
1320 mtx_ =
Teuchos::rcp(
new Epetra_CrsMatrix(*tSourceMatrix.getEpetra_CrsMatrix(),*tImporter.getEpetra_Import(),myDomainMap,myRangeMap,restrictComm));
1321 if(restrictComm && mtx_->NumMyRows()==0)
1333 isFillResumed_(false)
1338 const Epetra_Map* myDomainMap = (domainMap!=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(domainMap): 0;
1339 const Epetra_Map* myRangeMap = (rangeMap !=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(rangeMap) : 0;
1342 bool restrictComm=
false;
1343 if(!params.is_null()) restrictComm = params->get(
"Restrict Communicator",restrictComm);
1345 mtx_ =
Teuchos::rcp(
new Epetra_CrsMatrix(*tSourceMatrix.getEpetra_CrsMatrix(),*tExporter.getEpetra_Export(),myDomainMap,myRangeMap,restrictComm));
1354 isFillResumed_(false)
1360 const Epetra_Map* myDomainMap = (domainMap!=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(domainMap): 0;
1361 const Epetra_Map* myRangeMap = (rangeMap !=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(rangeMap) : 0;
1364 bool restrictComm=
false;
1365 if(!params.
is_null()) restrictComm = params->
get(
"Restrict Communicator",restrictComm);
1366 mtx_ =
Teuchos::rcp(
new Epetra_CrsMatrix(*tSourceMatrix.getEpetra_CrsMatrix(),*tImporter.getEpetra_Import(),tdImporter->getEpetra_Import().get(),myDomainMap,myRangeMap,restrictComm));
1367 if(restrictComm && mtx_->NumMyRows()==0)
1377 isFillResumed_(false)
1383 const Epetra_Map* myDomainMap = (domainMap!=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(domainMap): 0;
1384 const Epetra_Map* myRangeMap = (rangeMap !=Teuchos::null)? &toEpetra<GlobalOrdinal,Node>(rangeMap) : 0;
1387 bool restrictComm=
false;
1388 if(!params.
is_null()) restrictComm = params->
get(
"Restrict Communicator",restrictComm);
1390 mtx_ =
Teuchos::rcp(
new Epetra_CrsMatrix(*tSourceMatrix.getEpetra_CrsMatrix(),*tExporter.getEpetra_Export(),tdExporter->getEpetra_Export().get(),myDomainMap,myRangeMap,restrictComm));
1393 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1394 #ifdef HAVE_XPETRA_TPETRA
1417 const local_matrix_type& lclMatrix,
1419 EpetraCrsMatrixT(lclMatrix, rowMap, colMap, Teuchos::null, Teuchos::null, params)
1423 const local_matrix_type& lclMatrix,
1424 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
1425 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
1426 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap = Teuchos::null,
1427 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap = Teuchos::null,
1432 typedef typename local_matrix_type::value_type value_type;
1433 typedef typename local_matrix_type::ordinal_type ordinal_type;
1436 ordinal_type lclNumRows = lclMatrix.numRows ();
1437 ordinal_type lclNumCols = lclMatrix.numCols ();
1441 "Xpetra::EpetraCrsMatrixT: number of rows in local matrix and number of local entries in row map do not match!");
1443 "Xpetra::EpetraCrsMatrixT: number of columns in local matrix and number of local entries in column map do not match!");
1446 for (ordinal_type r = 0; r < lclNumRows; ++r) {
1448 auto rowview = lclMatrix.row (r);
1449 NumEntriesPerRowToAlloc[r] = rowview.length;
1453 isFillResumed_ =
false;
1454 Teuchos::Array<int> numEntriesPerRowToAlloc(NumEntriesPerRowToAlloc.begin(), NumEntriesPerRowToAlloc.end());
1458 for (ordinal_type r = 0; r < lclNumRows; ++r) {
1460 auto rowview = lclMatrix.row (r);
1466 for(ordinal_type c = 0; c < rowview.length; c++) {
1467 value_type value = rowview.value (c);
1468 ordinal_type colidx = rowview.colidx (c);
1472 indout [c] = colidx;
1475 insertLocalValues(r, indout.view(0,indout.size()), valout.view(0,valout.size()));
1479 if (!domainMap.is_null() && !rangeMap.is_null())
1485 isInitializedLocalMatrix_ =
false;
1516 const std::string tfecfFuncName(
"replaceGlobalValues");
1518 ": Fill must be active in order to call this method. If you have already "
1519 "called fillComplete(), you need to call resumeFill() before you can "
1523 std::runtime_error,
": values.size() must equal indices.size().");
1535 const std::string tfecfFuncName(
"replaceLocalValues");
1537 ": Fill must be active in order to call this method. If you have already "
1538 "called fillComplete(), you need to call resumeFill() before you can "
1542 std::runtime_error,
": values.size() must equal indices.size().");
1568 int lowerOffset = 0;
1569 bool ownMemory =
false;
1574 myColind.
Resize(numNonZeros);
1575 colind = Teuchos::arcp(myColind.
Values(), lowerOffset, numNonZeros, ownMemory);
1579 double *& myValues = mtx_->ExpertExtractValues();
1581 myValues =
new double[numNonZeros];
1582 values = Teuchos::arcp(myValues,lowerOffset,numNonZeros,ownMemory);
1591 "An exception is thrown to let you know that the size of your rowptr array is incorrect.");
1593 "An exception is thrown to let you know that you mismatched your pointers.");
1596 if (values.
size() > 0) {
1598 "An exception is thrown to let you know that you mismatched your pointers.");
1600 "An exception is thrown to let you know that you mismatched your pointers.");
1609 for (
size_t i = 0; i < N+1; i++)
1610 myRowptr[i] = Teuchos::as<int>(rowptr[i]);
1618 int lowerOffset = 0;
1619 bool ownMemory =
false;
1628 for (
size_t i = 0; i < n+1; i++)
1629 (*const_cast<size_t*>(&rowptr[i])) = Teuchos::as<size_t>(myRowptr[i]);
1632 colind = Teuchos::arcp(mtx_->ExpertExtractIndices().Values(), lowerOffset, nnz, ownMemory);
1635 values = Teuchos::arcp(mtx_->ExpertExtractValues(), lowerOffset, nnz, ownMemory);
1651 isFillResumed_ =
false;
1657 if(!importer.is_null()) {
1659 myimport = eImporter.getEpetra_Import().getRawPtr();
1661 if(!exporter.is_null()) {
1663 myexport = eExporter.getEpetra_Export().getRawPtr();
1666 rv=mtx_->ExpertStaticFillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap), myimport, myexport);
1680 isFillResumed_ =
true;
1688 if (isFillResumed_ ==
true) { isFillResumed_ =
false;
return; }
1690 bool doOptimizeStorage =
true;
1691 if (params !=
null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
1692 mtx_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap), doOptimizeStorage);
1701 if (isFillResumed_ ==
true) { isFillResumed_ =
false;
return; }
1703 bool doOptimizeStorage =
true;
1704 if (params !=
null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
1705 mtx_->FillComplete(doOptimizeStorage);
1716 if(myImport==Teuchos::null)
1717 rv=mtx_->ReplaceDomainMapAndImporter( toEpetra<GlobalOrdinal,Node>(newDomainMap),0);
1719 rv=mtx_->ReplaceDomainMapAndImporter( toEpetra<GlobalOrdinal,Node>(newDomainMap),&*myImport);
1789 int numEntries = -1;
1791 NumEntries = numEntries;
1798 int numEntries = -1;
1800 NumEntries = numEntries;
1811 XPETRA_ERR_CHECK(mtx_->ExtractGlobalRowView(GlobalRow, numEntries, eValues, eIndices));
1812 if (numEntries == 0) { eValues = NULL; eIndices = NULL; }
1826 XPETRA_ERR_CHECK(mtx_->ExtractMyRowView(LocalRow, numEntries, eValues, eIndices));
1827 if (numEntries == 0) { eValues = NULL; eIndices = NULL; }
1859 void apply(
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X,
MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y,
Teuchos::ETransp mode=
Teuchos::NO_TRANS,
Scalar alpha=
ScalarTraits< Scalar >::one(),
Scalar beta=
ScalarTraits< Scalar >::zero())
const {
1878 XPETRA_ERR_CHECK(mtx_->Multiply(eTrans, *eX.getEpetra_MultiVector(), *tmp));
1900 std::ostringstream oss;
1903 oss <<
"{status = fill complete"
1910 oss <<
"{status = fill not complete"
1935 const int myImageID = comm->getRank(),
1936 numImages = comm->getSize();
1941 width = std::max<size_t>(width,11) + 2;
1951 if (myImageID == 0) out << this->
description() << std::endl;
1958 if (myImageID == 0) out <<
"\nRow map: " << std::endl;
1963 if (myImageID == 0) out <<
"\nColumn map is row map.";
1966 if (myImageID == 0) out <<
"\nColumn map: " << std::endl;
1972 if (myImageID == 0) out <<
"\nDomain map is row map.";
1975 if (myImageID == 0) out <<
"\nDomain map is row map.";
1978 if (myImageID == 0) out <<
"\nDomain map: " << std::endl;
1984 if (myImageID == 0) out <<
"\nRange map is domain map." << std::endl;
1987 if (myImageID == 0) out <<
"\nRange map is row map." << std::endl;
1990 if (myImageID == 0) out <<
"\nRange map: " << std::endl;
1994 if (myImageID == 0) out << std::endl;
1998 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
1999 if (myImageID == imageCtr) {
2000 out <<
"Node ID = " << imageCtr << std::endl;
2023 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
2024 if (myImageID == imageCtr) {
2025 out << std::setw(width) <<
"Node ID"
2026 << std::setw(width) <<
"Global Row"
2027 << std::setw(width) <<
"Num Entries";
2029 out << std::setw(width) <<
"(Index,Value)";
2035 out << std::setw(width) << myImageID
2036 << std::setw(width) << gid
2037 << std::setw(width) << nE;
2043 for (
size_t j=0; j < nE; ++j) {
2044 out <<
" (" << rowinds[j]
2045 <<
", " << rowvals[j]
2053 for (
size_t j=0; j < nE; ++j) {
2054 out <<
" (" <<
getColMap()->getGlobalElement(rowinds[j])
2055 <<
", " << rowvals[j]
2096 int err = mtx_->Import(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
2109 int err = mtx_->Export(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
2122 int err = mtx_->Import(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
2136 int err = mtx_->Export(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
2159 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
2160 #ifdef HAVE_XPETRA_TPETRA
2161 local_matrix_type getLocalMatrix ()
const {
2163 if (isInitializedLocalMatrix_)
2164 return localMatrix_;
2168 const int numRows = matrix->
NumMyRows();
2169 const int numCols = matrix->
NumMyCols();
2179 typename local_matrix_type::row_map_type::non_const_type kokkosRowPtr(
"local row map", numRows+1);
2180 for (
size_t i = 0; i < kokkosRowPtr.size(); i++)
2181 kokkosRowPtr(i) = Teuchos::asSafe<typename local_matrix_type::row_map_type::value_type>(rowptr[i]);
2184 typename local_matrix_type::index_type kokkosColind(colind, nnz);
2185 typename local_matrix_type::values_type kokkosVals (vals, nnz);
2187 localMatrix_ = local_matrix_type(
"LocalMatrix", numRows, numCols, nnz, kokkosVals, kokkosRowPtr, kokkosColind);
2188 isInitializedLocalMatrix_ =
true;
2190 return localMatrix_;
2193 void setAllValues (
const typename local_matrix_type::row_map_type& ptr,
2194 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
2195 const typename local_matrix_type::values_type& val)
2198 "Xpetra::EpetraCrsMatrix::setAllValues is not implemented");
2202 mutable local_matrix_type localMatrix_;
2203 mutable bool isInitializedLocalMatrix_ =
false;
2206 #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."
2219 #endif // #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
2223 #define XPETRA_EPETRACRSMATRIX_SHORT
2224 #endif // XPETRA_EPETRACRSMATRIX_HPP
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
RCP< Epetra_CrsMatrix > getEpetra_CrsMatrixNonConst() const
Get the underlying Epetra matrix.
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > ¶ms=Teuchos::null)
Expert static fill complete.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > ¶ms=Teuchos::null)
Expert static fill complete.
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, 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.
std::string description() const
A simple one-line description of this object.
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying fixed number of entries for each row.
RCP< const Epetra_CrsMatrix > getEpetra_CrsMatrix() const
Get the underlying Epetra matrix.
size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph.
size_t getNodeNumRows() const
Returns the number of matrix rows owned on the calling node.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
void resumeFill(const RCP< ParameterList > ¶ms=Teuchos::null)
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
bool hasMatrix() const
Does this have an underlying matrix.
RCP< Epetra_CrsMatrix > mtx_
size_t global_size_t
Global size_t object.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
EpetraCrsMatrixT(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying a previously constructed graph.
size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
int PutScalar(double ScalarConstant)
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
bool isFillActive() const
Returns true if the matrix is in edit mode.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row.
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
static magnitudeType magnitude(T a)
virtual ~EpetraCrsMatrixT()
bool isFillActive() const
Returns true if the matrix is in edit mode.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
CrsMatrix< double, int, GlobalOrdinal, Node >::scalar_type Scalar
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
EpetraCrsMatrixT(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor for a fused import.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
void resumeFill(const RCP< ParameterList > ¶ms=null)
EpetraCrsMatrixT(const EpetraCrsMatrixT &matrix)
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
T & get(const std::string &name, T def_value)
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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...
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
EpetraCrsMatrixT(const EpetraCrsMatrixT &matrix)
Deep copy constructor.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void fillComplete(const RCP< ParameterList > ¶ms=Teuchos::null)
Signal that data entry is complete.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > ¶ms=Teuchos::null)
Signal that data entry is complete, specifying domain and range maps.
bool hasMatrix() const
Does this have an underlying matrix.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs.
const RCP< const Comm< int > > getComm() const
virtual ~EpetraCrsMatrixT()
Destructor.
EpetraCrsMatrixT(const Teuchos::RCP< Epetra_CrsMatrix > &mtx)
EpetraCrsMatrixT constructor to wrap a Epetra_CrsMatrix object.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
CrsMatrix< double, int, GlobalOrdinal, Node >::local_ordinal_type LocalOrdinal
CombineMode
Xpetra::Combine Mode enumerable type.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row indices.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
size_t getNodeNumCols() const
Returns the number of matrix columns owned on the calling node.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
size_t getNodeNumRows() const
Returns the number of matrix rows owned on the calling node.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices, const ArrayView< const Scalar > &values)
Replace matrix entries, using local IDs.
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying fixed number of entries for each row.
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
const RCP< const Comm< int > > getComm() const
Returns the communicator.
void setAllToScalar(const Scalar &alpha)
const RCP< const Comm< int > > getComm() const
Returns the communicator.
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.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
void fillComplete(const RCP< ParameterList > ¶ms=Teuchos::null)
Signal that data entry is complete.
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
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.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Teuchos::ArrayView< const size_t > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices, using row offsets.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
Exception throws to report errors in the internal logical of the program.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
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 getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y....
RCP< Epetra_CrsMatrix > getEpetra_CrsMatrixNonConst() const
Get the underlying Epetra matrix.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices, const ArrayView< const Scalar > &values)
Replace matrix entries, using global IDs.
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
bool hasMatrix() const
Does this have an underlying matrix.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row.
size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
bool isFillActive() const
Returns true if the matrix is in edit mode.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices, const ArrayView< const Scalar > &values)
Replace matrix entries, using global IDs.
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Exception throws when you call an unimplemented method of Xpetra.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
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 setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
void scale(const Scalar &alpha)
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
CrsMatrix< double, int, GlobalOrdinal, Node >::local_ordinal_type LocalOrdinal
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > ¶ms=Teuchos::null)
Signal that data entry is complete, specifying domain and range maps.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
int Resize(int Length_in)
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.
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > ¶ms=Teuchos::null)
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor for a fused import.
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs.
std::string description() const
A simple one-line description of this object.
void resumeFill(const RCP< ParameterList > ¶ms=Teuchos::null)
void resize(const size_type n, const T &val=T())
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
RCP< const Epetra_CrsMatrix > getEpetra_CrsMatrix() const
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
RCP< Epetra_CrsMatrix > mtx_
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
#define TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC(throw_exception_test, Exception, msg)
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, 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.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
virtual ~EpetraCrsMatrixT()
Destructor.
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix.
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
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.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
RCP< const Epetra_CrsMatrix > getEpetra_CrsMatrix() const
Get the underlying Epetra matrix.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > ¶ms=null)
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y....
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix.
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor for a fused export.
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.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
CrsMatrix< double, int, GlobalOrdinal, Node >::scalar_type Scalar
#define XPETRA_ERR_CHECK(arg)
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs.
EpetraGlobalOrdinal GlobalOrdinal
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...
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor for a fused export.
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices, const ArrayView< const Scalar > &values)
Replace matrix entries, using local IDs.
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y....
EpetraCrsMatrixT(const Teuchos::RCP< Epetra_CrsMatrix > &mtx)
EpetraCrsMatrixT constructor to wrap a Epetra_CrsMatrix object.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
int NumMyNonzeros() const
std::string description() const
A simple one-line description of this object.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
static const EVerbosityLevel verbLevel_default
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
EpetraCrsMatrixT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row.
int ExtractCrsDataPointers(int *&IndexOffset, int *&Indices, double *&Values_in) const
CrsMatrix< double, int, GlobalOrdinal, Node >::local_ordinal_type LocalOrdinal
LocalOrdinal local_ordinal_type
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row indices.
#define XPETRA_MONITOR(funcName)
size_t getNodeNumRows() const
Returns the number of matrix rows owned on the calling node.
EpetraCrsMatrixT(const Teuchos::RCP< Epetra_CrsMatrix > &mtx)
RCP< Epetra_CrsMatrix > getEpetra_CrsMatrixNonConst() const
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Teuchos::ArrayView< const size_t > &offsets) const
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Teuchos::ArrayView< const size_t > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices, using row offsets.
CrsMatrix< double, int, GlobalOrdinal, Node >::scalar_type Scalar
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
EpetraCrsMatrixT(const EpetraCrsMatrixT &matrix)
Deep copy constructor.
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
EpetraCrsMatrixT(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
EpetraCrsMatrixT(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying a previously constructed graph.