本文整理汇总了C++中MultiVec类的典型用法代码示例。如果您正苦于以下问题:C++ MultiVec类的具体用法?C++ MultiVec怎么用?C++ MultiVec使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MultiVec类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MvDot
/*! \brief Compute a vector \c b where the components are the individual dot-products of the \c i-th columns of \c A and \c mv, i.e.\f$b[i] = A[i]^H mv[i]\f$.
*/
static void MvDot( const MultiVec<ScalarType>& mv, const MultiVec<ScalarType>& A, std::vector<ScalarType> & b
#ifdef HAVE_ANASAZI_EXPERIMENTAL
, ConjType conj = Anasazi::CONJ
#endif
)
{ mv.MvDot( A, b
#ifdef HAVE_ANASAZI_EXPERIMENTAL
, conj
#endif
); }
示例2: MvTransMv
/*! \brief Compute a dense matrix \c B through the matrix-matrix multiply \f$ \alpha A^Tmv \f$.
*/
static void MvTransMv( ScalarType alpha, const MultiVec<ScalarType>& A, const MultiVec<ScalarType>& mv, Teuchos::SerialDenseMatrix<int,ScalarType>& B
#ifdef HAVE_ANASAZI_EXPERIMENTAL
, ConjType conj = Anasazi::CONJ
#endif
)
{ mv.MvTransMv(alpha, A, B
#ifdef HAVE_ANASAZI_EXPERIMENTAL
, conj
#endif
); }
示例3: temp_vec
void EpetraOpMultiVec::SetBlock( const MultiVec<double>& A, const std::vector<int>& index )
{
// this should be revisited to e
EpetraOpMultiVec temp_vec(Epetra_OP, Epetra_DataAccess::View, *Epetra_MV, index);
int numvecs = index.size();
if ( A.GetNumberVecs() != numvecs ) {
std::vector<int> index2( numvecs );
for(int i=0; i<numvecs; i++)
index2[i] = i;
EpetraOpMultiVec *tmp_vec = dynamic_cast<EpetraOpMultiVec *>(&const_cast<MultiVec<double> &>(A));
TEUCHOS_TEST_FOR_EXCEPTION( tmp_vec==NULL, std::invalid_argument, "Anasazi::EpetraOpMultiVec::SetBlocks() cast of MultiVec<double> to EpetraOpMultiVec failed.");
EpetraOpMultiVec A_vec(Epetra_OP, Epetra_DataAccess::View, *(tmp_vec->GetEpetraMultiVector()), index2);
temp_vec.MvAddMv( 1.0, A_vec, 0.0, A_vec );
}
else {
temp_vec.MvAddMv( 1.0, A, 0.0, A );
}
}
示例4: temp_vec
void EpetraMultiVec::SetBlock( const MultiVec<double>& A, const std::vector<int>& index )
{
EpetraMultiVec temp_vec(View, *this, index);
int numvecs = index.size();
if ( A.GetNumberVecs() != numvecs ) {
std::vector<int> index2( numvecs );
for(int i=0; i<numvecs; i++)
index2[i] = i;
EpetraMultiVec *tmp_vec = dynamic_cast<EpetraMultiVec *>(&const_cast<MultiVec<double> &>(A));
TEST_FOR_EXCEPTION(tmp_vec==NULL, EpetraMultiVecFailure,
"Belos::EpetraMultiVec::SetBlock cast from Belos::MultiVec<> to Belos::EpetraMultiVec failed.");
EpetraMultiVec A_vec(View, *tmp_vec, index2);
temp_vec.MvAddMv( 1.0, A_vec, 0.0, A_vec );
}
else {
temp_vec.MvAddMv( 1.0, A, 0.0, A );
}
}
示例5: MvNorm
static void MvNorm( const MultiVec<ScalarType>& mv, std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType>& normvec, NormType type = TwoNorm )
{ mv.MvNorm(normvec,type); }
示例6: MvDot
static void MvDot( const MultiVec<ScalarType>& mv, const MultiVec<ScalarType>& A, std::vector<ScalarType>& b )
{ mv.MvDot( A, b ); }
示例7: MvTransMv
static void MvTransMv( const ScalarType alpha, const MultiVec<ScalarType>& A, const MultiVec<ScalarType>& mv, Teuchos::SerialDenseMatrix<int,ScalarType>& B )
{ mv.MvTransMv(alpha, A, B); }
示例8: MvScale
static void MvScale ( MultiVec<ScalarType>& mv, const std::vector<ScalarType>& alpha )
{ mv.MvScale(alpha); }
示例9: MvInit
static void MvInit( MultiVec<ScalarType>& mv, ScalarType alpha = Teuchos::ScalarTraits<ScalarType>::zero() )
{ mv.MvInit(alpha); }
示例10: GetNumberVecs
static int GetNumberVecs( const MultiVec<ScalarType>& mv )
{ return mv.GetNumberVecs(); }
示例11: GetVecLength
static int GetVecLength( const MultiVec<ScalarType>& mv )
{ return mv.GetVecLength(); }
示例12: CloneViewNonConst
static Teuchos::RCP<MultiVec<ScalarType> >
CloneViewNonConst (MultiVec<ScalarType>& mv, const std::vector<int>& index)
{
return Teuchos::rcp( mv.CloneViewNonConst(index) );
}
示例13: GetGlobalLength
//! Obtain the vector length of \c mv.
static ptrdiff_t GetGlobalLength( const MultiVec<ScalarType>& mv )
{ return mv.GetGlobalLength(); }
示例14: SetBlock
static void SetBlock( const MultiVec<ScalarType>& A, const std::vector<int>& index, MultiVec<ScalarType>& mv )
{ mv.SetBlock(A, index); }
示例15: MvRandom
static void MvRandom( MultiVec<ScalarType>& mv )
{ mv.MvRandom(); }