本文整理汇总了C++中MultiVector::doExport方法的典型用法代码示例。如果您正苦于以下问题:C++ MultiVector::doExport方法的具体用法?C++ MultiVector::doExport怎么用?C++ MultiVector::doExport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiVector
的用法示例。
在下文中一共展示了MultiVector::doExport方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void
apply (const MultiVector<S,LO,GO,Node> &X,
MultiVector<S,LO,GO,Node> &Y,
Teuchos::ETransp mode = Teuchos::NO_TRANS,
S alpha = Teuchos::ScalarTraits<S>::one (),
S beta = Teuchos::ScalarTraits<S>::zero ()) const
{
const size_t numVectors = X.getNumVectors ();
RCP<MultiVector<S,LO,GO,Node> > mvec_inout;
RCP<const MultiVector<S,LO,GO,Node> > mvec_in2;
if (_importer != null) {
if (_importMV != null && _importMV->getNumVectors () != numVectors) {
_importMV = null;
}
if (_importMV == null) {
_importMV = createMultiVector<S> (_importer->getTargetMap (), numVectors);
}
_importMV->doImport (X, *_importer, INSERT);
mvec_in2 = _importMV;
}
else {
mvec_in2 = rcpFromRef(X);
}
if (_exporter != null) {
if (_exportMV != null && _exportMV->getNumVectors () != numVectors) {
_exportMV = null;
}
if (_exportMV == null) {
_exportMV = createMultiVector<S> (_exporter->getSourceMap (), numVectors);
}
mvec_inout = _exportMV;
}
else {
mvec_inout = rcpFromRef (Y);
}
_kernel.setAlphaBeta (alpha, beta);
//
for (size_t j=0; j < numVectors; ++j) {
RCP< Vector<S,LO,GO,Node> > vec_inout = mvec_inout->getVectorNonConst(j);
RCP< const Vector<S,LO,GO,Node> > vec_in2 = mvec_in2->getVector(j);
Tpetra::RTI::detail::binary_transform( *vec_inout, *vec_in2, _kernel );
}
// export
if (_exporter != null) {
Y.doExport (*_exportMV, *_exporter, ADD);
}
}
示例2: InsertVector
void InsertVector(const MultiVector& partial, size_t block, MultiVector& full) const {
TEUCHOS_TEST_FOR_EXCEPTION(maps_[block] == null, Xpetra::Exceptions::RuntimeError,
"InsertVector: maps_[" << block << "] is null");
full.doExport(partial, *importers_[block], Xpetra::INSERT);
}