本文整理汇总了C++中teuchos::RCP::GetProblem方法的典型用法代码示例。如果您正苦于以下问题:C++ RCP::GetProblem方法的具体用法?C++ RCP::GetProblem怎么用?C++ RCP::GetProblem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teuchos::RCP
的用法示例。
在下文中一共展示了RCP::GetProblem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
AmesosBucklingOp::AmesosBucklingOp( Epetra_LinearProblem& problem,
const Teuchos::RCP<Amesos_BaseSolver>& solver,
const Teuchos::RCP<Epetra_Operator>& stiffMtx
)
: solver_(solver),
stiffMtx_(stiffMtx)
{
problem_ = const_cast<Epetra_LinearProblem*>( solver->GetProblem() );
}
示例2:
//-----------------------------------------------------------------------------
// Function : N_LAS_AmesosGenOp::N_LAS_AmesosGenOp
// Purpose : Constructor
// Special Notes :
// Scope : Public
// Creator : Heidi Thornquist, SNL
// Creation Date : 06/04/12
//-----------------------------------------------------------------------------
N_LAS_AmesosGenOp::N_LAS_AmesosGenOp( const Teuchos::RCP<Amesos_BaseSolver>& solver,
const Teuchos::RCP<Epetra_Operator>& B,
bool useTranspose )
: useTranspose_(useTranspose),
solver_(solver),
B_(B)
{
problem_ = Teuchos::rcp( const_cast<Epetra_LinearProblem*>( solver->GetProblem() ), false);
if ( solver_->UseTranspose() )
solver_->SetUseTranspose(!useTranspose);
else
solver_->SetUseTranspose(useTranspose);
if ( B_->UseTranspose() )
B_->SetUseTranspose(!useTranspose);
else
B_->SetUseTranspose(useTranspose);
}
示例3:
AmesosGenOp::AmesosGenOp( Epetra_LinearProblem& problem,
const Teuchos::RCP<Amesos_BaseSolver>& solver,
const Teuchos::RCP<Epetra_Operator>& massMtx,
bool useTranspose )
: useTranspose_(useTranspose),
solver_(solver),
massMtx_(massMtx)
{
problem_ = const_cast<Epetra_LinearProblem*>( solver->GetProblem() );
if ( solver_->UseTranspose() )
solver_->SetUseTranspose(!useTranspose);
else
solver_->SetUseTranspose(useTranspose);
if ( massMtx_->UseTranspose() )
massMtx_->SetUseTranspose(!useTranspose);
else
massMtx_->SetUseTranspose(useTranspose);
}
示例4: invalid_argument
AmesosGenOp::
AmesosGenOp (const Teuchos::RCP<Amesos_BaseSolver>& solver,
const Teuchos::RCP<Epetra_Operator>& massMtx,
const bool useTranspose)
: solver_ (solver),
massMtx_ (massMtx),
problem_ (NULL),
useTranspose_ (useTranspose)
{
if (solver.is_null ()) {
throw std::invalid_argument ("AmesosGenOp constructor: The 'solver' "
"input argument is null.");
}
if (massMtx.is_null ()) {
throw std::invalid_argument ("AmesosGenOp constructor: The 'massMtx' "
"input argument is null.");
}
Epetra_LinearProblem* problem = const_cast<Epetra_LinearProblem*> (solver->GetProblem ());
if (problem == NULL) {
throw std::invalid_argument ("The solver's GetProblem() method returned "
"NULL. This probably means that its "
"LinearProblem has not yet been set.");
}
problem_ = problem;
if (solver_->UseTranspose ()) {
solver_->SetUseTranspose (! useTranspose);
} else {
solver_->SetUseTranspose (useTranspose);
}
if (massMtx_->UseTranspose ()) {
massMtx_->SetUseTranspose (! useTranspose);
} else {
massMtx_->SetUseTranspose (useTranspose);
}
}