本文整理汇总了C++中Epetra_MultiVector::Multiply方法的典型用法代码示例。如果您正苦于以下问题:C++ Epetra_MultiVector::Multiply方法的具体用法?C++ Epetra_MultiVector::Multiply怎么用?C++ Epetra_MultiVector::Multiply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Epetra_MultiVector
的用法示例。
在下文中一共展示了Epetra_MultiVector::Multiply方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
LOCA::Epetra::CompactWYOp::applyCompactWY(const Epetra_MultiVector& x,
Epetra_MultiVector& result_x,
Epetra_MultiVector& result_p) const
{
// Compute Y_x^T*x
result_p.Multiply('T', 'N', 1.0, *Y_x, x, 0.0);
// Compute T*(Y_x^T*x)
dblas.TRMM(Teuchos::LEFT_SIDE, Teuchos::UPPER_TRI, Teuchos::NO_TRANS,
Teuchos::NON_UNIT_DIAG, result_p.MyLength(),
result_p.NumVectors(), 1.0, T.Values(), T.MyLength(),
result_p.Values(), result_p.MyLength());
// Compute x = x + Y_x*T*(Y_x^T*x)
result_x = x;
result_x.Multiply('N', 'N', 1.0, *Y_x, result_p, 1.0);
// Compute result_p = Y_p*T*(Y_x^T*x)
dblas.TRMM(Teuchos::LEFT_SIDE, Teuchos::LOWER_TRI, Teuchos::NO_TRANS,
Teuchos::UNIT_DIAG, result_p.MyLength(),
result_p.NumVectors(), 1.0, Y_p.Values(), Y_p.MyLength(),
result_p.Values(), result_p.MyLength());
}
示例2: return
// ============================================================================
int ML_Epetra::MatrixFreePreconditioner::
ApplyJacobi(Epetra_MultiVector& X, const double omega) const
{
ML_CHK_ERR(X.Multiply((double)omega, *InvPointDiagonal_, X, 0.0));
return(0);
}
示例3:
int
Stokhos::EpetraMultiVectorOperator::Apply(const Epetra_MultiVector& Input,
Epetra_MultiVector& Result) const
{
char trans = 'T';
if (useTranspose)
trans = 'N';
int ret = Result.Multiply(trans, 'N', 1.0, *multi_vec, Input, 0.0);
return ret;
}
示例4:
void
Stokhos::EpetraMultiVectorOrthogPoly::
computeStandardDeviation(Epetra_MultiVector& v) const
{
const Teuchos::Array<double>& nrm2 = this->basis_->norm_squared();
v.PutScalar(0.0);
for (int i=1; i<this->size(); i++)
v.Multiply(nrm2[i], *coeff_[i], *coeff_[i], 1.0);
for (int j=0; j<v.NumVectors(); j++)
for (int i=0; i<v.MyLength(); i++)
v[j][i] = std::sqrt(v[j][i]);
}
示例5:
int
Stokhos::EpetraMultiVectorOperator::
Apply(const Epetra_MultiVector& Input, Epetra_MultiVector& Result) const
{
char trans = 'N';
if (useTranspose)
trans = 'T';
int ret = Result.Multiply(trans, 'N', 1.0, *multi_vec, Input, 0.0);
TEUCHOS_TEST_FOR_EXCEPTION(ret != 0, std::logic_error,
"Error! Stokhos::EpetraMultiVectorOperator: " <<
"Result.Multiply() returned " << ret << "!");
return ret;
}
示例6: ApplyInverse
//=============================================================================
// This function finds Y such that LDU Y = X or U(trans) D L(trans) Y = X for multiple RHS
int Ifpack_IC::ApplyInverse(const Epetra_MultiVector& X,
Epetra_MultiVector& Y) const
{
if (!IsComputed())
IFPACK_CHK_ERR(-3); // compute preconditioner first
if (X.NumVectors() != Y.NumVectors())
IFPACK_CHK_ERR(-2); // Return error: X and Y not the same size
Time_.ResetStartTime();
bool Upper = true;
bool UnitDiagonal = true;
// AztecOO gives X and Y pointing to the same memory location,
// need to create an auxiliary vector, Xcopy
RefCountPtr< const Epetra_MultiVector > Xcopy;
if (X.Pointers()[0] == Y.Pointers()[0])
Xcopy = rcp( new Epetra_MultiVector(X) );
else
Xcopy = rcp( &X, false );
U_->Solve(Upper, true, UnitDiagonal, *Xcopy, Y);
Y.Multiply(1.0, *D_, Y, 0.0); // y = D*y (D_ has inverse of diagonal)
U_->Solve(Upper, false, UnitDiagonal, Y, Y); // Solve Uy = y
#ifdef IFPACK_FLOPCOUNTERS
ApplyInverseFlops_ += 4.0 * U_->NumGlobalNonzeros();
ApplyInverseFlops_ += D_->GlobalLength();
#endif
++NumApplyInverse_;
ApplyInverseTime_ += Time_.ElapsedTime();
return(0);
}
示例7: init
int
LOCA::Epetra::CompactWYOp::Apply(const Epetra_MultiVector& Input,
Epetra_MultiVector& Result) const
{
if (tmpMat1 == NULL || tmpMV == NULL) {
globalData->locaErrorCheck->throwError(
"LOCA::Epetra::CompactWYOp::Apply()",
"Must call init() before Apply()!");
return -1;
}
// Apply Householder transformation using temporary vector
applyCompactWY(Input, *tmpMV, *tmpMat1);
// Compute J*tmpMV
J->Apply(*tmpMV, Result);
// Compute J*tmpMV + A*tmpMat1
if (A.get() != NULL)
Result.Multiply('N', 'N', 1.0, *A, *tmpMat1, 1.0);
return 0;
}