19#ifndef AMESOS2_SOLVERCORE_DEF_HPP
20#define AMESOS2_SOLVERCORE_DEF_HPP
22#include "Kokkos_ArithTraits.hpp"
24#include "Amesos2_MatrixAdapter_def.hpp"
25#include "Amesos2_MultiVecAdapter_def.hpp"
29#include "KokkosSparse_spmv.hpp"
30#include "KokkosBlas.hpp"
35template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
37 Teuchos::RCP<const Matrix> A,
38 Teuchos::RCP<Vector> X,
39 Teuchos::RCP<const Vector> B )
40 :
matrixA_(createConstMatrixAdapter<Matrix>(A))
52 TEUCHOS_TEST_FOR_EXCEPTION(
54 std::invalid_argument,
55 "Matrix shape inappropriate for this solver");
60template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
67template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
71#ifdef HAVE_AMESOS2_TIMERS
72 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
77 int error_code =
static_cast<solver_type*
>(
this)->preOrdering_impl();
78 if (error_code == EXIT_SUCCESS){
80 status_.last_phase_ = PREORDERING;
87template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
91#ifdef HAVE_AMESOS2_TIMERS
92 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
96#ifdef HAVE_AMESOS2_TIMERS
97 Teuchos::TimeMonitor LocalTimer2(
timers_.coreSymFactTime_);
99 if( !
status_.preOrderingDone() ){
106 int error_code =
static_cast<solver_type*
>(
this)->symbolicFactorization_impl();
107 if (error_code == EXIT_SUCCESS){
109 status_.last_phase_ = SYMBFACT;
116template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
120#ifdef HAVE_AMESOS2_TIMERS
121 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
124#ifdef HAVE_AMESOS2_TIMERS
125 Teuchos::TimeMonitor LocalTimer2(
timers_.coreNumFactTime_);
127 if( !
status_.symbolicFactorizationDone() ){
134 int error_code =
static_cast<solver_type*
>(
this)->numericFactorization_impl();
135 if (error_code == EXIT_SUCCESS){
145template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
152template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
155 const Teuchos::Ptr<const Vector> B)
const
157#ifdef HAVE_AMESOS2_TIMERS
158 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
169 const Teuchos::RCP<MultiVecAdapter<Vector> > x =
171 const Teuchos::RCP<const MultiVecAdapter<Vector> > b =
172 createConstMultiVecAdapter<Vector>(Teuchos::rcpFromPtr(B));
174#ifdef HAVE_AMESOS2_DEBUG
176 TEUCHOS_TEST_FOR_EXCEPTION
177 (x->getGlobalLength() !=
matrixA_->getGlobalNumCols(),
178 std::invalid_argument,
179 "MultiVector X must have length equal to the number of "
180 "global columns in A. X->getGlobalLength() = "
181 << x->getGlobalLength() <<
" != A->getGlobalNumCols() = "
182 <<
matrixA_->getGlobalNumCols() <<
".");
184 TEUCHOS_TEST_FOR_EXCEPTION(b->getGlobalLength() !=
matrixA_->getGlobalNumRows(),
185 std::invalid_argument,
186 "MultiVector B must have length equal to the number of "
189 TEUCHOS_TEST_FOR_EXCEPTION(x->getGlobalNumVectors() != b->getGlobalNumVectors(),
190 std::invalid_argument,
191 "X and B MultiVectors must have the same number of vectors");
194 if( !
status_.numericFactorizationDone() ){
197 const_cast<type&
>(*this).numericFactorization();
201#ifdef HAVE_AMESOS2_TIMERS
202 Teuchos::TimeMonitor LocalTimer2(
timers_.coreSolveTime_);
204 int error_code =
static_cast<const solver_type*
>(
this)->solve_impl(Teuchos::outArg(*x), Teuchos::ptrInArg(*b));
205 if (error_code == EXIT_SUCCESS){
212template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
216 solve(Teuchos::ptr(X), Teuchos::ptr(B));
220template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
222SolverCore<ConcreteSolver,Matrix,Vector>::solve_ir(
const int maxNumIters,
const bool verbose)
224 return solve_ir(multiVecX_.ptr(), multiVecB_.ptr(), maxNumIters, verbose);
227template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
229SolverCore<ConcreteSolver,Matrix,Vector>::solve_ir(Vector* X,
const Vector* B,
const int maxNumIters,
const bool verbose)
const
231 return solve_ir(Teuchos::ptr(X), Teuchos::ptr(B), maxNumIters, verbose);
234template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
236SolverCore<ConcreteSolver,Matrix,Vector>::solve_ir(
const Teuchos::Ptr< Vector> x,
237 const Teuchos::Ptr<const Vector> b,
238 const int maxNumIters,
239 const bool verbose)
const
241 using KAT = Kokkos::ArithTraits<scalar_type>;
242 using impl_scalar_type =
typename KAT::val_type;
243 using magni_type =
typename KAT::mag_type;
244 using host_execution_space = Kokkos::DefaultHostExecutionSpace;
245 using host_crsmat_t = KokkosSparse::CrsMatrix<impl_scalar_type, int, host_execution_space, void, int>;
246 using host_graph_t =
typename host_crsmat_t::StaticCrsGraphType;
247 using host_values_t =
typename host_crsmat_t::values_type::non_const_type;
248 using host_row_map_t =
typename host_graph_t::row_map_type::non_const_type;
249 using host_colinds_t =
typename host_graph_t::entries_type::non_const_type;
250 using host_mvector_t = Kokkos::View<impl_scalar_type **, Kokkos::LayoutLeft, host_execution_space>;
251 using host_vector_t = Kokkos::View<impl_scalar_type *, Kokkos::LayoutLeft, host_execution_space>;
252 using host_magni_view = Kokkos::View<magni_type *, Kokkos::LayoutLeft, host_execution_space>;
254 const impl_scalar_type one(1.0);
255 const impl_scalar_type mone = impl_scalar_type(-one);
256 const magni_type eps = KAT::eps ();
261 Teuchos::RCP<const MVAdapter> B = createConstMultiVecAdapter<Vector>(Teuchos::rcpFromPtr(b));
263 auto r_ = B->clone();
264 auto e_ = X->clone();
270 const size_t nrhs = X->getGlobalNumVectors();
271 const int nnz = this->matrixA_->getGlobalNNZ();
272 const int nrows = this->matrixA_->getGlobalNumRows();
275 host_crsmat_t crsmat;
276 host_graph_t static_graph;
277 host_row_map_t rowmap_view;
278 host_colinds_t colind_view;
279 host_values_t values_view;
281 Kokkos::resize(rowmap_view, 1+nrows);
282 Kokkos::resize(colind_view, nnz);
283 Kokkos::resize(values_view, nnz);
285 Kokkos::resize(rowmap_view, 1);
286 Kokkos::resize(colind_view, 0);
287 Kokkos::resize(values_view, 0);
293 this->matrixA_.ptr(),
294 values_view, colind_view, rowmap_view,
298 static_graph = host_graph_t(colind_view, rowmap_view);
299 crsmat = host_crsmat_t(
"CrsMatrix", nrows, values_view, static_graph);
304 static_cast<const solver_type*
>(
this)->solve_impl(Teuchos::outArg(*X), Teuchos::ptrInArg(*B));
308 const int ldx = (this->root_ ? X->getGlobalLength() : 0);
309 const int ldb = (this->root_ ? B->getGlobalLength() : 0);
310 const int ldr = (this->root_ ? R->getGlobalLength() : 0);
311 const int lde = (this->root_ ? E->getGlobalLength() : 0);
312 const bool initialize_data =
true;
313 const bool not_initialize_data =
true;
314 host_mvector_t X_view;
315 host_mvector_t B_view;
316 host_mvector_t R_view;
317 host_mvector_t E_view;
319 global_size_type rowIndexBase = this->rowIndexBase_;
320 auto Xptr = Teuchos::Ptr< MVAdapter>(X.ptr());
321 auto Bptr = Teuchos::Ptr<const MVAdapter>(B.ptr());
322 auto Rptr = Teuchos::Ptr< MVAdapter>(R.ptr());
323 auto Eptr = Teuchos::Ptr< MVAdapter>(E.ptr());
324 Util::get_1d_copy_helper_kokkos_view<MVAdapter, host_mvector_t>::
326 Util::get_1d_copy_helper_kokkos_view<MVAdapter, host_mvector_t>::
328 Util::get_1d_copy_helper_kokkos_view<MVAdapter, host_mvector_t>::
330 Util::get_1d_copy_helper_kokkos_view<MVAdapter, host_mvector_t>::
334 host_magni_view x0norms(
"x0norms", nrhs);
335 host_magni_view bnorms(
"bnorms", nrhs);
336 host_magni_view enorms(
"enorms", nrhs);
339 for (
size_t j = 0; j < nrhs; j++) {
340 auto x_subview = Kokkos::subview(X_view, Kokkos::ALL(), j);
341 host_vector_t x_1d (
const_cast<impl_scalar_type*
>(x_subview.data()), x_subview.extent(0));
342 x0norms(j) = KokkosBlas::nrm2(x_1d);
345 std::cout << std::endl
346 <<
" SolverCore :: solve_ir (maxNumIters = " << maxNumIters
347 <<
", tol = " << x0norms(0) <<
" * " << eps <<
" = " << x0norms(0)*eps
353 std::cout <<
" bnorm = ";
354 for (
size_t j = 0; j < nrhs; j++) {
355 auto b_subview = Kokkos::subview(B_view, Kokkos::ALL(), j);
356 host_vector_t b_1d (
const_cast<impl_scalar_type*
>(b_subview.data()), b_subview.extent(0));
357 bnorms(j) = KokkosBlas::nrm2(b_1d);
358 std::cout << bnorms(j) <<
", ";
360 std::cout << std::endl;
369 for (numIters = 0; numIters < maxNumIters && converged == 0; ++numIters) {
372 Kokkos::deep_copy(R_view, B_view);
373 KokkosSparse::spmv(
"N", mone, crsmat, X_view, one, R_view);
378 std::cout <<
" > " << numIters <<
" : norm(r,x,e) = ";
379 for (
size_t j = 0; j < nrhs; j++) {
380 auto r_subview = Kokkos::subview(R_view, Kokkos::ALL(), j);
381 auto x_subview = Kokkos::subview(X_view, Kokkos::ALL(), j);
382 host_vector_t r_1d (
const_cast<impl_scalar_type*
>(r_subview.data()), r_subview.extent(0));
383 host_vector_t x_1d (
const_cast<impl_scalar_type*
>(x_subview.data()), x_subview.extent(0));
384 impl_scalar_type rnorm = KokkosBlas::nrm2(r_1d);
385 impl_scalar_type xnorm = KokkosBlas::nrm2(x_1d);
386 std::cout << rnorm <<
" -> " << rnorm/bnorms(j) <<
" " << xnorm <<
" " << enorms(j) <<
", ";
388 std::cout << std::endl;
393 Util::put_1d_data_helper_kokkos_view<MVAdapter, host_mvector_t>::
395 static_cast<const solver_type*
>(
this)->solve_impl(Teuchos::outArg(*E), Teuchos::ptrInArg(*R));
396 Util::get_1d_copy_helper_kokkos_view<MVAdapter, host_mvector_t>::
401 KokkosBlas::axpy(one, E_view, X_view);
403 if (numIters < maxNumIters-1) {
406 for (
size_t j = 0; j < nrhs; j++) {
407 auto e_subview = Kokkos::subview(E_view, Kokkos::ALL(), j);
408 host_vector_t e_1d (
const_cast<impl_scalar_type*
>(e_subview.data()), e_subview.extent(0));
409 enorms(j) = KokkosBlas::nrm2(e_1d);
410 if (enorms(j) > eps * x0norms(j)) {
414 if (verbose && converged) {
415 std::cout <<
" converged " << std::endl;
421 Teuchos::broadcast(*(this->matrixA_->getComm()), 0, &converged);
424 if (verbose && this->root_) {
426 Kokkos::deep_copy(R_view, B_view);
427 KokkosSparse::spmv(
"N", mone, crsmat, X_view, one, R_view);
429 std::cout <<
" > final residual norm = ";
430 for (
size_t j = 0; j < nrhs; j++) {
431 auto r_subview = Kokkos::subview(R_view, Kokkos::ALL(), j);
432 host_vector_t r_1d (
const_cast<impl_scalar_type*
>(r_subview.data()), r_subview.extent(0));
433 scalar_type rnorm = KokkosBlas::nrm2(r_1d);
434 std::cout << rnorm <<
" -> " << rnorm/bnorms(j) <<
", ";
436 std::cout << std::endl << std::endl;
440 Util::put_1d_data_helper_kokkos_view<MVAdapter, host_mvector_t>::
446template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
450#ifdef HAVE_AMESOS2_TIMERS
451 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
454 return(
static_cast<solver_type*
>(
this)->matrixShapeOK_impl() );
460template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
465 matrixA_ = createConstMatrixAdapter(a);
467#ifdef HAVE_AMESOS2_DEBUG
468 TEUCHOS_TEST_FOR_EXCEPTION( (keep_phase != CLEAN) &&
471 std::invalid_argument,
472 "Dimensions of new matrix be the same as the old matrix if "
473 "keeping any solver phase" );
476 status_.last_phase_ = keep_phase;
503template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
506 const Teuchos::RCP<Teuchos::ParameterList> & parameterList )
508#ifdef HAVE_AMESOS2_TIMERS
509 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
512 if( parameterList->name() ==
"Amesos2" ){
515 parameterList->validateParameters(*valid_params);
518 control_.setControlParameters(parameterList);
522 if( parameterList->isSublist(
name()) ){
525 control_.setControlParameters(Teuchos::sublist(parameterList,
name()));
527 static_cast<solver_type*
>(
this)->setParameters_impl(Teuchos::sublist(parameterList,
name()));
535template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
536Teuchos::RCP<const Teuchos::ParameterList>
539#ifdef HAVE_AMESOS2_TIMERS
540 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_ );
543 using Teuchos::ParameterList;
548 RCP<ParameterList> control_params = rcp(
new ParameterList(
"Amesos2"));
549 control_params->set(
"Transpose",
false,
"Whether to solve with the matrix transpose");
550 control_params->set(
"Iterative refinement",
false,
"Whether to solve with iterative refinement");
551 control_params->set(
"Number of iterative refinements", 2,
"Number of iterative refinements");
552 control_params->set(
"Verboes for iterative refinement",
false,
"Verbosity for iterative refinements");
558 RCP<const ParameterList>
559 solver_params =
static_cast<const solver_type*
>(
this)->getValidParameters_impl();
561 Teuchos::rcp_const_cast<ParameterList>(solver_params)->set(
"Transpose",
false,
562 "Whether to solve with the "
565 RCP<ParameterList> amesos2_params = rcp(
new ParameterList(
"Amesos2"));
566 amesos2_params->setParameters(*control_params);
567 amesos2_params->set(
name(), *solver_params);
569 return amesos2_params;
573template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
577 std::ostringstream oss;
578 oss <<
name() <<
" solver interface";
583template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
586 Teuchos::FancyOStream &out,
587 const Teuchos::EVerbosityLevel verbLevel)
const
592 using Teuchos::VERB_DEFAULT;
593 using Teuchos::VERB_NONE;
594 using Teuchos::VERB_LOW;
595 using Teuchos::VERB_MEDIUM;
596 using Teuchos::VERB_HIGH;
597 using Teuchos::VERB_EXTREME;
598 Teuchos::EVerbosityLevel vl = verbLevel;
599 if (vl == VERB_DEFAULT) vl = VERB_LOW;
600 Teuchos::RCP<const Teuchos::Comm<int> > comm = this->
getComm();
605 width = std::max<size_t>(width,
size_t(11)) + 2;
606 Teuchos::OSTab tab(out);
614 if( vl != VERB_NONE ) {
615 std::string p =
name();
616 Util::printLine(out);
617 out << this->
description() << std::endl << std::endl;
622 if( vl == VERB_MEDIUM || vl == VERB_HIGH || vl == VERB_EXTREME ){
623 out << p <<
"Nonzero elements per row = "
626 out << p <<
"Percentage of nonzero elements = "
630 if( vl == VERB_HIGH || vl == VERB_EXTREME ){
631 out << p <<
"Use transpose = " <<
control_.useTranspose_
633 out << p <<
"Use iterative refinement = " <<
control_.useIterRefine_
636 if ( vl == VERB_EXTREME ){
639 Util::printLine(out);
644template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
647 Teuchos::FancyOStream &out,
648 const Teuchos::EVerbosityLevel verbLevel)
const
652 double preTime =
timers_.preOrderTime_.totalElapsedTime();
653 double symTime =
timers_.symFactTime_.totalElapsedTime();
654 double numTime =
timers_.numFactTime_.totalElapsedTime();
655 double solTime =
timers_.solveTime_.totalElapsedTime();
656 double totTime =
timers_.totalTime_.totalElapsedTime();
657 double overhead = totTime - (preTime + symTime + numTime + solTime);
659 std::string p =
name() +
" : ";
660 Util::printLine(out);
662 if(verbLevel != Teuchos::VERB_NONE)
664 out << p <<
"Time to convert matrix to implementation format = "
665 <<
timers_.mtxConvTime_.totalElapsedTime() <<
" (s)"
667 out << p <<
"Time to redistribute matrix = "
668 <<
timers_.mtxRedistTime_.totalElapsedTime() <<
" (s)"
671 out << p <<
"Time to convert vectors to implementation format = "
672 <<
timers_.vecConvTime_.totalElapsedTime() <<
" (s)"
674 out << p <<
"Time to redistribute vectors = "
675 <<
timers_.vecRedistTime_.totalElapsedTime() <<
" (s)"
678 out << p <<
"Number of pre-orderings = "
681 out << p <<
"Time for pre-ordering = "
682 << preTime <<
" (s), avg = "
683 << preTime /
status_.getNumPreOrder() <<
" (s)"
686 out << p <<
"Number of symbolic factorizations = "
687 <<
status_.getNumSymbolicFact()
689 out << p <<
"Time for sym fact = "
690 << symTime <<
" (s), avg = "
691 << symTime /
status_.getNumSymbolicFact() <<
" (s)"
694 out << p <<
"Number of numeric factorizations = "
697 out << p <<
"Time for num fact = "
698 << numTime <<
" (s), avg = "
699 << numTime /
status_.getNumNumericFact() <<
" (s)"
702 out << p <<
"Number of solve phases = "
705 out << p <<
"Time for solve = "
706 << solTime <<
" (s), avg = "
707 << solTime /
status_.getNumSolve() <<
" (s)"
710 out << p <<
"Total time spent in Amesos2 = "
713 out << p <<
"Total time spent in the Amesos2 interface = "
714 << overhead <<
" (s)"
716 out << p <<
" (the above time does not include solver time)"
718 out << p <<
"Amesos2 interface time / total time = "
719 << overhead / totTime
721 Util::printLine(out);
726template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
729 Teuchos::ParameterList& timingParameterList)
const
731 Teuchos::ParameterList temp;
732 timingParameterList = temp.setName(
"NULL");
736template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
740 std::string solverName = solver_type::name;
744template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
748 matrix_loaded_ =
static_cast<solver_type*
>(
this)->loadA_impl(current_phase);
@ ROOTED
Definition Amesos2_TypeDecl.hpp:93
@ CONTIGUOUS_AND_ROOTED
Definition Amesos2_TypeDecl.hpp:94
@ ARBITRARY
Definition Amesos2_TypeDecl.hpp:109
Utility functions for Amesos2.
A Matrix adapter interface for Amesos2.
Definition Amesos2_MatrixAdapter_decl.hpp:42
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Return a const parameter list of all of the valid parameters that this->setParameterList(....
Definition Amesos2_SolverCore_def.hpp:537
super_type & setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶meterList) override
Set/update internal variables and solver options.
Definition Amesos2_SolverCore_def.hpp:505
int nprocs_
Number of process images in the matrix communicator.
Definition Amesos2_SolverCore_decl.hpp:475
void solve() override
Solves (or ).
Definition Amesos2_SolverCore_def.hpp:147
Teuchos::RCP< const MatrixAdapter< Matrix > > matrixA_
The LHS operator.
Definition Amesos2_SolverCore_decl.hpp:421
int rank_
The MPI rank of this image.
Definition Amesos2_SolverCore_decl.hpp:469
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const override
Definition Amesos2_SolverCore_def.hpp:585
bool root_
If true, then this is the root processor.
Definition Amesos2_SolverCore_decl.hpp:472
std::string description() const override
Returns a short description of this Solver.
Definition Amesos2_SolverCore_def.hpp:575
SolverCore(Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
Initialize a Solver instance.
Definition Amesos2_SolverCore_def.hpp:36
void getTiming(Teuchos::ParameterList &timingParameterList) const override
Extracts timing information from the current solver.
Definition Amesos2_SolverCore_def.hpp:728
void printTiming(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
Prints timing information about the current solver.
Definition Amesos2_SolverCore_def.hpp:646
global_size_type rowIndexBase_
Index base of rowmap of matrixA_.
Definition Amesos2_SolverCore_decl.hpp:451
super_type & preOrdering() override
Pre-orders the matrix A for minimal fill-in.
Definition Amesos2_SolverCore_def.hpp:69
global_size_type globalNumCols_
Number of global columns in matrixA_.
Definition Amesos2_SolverCore_decl.hpp:445
void loadA(EPhase current_phase)
Refresh this solver's internal data about A.
Definition Amesos2_SolverCore_def.hpp:746
bool matrix_loaded_
Definition Amesos2_SolverCore_decl.hpp:428
std::string name() const override
Return the name of this solver.
Definition Amesos2_SolverCore_def.hpp:738
global_size_type columnIndexBase_
Index base of column map of matrixA_.
Definition Amesos2_SolverCore_decl.hpp:454
Timers timers_
Various timing statistics.
Definition Amesos2_SolverCore_decl.hpp:463
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const override
Returns a pointer to the Teuchos::Comm communicator with this operator.
Definition Amesos2_SolverCore_decl.hpp:329
global_size_type globalNumNonZeros_
Number of global non-zero values in matrixA_.
Definition Amesos2_SolverCore_decl.hpp:448
global_size_type globalNumRows_
Number of global rows in matrixA_.
Definition Amesos2_SolverCore_decl.hpp:442
Status status_
Holds status information about a solver.
Definition Amesos2_SolverCore_decl.hpp:457
~SolverCore()
Destructor.
Definition Amesos2_SolverCore_def.hpp:61
Teuchos::RCP< const Vector > multiVecB_
The RHS vector/multi-vector.
Definition Amesos2_SolverCore_decl.hpp:439
Control control_
Parameters for solving.
Definition Amesos2_SolverCore_decl.hpp:460
super_type & symbolicFactorization() override
Performs symbolic factorization on the matrix A.
Definition Amesos2_SolverCore_def.hpp:89
super_type & numericFactorization() override
Performs numeric factorization on the matrix A.
Definition Amesos2_SolverCore_def.hpp:118
void setA(const Teuchos::RCP< const Matrix > a, EPhase keep_phase=CLEAN) override
Sets the matrix A of this solver.
Definition Amesos2_SolverCore_def.hpp:462
Teuchos::RCP< Vector > multiVecX_
The LHS vector/multi-vector.
Definition Amesos2_SolverCore_decl.hpp:432
bool matrixShapeOK() override
Returns true if the solver can handle this matrix shape.
Definition Amesos2_SolverCore_def.hpp:448
Interface to Amesos2 solver objects.
Definition Amesos2_Solver_decl.hpp:44
EPhase
Used to indicate a phase in the direct solution.
Definition Amesos2_TypeDecl.hpp:31
const int size
Definition klu2_simple.cpp:50
A templated MultiVector class adapter for Amesos2.
Definition Amesos2_MultiVecAdapter_decl.hpp:142
Teuchos::RCP< MultiVecAdapter< MV > > createMultiVecAdapter(Teuchos::RCP< MV > mv)
Factory creation method for MultiVecAdapters.
Definition Amesos2_MultiVecAdapter_decl.hpp:154
Similar to get_ccs_helper , but used to get a CRS representation of the given matrix.
Definition Amesos2_Util.hpp:626