19#ifndef AMESOS2_SOLVERCORE_DEF_HPP
20#define AMESOS2_SOLVERCORE_DEF_HPP
22#if KOKKOS_VERSION >= 40799
23#include "KokkosKernels_ArithTraits.hpp"
25#include "Kokkos_ArithTraits.hpp"
28#include "Amesos2_MatrixAdapter_def.hpp"
29#include "Amesos2_MultiVecAdapter_def.hpp"
33#include "KokkosSparse_spmv.hpp"
34#include "KokkosBlas.hpp"
39template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
41 Teuchos::RCP<const Matrix> A,
42 Teuchos::RCP<Vector> X,
43 Teuchos::RCP<const Vector> B )
44 :
matrixA_(createConstMatrixAdapter<Matrix>(A))
56 TEUCHOS_TEST_FOR_EXCEPTION(
58 std::invalid_argument,
59 "Matrix shape inappropriate for this solver");
64template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
71template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
75#ifdef HAVE_AMESOS2_TIMERS
76 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
81 int error_code =
static_cast<solver_type*
>(
this)->preOrdering_impl();
82 if (error_code == EXIT_SUCCESS){
84 status_.last_phase_ = PREORDERING;
91template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
95#ifdef HAVE_AMESOS2_TIMERS
96 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
100#ifdef HAVE_AMESOS2_TIMERS
101 Teuchos::TimeMonitor LocalTimer2(
timers_.coreSymFactTime_);
103 if( !
status_.preOrderingDone() ){
110 int error_code =
static_cast<solver_type*
>(
this)->symbolicFactorization_impl();
111 if (error_code == EXIT_SUCCESS){
113 status_.last_phase_ = SYMBFACT;
120template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
124#ifdef HAVE_AMESOS2_TIMERS
125 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
128#ifdef HAVE_AMESOS2_TIMERS
129 Teuchos::TimeMonitor LocalTimer2(
timers_.coreNumFactTime_);
131 if( !
status_.symbolicFactorizationDone() ){
138 int error_code =
static_cast<solver_type*
>(
this)->numericFactorization_impl();
139 if (error_code == EXIT_SUCCESS){
149template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
156template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
159 const Teuchos::Ptr<const Vector> B)
const
161#ifdef HAVE_AMESOS2_TIMERS
162 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
173 const Teuchos::RCP<MultiVecAdapter<Vector> > x =
175 const Teuchos::RCP<const MultiVecAdapter<Vector> > b =
176 createConstMultiVecAdapter<Vector>(Teuchos::rcpFromPtr(B));
178#ifdef HAVE_AMESOS2_DEBUG
180 TEUCHOS_TEST_FOR_EXCEPTION
181 (x->getGlobalLength() !=
matrixA_->getGlobalNumCols(),
182 std::invalid_argument,
183 "MultiVector X must have length equal to the number of "
184 "global columns in A. X->getGlobalLength() = "
185 << x->getGlobalLength() <<
" != A->getGlobalNumCols() = "
186 <<
matrixA_->getGlobalNumCols() <<
".");
188 TEUCHOS_TEST_FOR_EXCEPTION(b->getGlobalLength() !=
matrixA_->getGlobalNumRows(),
189 std::invalid_argument,
190 "MultiVector B must have length equal to the number of "
193 TEUCHOS_TEST_FOR_EXCEPTION(x->getGlobalNumVectors() != b->getGlobalNumVectors(),
194 std::invalid_argument,
195 "X and B MultiVectors must have the same number of vectors");
198 if( !
status_.numericFactorizationDone() ){
201 const_cast<type&
>(*this).numericFactorization();
205#ifdef HAVE_AMESOS2_TIMERS
206 Teuchos::TimeMonitor LocalTimer2(
timers_.coreSolveTime_);
208 int error_code =
static_cast<const solver_type*
>(
this)->solve_impl(Teuchos::outArg(*x), Teuchos::ptrInArg(*b));
209 if (error_code == EXIT_SUCCESS){
216template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
220 solve(Teuchos::ptr(X), Teuchos::ptr(B));
224template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
226SolverCore<ConcreteSolver,Matrix,Vector>::solve_ir(
const int maxNumIters,
const bool verbose)
228 return solve_ir(multiVecX_.ptr(), multiVecB_.ptr(), maxNumIters, verbose);
231template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
233SolverCore<ConcreteSolver,Matrix,Vector>::solve_ir(Vector* X,
const Vector* B,
const int maxNumIters,
const bool verbose)
const
235 return solve_ir(Teuchos::ptr(X), Teuchos::ptr(B), maxNumIters, verbose);
238template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
240SolverCore<ConcreteSolver,Matrix,Vector>::solve_ir(
const Teuchos::Ptr< Vector> x,
241 const Teuchos::Ptr<const Vector> b,
242 const int maxNumIters,
243 const bool verbose)
const
245#if KOKKOS_VERSION >= 40799
246 using KAT = KokkosKernels::ArithTraits<scalar_type>;
248 using KAT = Kokkos::ArithTraits<scalar_type>;
250 using impl_scalar_type =
typename KAT::val_type;
251 using magni_type =
typename KAT::mag_type;
252 using host_execution_space = Kokkos::DefaultHostExecutionSpace;
253 using host_crsmat_t = KokkosSparse::CrsMatrix<impl_scalar_type, int, host_execution_space, void, int>;
254 using host_graph_t =
typename host_crsmat_t::StaticCrsGraphType;
255 using host_values_t =
typename host_crsmat_t::values_type::non_const_type;
256 using host_row_map_t =
typename host_graph_t::row_map_type::non_const_type;
257 using host_colinds_t =
typename host_graph_t::entries_type::non_const_type;
258 using host_mvector_t = Kokkos::View<impl_scalar_type **, Kokkos::LayoutLeft, host_execution_space>;
259 using host_vector_t = Kokkos::View<impl_scalar_type *, Kokkos::LayoutLeft, host_execution_space>;
260 using host_magni_view = Kokkos::View<magni_type *, Kokkos::LayoutLeft, host_execution_space>;
262 const impl_scalar_type one(1.0);
263 const impl_scalar_type mone = impl_scalar_type(-one);
264 const magni_type eps = KAT::eps ();
269 Teuchos::RCP<const MVAdapter> B = createConstMultiVecAdapter<Vector>(Teuchos::rcpFromPtr(b));
271 auto r_ = B->clone();
272 auto e_ = X->clone();
278 const size_t nrhs = X->getGlobalNumVectors();
279 const int nnz = this->matrixA_->getGlobalNNZ();
280 const int nrows = this->matrixA_->getGlobalNumRows();
283 host_crsmat_t crsmat;
284 host_graph_t static_graph;
285 host_row_map_t rowmap_view;
286 host_colinds_t colind_view;
287 host_values_t values_view;
289 Kokkos::resize(rowmap_view, 1+nrows);
290 Kokkos::resize(colind_view, nnz);
291 Kokkos::resize(values_view, nnz);
293 Kokkos::resize(rowmap_view, 1);
294 Kokkos::resize(colind_view, 0);
295 Kokkos::resize(values_view, 0);
301 this->matrixA_.ptr(),
302 values_view, colind_view, rowmap_view,
306 static_graph = host_graph_t(colind_view, rowmap_view);
307 crsmat = host_crsmat_t(
"CrsMatrix", nrows, values_view, static_graph);
312 static_cast<const solver_type*
>(
this)->solve_impl(Teuchos::outArg(*X), Teuchos::ptrInArg(*B));
316 const int ldx = (this->root_ ? X->getGlobalLength() : 0);
317 const int ldb = (this->root_ ? B->getGlobalLength() : 0);
318 const int ldr = (this->root_ ? R->getGlobalLength() : 0);
319 const int lde = (this->root_ ? E->getGlobalLength() : 0);
320 const bool initialize_data =
true;
321 const bool not_initialize_data =
true;
322 host_mvector_t X_view;
323 host_mvector_t B_view;
324 host_mvector_t R_view;
325 host_mvector_t E_view;
327 global_size_type rowIndexBase = this->rowIndexBase_;
328 auto Xptr = Teuchos::Ptr< MVAdapter>(X.ptr());
329 auto Bptr = Teuchos::Ptr<const MVAdapter>(B.ptr());
330 auto Rptr = Teuchos::Ptr< MVAdapter>(R.ptr());
331 auto Eptr = Teuchos::Ptr< MVAdapter>(E.ptr());
332 Util::get_1d_copy_helper_kokkos_view<MVAdapter, host_mvector_t>::
334 Util::get_1d_copy_helper_kokkos_view<MVAdapter, host_mvector_t>::
336 Util::get_1d_copy_helper_kokkos_view<MVAdapter, host_mvector_t>::
338 Util::get_1d_copy_helper_kokkos_view<MVAdapter, host_mvector_t>::
342 host_magni_view x0norms(
"x0norms", nrhs);
343 host_magni_view bnorms(
"bnorms", nrhs);
344 host_magni_view enorms(
"enorms", nrhs);
347 for (
size_t j = 0; j < nrhs; j++) {
348 auto x_subview = Kokkos::subview(X_view, Kokkos::ALL(), j);
349 host_vector_t x_1d (
const_cast<impl_scalar_type*
>(x_subview.data()), x_subview.extent(0));
350 x0norms(j) = KokkosBlas::nrm2(x_1d);
353 std::cout << std::endl
354 <<
" SolverCore :: solve_ir (maxNumIters = " << maxNumIters
355 <<
", tol = " << x0norms(0) <<
" * " << eps <<
" = " << x0norms(0)*eps
361 std::cout <<
" bnorm = ";
362 for (
size_t j = 0; j < nrhs; j++) {
363 auto b_subview = Kokkos::subview(B_view, Kokkos::ALL(), j);
364 host_vector_t b_1d (
const_cast<impl_scalar_type*
>(b_subview.data()), b_subview.extent(0));
365 bnorms(j) = KokkosBlas::nrm2(b_1d);
366 std::cout << bnorms(j) <<
", ";
368 std::cout << std::endl;
377 for (numIters = 0; numIters < maxNumIters && converged == 0; ++numIters) {
380 Kokkos::deep_copy(R_view, B_view);
381 KokkosSparse::spmv(
"N", mone, crsmat, X_view, one, R_view);
386 std::cout <<
" > " << numIters <<
" : norm(r,x,e) = ";
387 for (
size_t j = 0; j < nrhs; j++) {
388 auto r_subview = Kokkos::subview(R_view, Kokkos::ALL(), j);
389 auto x_subview = Kokkos::subview(X_view, Kokkos::ALL(), j);
390 host_vector_t r_1d (
const_cast<impl_scalar_type*
>(r_subview.data()), r_subview.extent(0));
391 host_vector_t x_1d (
const_cast<impl_scalar_type*
>(x_subview.data()), x_subview.extent(0));
392 impl_scalar_type rnorm = KokkosBlas::nrm2(r_1d);
393 impl_scalar_type xnorm = KokkosBlas::nrm2(x_1d);
394 std::cout << rnorm <<
" -> " << rnorm/bnorms(j) <<
" " << xnorm <<
" " << enorms(j) <<
", ";
396 std::cout << std::endl;
401 Util::put_1d_data_helper_kokkos_view<MVAdapter, host_mvector_t>::
403 static_cast<const solver_type*
>(
this)->solve_impl(Teuchos::outArg(*E), Teuchos::ptrInArg(*R));
404 Util::get_1d_copy_helper_kokkos_view<MVAdapter, host_mvector_t>::
409 KokkosBlas::axpy(one, E_view, X_view);
411 if (numIters < maxNumIters-1) {
414 for (
size_t j = 0; j < nrhs; j++) {
415 auto e_subview = Kokkos::subview(E_view, Kokkos::ALL(), j);
416 host_vector_t e_1d (
const_cast<impl_scalar_type*
>(e_subview.data()), e_subview.extent(0));
417 enorms(j) = KokkosBlas::nrm2(e_1d);
418 if (enorms(j) > eps * x0norms(j)) {
422 if (verbose && converged) {
423 std::cout <<
" converged " << std::endl;
429 Teuchos::broadcast(*(this->matrixA_->getComm()), 0, &converged);
432 if (verbose && this->root_) {
434 Kokkos::deep_copy(R_view, B_view);
435 KokkosSparse::spmv(
"N", mone, crsmat, X_view, one, R_view);
437 std::cout <<
" > final residual norm = ";
438 for (
size_t j = 0; j < nrhs; j++) {
439 auto r_subview = Kokkos::subview(R_view, Kokkos::ALL(), j);
440 host_vector_t r_1d (
const_cast<impl_scalar_type*
>(r_subview.data()), r_subview.extent(0));
441 scalar_type rnorm = KokkosBlas::nrm2(r_1d);
442 std::cout << rnorm <<
" -> " << rnorm/bnorms(j) <<
", ";
444 std::cout << std::endl << std::endl;
448 Util::put_1d_data_helper_kokkos_view<MVAdapter, host_mvector_t>::
454template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
458#ifdef HAVE_AMESOS2_TIMERS
459 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
462 return(
static_cast<solver_type*
>(
this)->matrixShapeOK_impl() );
468template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
473 matrixA_ = createConstMatrixAdapter(a);
475#ifdef HAVE_AMESOS2_DEBUG
476 TEUCHOS_TEST_FOR_EXCEPTION( (keep_phase != CLEAN) &&
479 std::invalid_argument,
480 "Dimensions of new matrix be the same as the old matrix if "
481 "keeping any solver phase" );
484 status_.last_phase_ = keep_phase;
511template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
514 const Teuchos::RCP<Teuchos::ParameterList> & parameterList )
516#ifdef HAVE_AMESOS2_TIMERS
517 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_);
520 if( parameterList->name() ==
"Amesos2" ){
523 parameterList->validateParameters(*valid_params);
526 control_.setControlParameters(parameterList);
530 if( parameterList->isSublist(
name()) ){
533 control_.setControlParameters(Teuchos::sublist(parameterList,
name()));
535 static_cast<solver_type*
>(
this)->setParameters_impl(Teuchos::sublist(parameterList,
name()));
543template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
544Teuchos::RCP<const Teuchos::ParameterList>
547#ifdef HAVE_AMESOS2_TIMERS
548 Teuchos::TimeMonitor LocalTimer1(
timers_.totalTime_ );
551 using Teuchos::ParameterList;
556 RCP<ParameterList> control_params = rcp(
new ParameterList(
"Amesos2"));
557 control_params->set(
"Transpose",
false,
"Whether to solve with the matrix transpose");
558 control_params->set(
"Iterative refinement",
false,
"Whether to solve with iterative refinement");
559 control_params->set(
"Number of iterative refinements", 2,
"Number of iterative refinements");
560 control_params->set(
"Verboes for iterative refinement",
false,
"Verbosity for iterative refinements");
566 RCP<const ParameterList>
567 solver_params =
static_cast<const solver_type*
>(
this)->getValidParameters_impl();
569 Teuchos::rcp_const_cast<ParameterList>(solver_params)->set(
"Transpose",
false,
570 "Whether to solve with the "
573 RCP<ParameterList> amesos2_params = rcp(
new ParameterList(
"Amesos2"));
574 amesos2_params->setParameters(*control_params);
575 amesos2_params->set(
name(), *solver_params);
577 return amesos2_params;
581template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
585 std::ostringstream oss;
586 oss <<
name() <<
" solver interface";
591template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
594 Teuchos::FancyOStream &out,
595 const Teuchos::EVerbosityLevel verbLevel)
const
600 using Teuchos::VERB_DEFAULT;
601 using Teuchos::VERB_NONE;
602 using Teuchos::VERB_LOW;
603 using Teuchos::VERB_MEDIUM;
604 using Teuchos::VERB_HIGH;
605 using Teuchos::VERB_EXTREME;
606 Teuchos::EVerbosityLevel vl = verbLevel;
607 if (vl == VERB_DEFAULT) vl = VERB_LOW;
608 Teuchos::RCP<const Teuchos::Comm<int> > comm = this->
getComm();
613 width = std::max<size_t>(width,
size_t(11)) + 2;
614 Teuchos::OSTab tab(out);
622 if( vl != VERB_NONE ) {
623 std::string p =
name();
624 Util::printLine(out);
625 out << this->
description() << std::endl << std::endl;
630 if( vl == VERB_MEDIUM || vl == VERB_HIGH || vl == VERB_EXTREME ){
631 out << p <<
"Nonzero elements per row = "
634 out << p <<
"Percentage of nonzero elements = "
638 if( vl == VERB_HIGH || vl == VERB_EXTREME ){
639 out << p <<
"Use transpose = " <<
control_.useTranspose_
641 out << p <<
"Use iterative refinement = " <<
control_.useIterRefine_
644 if ( vl == VERB_EXTREME ){
647 Util::printLine(out);
652template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
655 Teuchos::FancyOStream &out,
656 const Teuchos::EVerbosityLevel verbLevel)
const
660 double preTime =
timers_.preOrderTime_.totalElapsedTime();
661 double symTime =
timers_.symFactTime_.totalElapsedTime();
662 double numTime =
timers_.numFactTime_.totalElapsedTime();
663 double solTime =
timers_.solveTime_.totalElapsedTime();
664 double totTime =
timers_.totalTime_.totalElapsedTime();
665 double overhead = totTime - (preTime + symTime + numTime + solTime);
667 std::string p =
name() +
" : ";
668 Util::printLine(out);
670 if(verbLevel != Teuchos::VERB_NONE)
672 out << p <<
"Time to convert matrix to implementation format = "
673 <<
timers_.mtxConvTime_.totalElapsedTime() <<
" (s)"
675 out << p <<
"Time to redistribute matrix = "
676 <<
timers_.mtxRedistTime_.totalElapsedTime() <<
" (s)"
679 out << p <<
"Time to convert vectors to implementation format = "
680 <<
timers_.vecConvTime_.totalElapsedTime() <<
" (s)"
682 out << p <<
"Time to redistribute vectors = "
683 <<
timers_.vecRedistTime_.totalElapsedTime() <<
" (s)"
686 out << p <<
"Number of pre-orderings = "
689 out << p <<
"Time for pre-ordering = "
690 << preTime <<
" (s), avg = "
691 << preTime /
status_.getNumPreOrder() <<
" (s)"
694 out << p <<
"Number of symbolic factorizations = "
695 <<
status_.getNumSymbolicFact()
697 out << p <<
"Time for sym fact = "
698 << symTime <<
" (s), avg = "
699 << symTime /
status_.getNumSymbolicFact() <<
" (s)"
702 out << p <<
"Number of numeric factorizations = "
705 out << p <<
"Time for num fact = "
706 << numTime <<
" (s), avg = "
707 << numTime /
status_.getNumNumericFact() <<
" (s)"
710 out << p <<
"Number of solve phases = "
713 out << p <<
"Time for solve = "
714 << solTime <<
" (s), avg = "
715 << solTime /
status_.getNumSolve() <<
" (s)"
718 out << p <<
"Total time spent in Amesos2 = "
721 out << p <<
"Total time spent in the Amesos2 interface = "
722 << overhead <<
" (s)"
724 out << p <<
" (the above time does not include solver time)"
726 out << p <<
"Amesos2 interface time / total time = "
727 << overhead / totTime
729 Util::printLine(out);
734template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
737 Teuchos::ParameterList& timingParameterList)
const
739 Teuchos::ParameterList temp;
740 timingParameterList = temp.setName(
"NULL");
744template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
748 std::string solverName = solver_type::name;
752template <
template <
class,
class>
class ConcreteSolver,
class Matrix,
class Vector >
756 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:545
super_type & setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶meterList) override
Set/update internal variables and solver options.
Definition Amesos2_SolverCore_def.hpp:513
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:151
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:593
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:583
SolverCore(Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
Initialize a Solver instance.
Definition Amesos2_SolverCore_def.hpp:40
void getTiming(Teuchos::ParameterList &timingParameterList) const override
Extracts timing information from the current solver.
Definition Amesos2_SolverCore_def.hpp:736
void printTiming(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
Prints timing information about the current solver.
Definition Amesos2_SolverCore_def.hpp:654
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:73
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:754
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:746
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:65
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:93
super_type & numericFactorization() override
Performs numeric factorization on the matrix A.
Definition Amesos2_SolverCore_def.hpp:122
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:470
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:456
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:604