47 #ifndef XPETRA_BLOCKEDMULTIVECTOR_DEF_HPP
48 #define XPETRA_BLOCKEDMULTIVECTOR_DEF_HPP
52 #include "Xpetra_MultiVectorFactory.hpp"
53 #include "Xpetra_BlockedVector.hpp"
54 #include "Xpetra_MapExtractor.hpp"
60 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
67 numVectors_ = NumVectors;
69 vv_.reserve(map->getNumMaps());
72 for(
size_t r = 0; r < map->getNumMaps(); ++r)
89 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
90 BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
96 "BlockedMultiVector: inconsistent number of local elements of MultiVector and BlockedMap. The BlockedMap has "
97 << bmap->getMap()->getNodeNumElements() <<
" local elements. The vector has " << v->getMap()->getNodeNumElements()
101 "BlockedMultiVector: inconsistent number of global elements of MultiVector and BlockedMap. The BlockedMap has "
102 << bmap->getMap()->getGlobalNumElements() <<
" local elements. The vector has " << v->getMap()->getGlobalNumElements()
111 numVectors_ = v->getNumVectors();
116 vv_.reserve(bmap->getNumMaps());
119 for(
size_t r = 0; r < bmap->getNumMaps(); ++r)
120 vv_.push_back(this->ExtractVector(v, r, bmap->getThyraMode()));
135 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
136 BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
140 numVectors_ = v->getNumVectors();
143 std::vector<RCP<const Map>> maps;
144 maps.reserve(mapExtractor->NumMaps());
145 for(
size_t r = 0; r < mapExtractor->NumMaps(); ++r)
146 maps.push_back(mapExtractor->getMap(r, mapExtractor->getThyraMode()));
150 vv_.reserve(mapExtractor->NumMaps());
153 for(
size_t r = 0; r < mapExtractor->NumMaps(); ++r)
154 vv_.push_back(this->ExtractVector(v, r, mapExtractor->getThyraMode()));
158 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
165 vv_.resize(vin.size());
166 for(
size_t i = 0; i < vv_.size(); i++)
171 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
172 BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
173 ~BlockedMultiVector()
175 for(
size_t r = 0; r < vv_.size(); ++r)
177 vv_[ r ] = Teuchos::null;
180 map_ = Teuchos::null;
185 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
195 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
204 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
212 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
221 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
231 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
237 for(
size_t r = 0; r < map_->getNumMaps(); r++)
239 getMultiVector(r)->putScalar(value);
244 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
252 for(
size_t r = 0; r < getBlockedMap()->getNumMaps(); r++)
255 this->getMultiVector(r, this->getBlockedMap()->getThyraMode())->getVector(j);
256 ret->setMultiVector(r, subvec, this->getBlockedMap()->getThyraMode());
262 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
273 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
278 if(map_->getNumMaps() == 1)
287 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
292 if(map_->getNumMaps() == 1)
301 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
310 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
319 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
328 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
334 for(
size_t r = 0; r < map_->getNumMaps(); ++r)
336 if(getMultiVector(r) != Teuchos::null)
338 getMultiVector(r)->scale(alpha);
344 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
350 for(
size_t r = 0; r < map_->getNumMaps(); ++r)
352 if(getMultiVector(r) != Teuchos::null)
354 getMultiVector(r)->scale(alpha);
360 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
370 "BlockedMultiVector::update: update with incompatible vector (different number of vectors in multivector).");
371 if(bA != Teuchos::null)
377 "BlockedMultiVector::update: update with incompatible vector (different thyra mode).");
380 "BlockedMultiVector::update: update with incompatible vector (different number of partial vectors).");
381 for(
size_t r = 0; r < map_->getNumMaps(); r++)
384 XPETRA_TEST_FOR_EXCEPTION(getMultiVector(r)->getMap()->getNodeNumElements() != bA->getMultiVector(r)->getMap()->getNodeNumElements(),
386 "BlockedMultiVector::update: in subvector "
387 << r <<
": Cannot add a vector of (local) length " << bA->getMultiVector(r)->getMap()->getNodeNumElements()
388 <<
" to the existing vector with " << getMultiVector(r)->getMap()->getNodeNumElements() <<
" entries.");
389 XPETRA_TEST_FOR_EXCEPTION(getMultiVector(r)->getMap()->getGlobalNumElements() != bA->getMultiVector(r)->getMap()->getGlobalNumElements(),
391 "BlockedMultiVector::update: in subvector "
392 << r <<
": Cannot add a vector of length " << bA->getMultiVector(r)->getMap()->getGlobalNumElements()
393 <<
" to the existing vector with " << getMultiVector(r)->getMap()->getGlobalNumElements() <<
" entries.");
408 if(blmv.
is_null() ==
true && brmv.is_null() ==
false)
413 "BlockedMultiVector::update: Standard MultiVector object does not accept BlockedMultVector object as "
414 "parameter in update call.");
415 lmv->update(alpha, *(brmv->getMultiVector(0)), beta);
418 lmv->update(alpha, *rmv, beta);
427 if(getBlockedMap()->getNumMaps() == 1)
432 getMultiVector(0)->getMap()->isSameAs(*(rcpA->getMap())) ==
false,
434 "BlockedMultiVector::update: update with incompatible vector (maps of full vector do not match with map in MapExtractor).");
435 getMultiVector(0)->update(alpha, *rcpA, beta);
443 for(
size_t r = 0; r < map_->getNumMaps(); r++)
450 "BlockedMultiVector::update: in subvector "
451 << r <<
": Cannot add a vector of (local) length " << part->getMap()->getNodeNumElements()
452 <<
" to the existing vector with " << getMultiVector(r)->getMap()->getNodeNumElements() <<
" entries.");
455 "BlockedMultiVector::update: in subvector "
456 << r <<
": Cannot add a vector of length " << part->getMap()->getGlobalNumElements()
457 <<
" to the existing vector with " << getMultiVector(r)->getMap()->getGlobalNumElements() <<
" entries.");
458 getMultiVector(r)->update(alpha, *part, beta);
465 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
475 if(bA != Teuchos::null && bB != Teuchos::null)
479 "BlockedMultiVector::update: update with incompatible vector (different thyra mode in vector A).");
482 "BlockedMultiVector::update: update with incompatible vector (different number of partial vectors in vector A).");
484 numVectors_ != bA->getNumVectors(),
486 "BlockedMultiVector::update: update with incompatible vector (different number of vectors in multivector in vector A).");
489 "BlockedMultiVector::update: update with incompatible vector (different thyra mode in vector B).");
492 "BlockedMultiVector::update: update with incompatible vector (different number of partial vectors in vector B).");
494 numVectors_ != bB->getNumVectors(),
496 "BlockedMultiVector::update: update with incompatible vector (different number of vectors in multivector in vector B).");
498 for(
size_t r = 0; r < map_->getNumMaps(); r++)
502 "BlockedMultiVector::update: update with incompatible vector (different maps in partial vector " << r <<
").");
503 getMultiVector(r)->update(alpha, *(bA->getMultiVector(r)), beta, *(bB->getMultiVector(r)), gamma);
511 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
521 for(
size_t r = 0; r < map_->getNumMaps(); ++r)
523 if(getMultiVector(r) != Teuchos::null)
525 getMultiVector(r)->norm1(temp_norms);
526 for(
size_t c = 0; c < getNumVectors(); ++c)
527 norms[ c ] += temp_norms[ c ];
534 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
546 for(
size_t r = 0; r < map_->getNumMaps(); ++r)
548 if(getMultiVector(r) != Teuchos::null)
550 getMultiVector(r)->norm2(temp_norms);
551 for(
size_t c = 0; c < getNumVectors(); ++c)
552 results[ c ] += temp_norms[ c ] * temp_norms[ c ];
555 for(
size_t c = 0; c < getNumVectors(); ++c)
560 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
570 for(
size_t r = 0; r < map_->getNumMaps(); ++r)
572 if(getMultiVector(r) != Teuchos::null)
574 getMultiVector(r)->normInf(temp_norms);
575 for(
size_t c = 0; c < getNumVectors(); ++c)
576 norms[ c ] = std::max(norms[ c ], temp_norms[ c ]);
582 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
591 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
605 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
616 "BlockedMultiVector::elementWiseMultipy: B must have same blocked map than this.");
621 "BlockedMultiVector::elementWiseMultipy: A has " << A.
getMap()->getNodeNumElements() <<
" elements, B has "
622 << B.
getMap()->getNodeNumElements() <<
".");
625 "BlockedMultiVector::elementWiseMultipy: A has " << A.
getMap()->getGlobalNumElements() <<
" elements, B has "
626 << B.
getMap()->getGlobalNumElements() <<
".");
641 for(
size_t m = 0; m < bmap->getNumMaps(); m++)
647 thisPart->elementWiseMultiply(scalarAB, *partA, *partB, scalarThis);
653 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
662 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
668 return map_->getFullMap()->getNodeNumElements();
672 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
678 return map_->getFullMap()->getGlobalNumElements();
682 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
690 for(
size_t r = 0; r < map_->getNumMaps(); ++r)
694 if((a == Teuchos::null && b != Teuchos::null) || (a != Teuchos::null && b == Teuchos::null))
696 if(a != Teuchos::null && b != Teuchos::null && !a->isSameSize(*b))
703 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
708 return std::string(
"BlockedMultiVector");
712 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
717 out << description() << std::endl;
718 for(
size_t r = 0; r < map_->getNumMaps(); r++)
719 getMultiVector(r)->describe(out, verbLevel);
723 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
733 if(this->getBlockedMap()->getNumMaps() > 1)
736 "BlockedMultiVector::replaceMap: map is not of type BlockedMap. General implementation not available, yet.");
741 std::vector<Teuchos::RCP<const Map>> subMaps(1, map);
743 this->getMultiVector(0)->replaceMap(map);
751 for(
size_t r = 0; r < map_->getNumMaps(); r++)
752 getMultiVector(r)->replaceMap(bmap->getMap(r, map_->getThyraMode()));
756 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
767 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
778 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
789 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
800 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
805 for(
size_t r = 0; r < map_->getNumMaps(); ++r)
807 getMultiVector(r)->
setSeed(seed);
812 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
817 for(
size_t r = 0; r < map_->getNumMaps(); ++r)
819 getMultiVector(r)->
randomize(bUseXpetraImplementation);
824 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
833 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
843 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
853 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
861 "Error, r = " << r <<
" is too big. The BlockedMultiVector only contains " << map_->getNumMaps()
862 <<
" partial blocks.");
867 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
872 XPETRA_MONITOR(
"BlockedMultiVector::getMultiVector(r,bThyraMode)");
875 "Error, r = " << r <<
" is too big. The BlockedMultiVector only contains " << map_->getNumMaps()
876 <<
" partial blocks.");
884 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
898 "Error, r = " << r <<
" is too big. The BlockedMultiVector only contains " << map_->getNumMaps() <<
" partial blocks.");
901 "The BlockedMultiVectors expects " << getNumVectors() <<
" vectors. The provided partial multivector has "
902 << v->getNumVectors() <<
" vectors.");
907 TEUCHOS_TEST_FOR_EXCEPTION(vv == Teuchos::null, Xpetra::Exceptions::RuntimeError,
"Partial vector must not be Teuchos::null");
912 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
921 for(
size_t r = 0; r < map_->getNumMaps(); ++r)
927 this->InsertVector(vi, r, v, map_->getThyraMode());
932 this->InsertVector(mvi, r, v, map_->getThyraMode());
942 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
949 if(bRhs == Teuchos::null)
953 vv_ = std::vector<Teuchos::RCP<MultiVector>>(map_->getNumMaps());
954 for(
size_t r = 0; r < map_->getNumMaps(); ++r)
961 map_->getMap(r, bRhs->getBlockedMap()->getThyraMode()), rcpRhs->getNumVectors(),
true);
966 if(bsrc.is_null() ==
true && bvv.is_null() ==
true)
970 else if(bsrc.is_null() ==
true && bvv.is_null() ==
false)
975 else if(bsrc.is_null() ==
false && bvv.is_null() ==
true)
979 if(bsrc->getBlockedMap()->getNumMaps() > 1)
982 "1 blocks) and target is a MultiVector.");
989 "BlockedMultiVector::assign: sub block must not be of type BlockedMultiVector.");
997 "BlockedMultiVector::assign: source and target are BlockedMultiVectors with a different number of submaps.");
1002 numVectors_ = rcpRhs->getNumVectors();
1006 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1013 ExtractVector(*full, block, *partial);
1017 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1019 BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
1024 ExtractVector(*full, block, *partial);
1028 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1029 RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
1030 BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
1033 bool bThyraMode)
const
1037 "ExtractVector: Error, block = " << block <<
" is too big. The MapExtractor only contains " << map_->getNumMaps()
1038 <<
" partial blocks.");
1041 RCP<const BlockedMultiVector> bfull = Teuchos::rcp_dynamic_cast<
const BlockedMultiVector>(full);
1042 if(bfull.is_null() ==
true)
1046 const RCP<MultiVector> vv =
1052 RCP<const Map> oldThyMapFull = full->getMap();
1053 RCP<MultiVector> rcpNonConstFull = Teuchos::rcp_const_cast<MultiVector>(full);
1054 rcpNonConstFull->replaceMap(map_->getImporter(block)->getSourceMap());
1055 ExtractVector(*rcpNonConstFull, block, *vv);
1057 Xpetra::Exceptions::RuntimeError,
1058 "MapExtractor::ExtractVector: ExtractVector in Thyra-style numbering only possible if MapExtractor has been "
1059 "created using Thyra-style numbered submaps.");
1060 if(bThyraMode ==
true)
1061 vv->replaceMap(map_->getMap(block,
true));
1062 rcpNonConstFull->replaceMap(oldThyMapFull);
1070 Xpetra::Exceptions::RuntimeError,
1071 "ExtractVector: Number of blocks in map extractor is " << map_->getNumMaps() <<
" but should be "
1072 << bfull->getBlockedMap()->getNumMaps()
1073 <<
" (number of blocks in BlockedMultiVector)");
1074 return bfull->getMultiVector(block, bThyraMode);
1079 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1080 RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
1081 BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
1084 bool bThyraMode)
const
1088 "ExtractVector: Error, block = " << block <<
" is too big. The MapExtractor only contains " << map_->getNumMaps()
1089 <<
" partial blocks.");
1091 map_->getMap(block,
false) == null, Xpetra::Exceptions::RuntimeError,
"ExtractVector: map_->getmap(" << block <<
",false) is null");
1092 RCP<BlockedMultiVector> bfull = Teuchos::rcp_dynamic_cast<BlockedMultiVector>(full);
1093 if(bfull.is_null() ==
true)
1097 const RCP<MultiVector> vv =
1103 RCP<const Map> oldThyMapFull = full->getMap();
1104 full->replaceMap(map_->getImporter(block)->getSourceMap());
1105 ExtractVector(*full, block, *vv);
1107 Xpetra::Exceptions::RuntimeError,
1108 "MapExtractor::ExtractVector: ExtractVector in Thyra-style numbering only possible if MapExtractor has been "
1109 "created using Thyra-style numbered submaps.");
1110 if(bThyraMode ==
true)
1111 vv->replaceMap(map_->getMap(block,
true));
1112 full->replaceMap(oldThyMapFull);
1120 Xpetra::Exceptions::RuntimeError,
1121 "ExtractVector: Number of blocks in map extractor is " << map_->getNumMaps() <<
" but should be "
1122 << bfull->getBlockedMap()->getNumMaps()
1123 <<
" (number of blocks in BlockedMultiVector)");
1124 return bfull->getMultiVector(block, bThyraMode);
1129 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1131 BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
1138 "ExtractVector: Error, block = " << block <<
" is too big. The BlockedMultiVector only contains " << map_->getNumMaps()
1139 <<
" partial blocks.");
1140 XPETRA_TEST_FOR_EXCEPTION(map_->getMap(block) == null, Xpetra::Exceptions::RuntimeError,
"ExtractVector: maps_[" << block <<
"] is null");
1145 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1151 bool bThyraMode)
const
1155 "ExtractVector: Error, block = " << block <<
" is too big. The MapExtractor only contains " << map_->getNumMaps()
1156 <<
" partial blocks.");
1158 map_->getMap(block,
false) == null, Xpetra::Exceptions::RuntimeError,
"ExtractVector: map_->getmap(" << block <<
",false) is null");
1160 Xpetra::Exceptions::RuntimeError,
1161 "MapExtractor::InsertVector: InsertVector in Thyra-style numbering only possible if MapExtractor has been created "
1162 "using Thyra-style numbered submaps.");
1188 rcpNonConstPartial->replaceMap(map_->getMap(block,
false));
1189 full.
replaceMap(map_->getImporter(block)->getSourceMap());
1196 rcpNonConstPartial->replaceMap(oldThyMapPartial);
1206 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1212 bool bThyraMode)
const
1217 InsertVector(*partial, block, *full, bThyraMode);
1220 XPETRA_TEST_FOR_EXCEPTION(map_->getMap(block) == null, Xpetra::Exceptions::RuntimeError,
"InsertVector: maps_[" << block <<
"] is null");
1225 full->setMultiVector(block, partial, bThyraMode);
1227 throw Xpetra::Exceptions::RuntimeError(
"MultiVector::setMultiVector() is not implemented.");
1233 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1235 BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
1239 bool bThyraMode)
const
1241 RCP<Xpetra::BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>> bfull =
1243 if(bfull.is_null() ==
true)
1244 InsertVector(*partial, block, *full, bThyraMode);
1247 XPETRA_TEST_FOR_EXCEPTION(map_->getMap(block) == null, Xpetra::Exceptions::RuntimeError,
"InsertVector: maps_[" << block <<
"] is null");
1248 bfull->setMultiVector(block, partial, bThyraMode);
1256 #endif // XPETRA_BLOCKEDMULTIVECTOR_DEF_HPP
virtual void doExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)=0
Export data into this object using an Export object ("forward mode").
static Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &map, size_t NumVectors, bool zeroOut=true)
Constructor specifying the number of non-zeros for all rows.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual void Xpetra_randomize()
Set multi-vector values to random numbers. XPetra implementation.
BlockedMultiVector(const Teuchos::RCP< const BlockedMap > &map, size_t NumVectors, bool zeroOut=true)
Constructor.
Exception throws to report errors in the internal logical of the program.
virtual void replaceMap(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)=0
virtual void doImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)=0
Import data into this object using an Import object ("forward mode").
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const =0
The Map describing the parallel distribution of this object.
virtual void setSeed(unsigned int seed)
Set seed for Random function.
size_t global_size_t
Global size_t object.
virtual Teuchos::ArrayRCP< const Scalar > getData(size_t j) const
Const view of the local values in a particular vector of this multivector.
Teuchos::RCP< MultiVector > getMultiVector(size_t r) const
return partial multivector associated with block row r
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
virtual Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)
View of the local values in a particular vector of this multivector.
#define XPETRA_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual size_t getNumVectors() const
Number of columns in the multivector.
CombineMode
Xpetra::Combine Mode enumerable type.
#define XPETRA_MONITOR(funcName)
virtual void randomize(bool bUseXpetraImplementation=false)
Set multi-vector values to random numbers.