10#ifndef IFPACK2_MDF_DEF_HPP
11#define IFPACK2_MDF_DEF_HPP
13#include "Ifpack2_LocalFilter.hpp"
15#include "Tpetra_CrsMatrix.hpp"
16#include "Teuchos_StandardParameterEntryValidators.hpp"
17#include "Ifpack2_LocalSparseTriangularSolver.hpp"
18#include "Ifpack2_Details_getParamTryingTypes.hpp"
20#include "Kokkos_Core.hpp"
21#include "Kokkos_Sort.hpp"
22#include "KokkosSparse_mdf.hpp"
23#include "KokkosKernels_Sorting.hpp"
33template <
class dev_view_t>
34auto copy_view(
const dev_view_t& vals) {
35 using Kokkos::view_alloc;
36 using Kokkos::WithoutInitializing;
37 typename dev_view_t::non_const_type newvals(view_alloc(vals.label(), WithoutInitializing), vals.extent(0));
38 Kokkos::deep_copy(newvals, vals);
42template <
class array_t,
class dev_view_t>
43void copy_dev_view_to_host_array(array_t& array,
const dev_view_t& dev_view) {
44 using host_view_t =
typename dev_view_t::host_mirror_type;
47 const auto ext = dev_view.extent(0);
49 TEUCHOS_TEST_FOR_EXCEPTION(
50 ext !=
size_t(array.size()), std::logic_error,
51 "Ifpack2::MDF::copy_dev_view_to_host_array: "
52 "Size of permuations on host and device do not match. "
53 "Please report this bug to the Ifpack2 developers.");
56 Kokkos::deep_copy(host_view_t(array.get(), ext), dev_view);
59template <
class scalar_type,
class local_ordinal_type,
class global_ordinal_type,
class node_type>
60void applyReorderingPermutations(
61 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
62 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
63 const Teuchos::ArrayRCP<local_ordinal_type>& perm) {
64 TEUCHOS_TEST_FOR_EXCEPTION(X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
65 "Ifpack2::MDF::applyReorderingPermuations ERROR: X.getNumVectors() != Y.getNumVectors().");
67 Teuchos::ArrayRCP<Teuchos::ArrayRCP<const scalar_type>> x_ptr = X.get2dView();
68 Teuchos::ArrayRCP<Teuchos::ArrayRCP<scalar_type>> y_ptr = Y.get2dViewNonConst();
70 for (
size_t k = 0; k < X.getNumVectors(); k++)
71 for (local_ordinal_type i = 0; (size_t)i < X.getLocalLength(); i++)
72 y_ptr[k][perm[i]] = x_ptr[k][i];
75template <
class scalar_type,
class local_ordinal_type,
class global_ordinal_type,
class node_type>
76auto get_local_crs_row_matrix(
77 Teuchos::RCP<
const Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>> A_local) {
81 using Teuchos::rcp_const_cast;
82 using Teuchos::rcp_dynamic_cast;
84 using crs_matrix_type = Tpetra::CrsMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>;
86 using nonconst_local_inds_host_view_type =
typename crs_matrix_type::nonconst_local_inds_host_view_type;
87 using nonconst_values_host_view_type =
typename crs_matrix_type::nonconst_values_host_view_type;
89 RCP<const crs_matrix_type> A_local_crs = rcp_dynamic_cast<const crs_matrix_type>(A_local);
90 if (A_local_crs.is_null()) {
91 local_ordinal_type numRows = A_local->getLocalNumRows();
92 Array<size_t> entriesPerRow(numRows);
93 for (local_ordinal_type i = 0; i < numRows; i++) {
94 entriesPerRow[i] = A_local->getNumEntriesInLocalRow(i);
96 RCP<crs_matrix_type> A_local_crs_nc =
97 rcp(
new crs_matrix_type(A_local->getRowMap(),
101 nonconst_local_inds_host_view_type indices(
"indices", A_local->getLocalMaxNumRowEntries());
102 nonconst_values_host_view_type values(
"values", A_local->getLocalMaxNumRowEntries());
103 for (local_ordinal_type i = 0; i < numRows; i++) {
104 size_t numEntries = 0;
105 A_local->getLocalRowCopy(i, indices, values, numEntries);
106 A_local_crs_nc->insertLocalValues(i, numEntries,
reinterpret_cast<scalar_type*
>(values.data()), indices.data());
108 A_local_crs_nc->fillComplete(A_local->getDomainMap(), A_local->getRangeMap());
109 A_local_crs = rcp_const_cast<const crs_matrix_type>(A_local_crs_nc);
119template <
class MatrixType>
125 , isAllocated_(false)
126 , isInitialized_(false)
131 , initializeTime_(0.0)
135 allocatePermutations();
138template <
class MatrixType>
144 , isAllocated_(false)
145 , isInitialized_(false)
150 , initializeTime_(0.0)
154 allocatePermutations();
157template <
class MatrixType>
159 if (A_.is_null())
return;
162 if (force || permutations_.is_null() || A_->getLocalNumRows() !=
size_t(permutations_.size())) {
163 permutations_ = Teuchos::null;
164 reversePermutations_ = Teuchos::null;
165 permutations_ = permutations_type(A_->getLocalNumRows());
166 reversePermutations_ = permutations_type(A_->getLocalNumRows());
170template <
class MatrixType>
171void MDF<MatrixType>::allocateSolvers() {
172 L_solver_ = Teuchos::null;
173 U_solver_ = Teuchos::null;
174 L_solver_ = Teuchos::rcp(
new LocalSparseTriangularSolver<row_matrix_type>());
175 L_solver_->setObjectLabel(
"lower");
176 U_solver_ = Teuchos::rcp(
new LocalSparseTriangularSolver<row_matrix_type>());
177 U_solver_->setObjectLabel(
"upper");
180template <
class MatrixType>
186 if (A.getRawPtr() != A_.getRawPtr()) {
187 isAllocated_ =
false;
188 isInitialized_ =
false;
190 A_local_ = Teuchos::null;
191 MDF_handle_ = Teuchos::null;
198 if (!L_solver_.is_null()) {
199 L_solver_->setMatrix(Teuchos::null);
201 if (!U_solver_.is_null()) {
202 U_solver_->setMatrix(Teuchos::null);
209 allocatePermutations(
true);
213template <
class MatrixType>
216 TEUCHOS_TEST_FOR_EXCEPTION(
217 L_.is_null(), std::runtime_error,
218 "Ifpack2::MDF::getL: The L factor "
219 "is null. Please call initialize() and compute() "
220 "before calling this method. If the input matrix has not yet been set, "
221 "you must first call setMatrix() with a nonnull input matrix before you "
222 "may call initialize() or compute().");
226template <
class MatrixType>
227typename MDF<MatrixType>::permutations_type&
229 TEUCHOS_TEST_FOR_EXCEPTION(
230 permutations_.is_null(), std::runtime_error,
231 "Ifpack2::MDF::getPermutations: "
232 "The permulations are null. Please call initialize() and compute() "
233 "before calling this method. If the input matrix has not yet been set, "
234 "you must first call setMatrix() with a nonnull input matrix before you "
235 "may call initialize() or compute().");
236 return const_cast<permutations_type&
>(permutations_);
238template <
class MatrixType>
239typename MDF<MatrixType>::permutations_type&
241 TEUCHOS_TEST_FOR_EXCEPTION(
242 reversePermutations_.is_null(), std::runtime_error,
243 "Ifpack2::MDF::getReversePermutations: "
244 "The permulations are null. Please call initialize() and compute() "
245 "before calling this method. If the input matrix has not yet been set, "
246 "you must first call setMatrix() with a nonnull input matrix before you "
247 "may call initialize() or compute().");
248 return const_cast<permutations_type&
>(reversePermutations_);
251template <
class MatrixType>
254 TEUCHOS_TEST_FOR_EXCEPTION(
255 U_.is_null(), std::runtime_error,
256 "Ifpack2::MDF::getU: The U factor "
257 "is null. Please call initialize() and compute() "
258 "before calling this method. If the input matrix has not yet been set, "
259 "you must first call setMatrix() with a nonnull input matrix before you "
260 "may call initialize() or compute().");
264template <
class MatrixType>
266 TEUCHOS_TEST_FOR_EXCEPTION(
267 A_.is_null(), std::runtime_error,
268 "Ifpack2::MDF::getNodeSmootherComplexity: "
269 "The input matrix A is null. Please call setMatrix() with a nonnull "
270 "input matrix, then call compute(), before calling this method.");
272 if (!L_.is_null() && !U_.is_null())
273 return A_->getLocalNumEntries() + L_->getLocalNumEntries() + U_->getLocalNumEntries();
278template <
class MatrixType>
279Teuchos::RCP<const Tpetra::Map<typename MDF<MatrixType>::local_ordinal_type,
283 TEUCHOS_TEST_FOR_EXCEPTION(
284 A_.is_null(), std::runtime_error,
285 "Ifpack2::MDF::getDomainMap: "
286 "The matrix is null. Please call setMatrix() with a nonnull input "
287 "before calling this method.");
290 TEUCHOS_TEST_FOR_EXCEPTION(
291 L_.is_null(), std::runtime_error,
292 "Ifpack2::MDF::getDomainMap: "
293 "The computed graph is null. Please call initialize() and compute() before calling "
295 return L_->getDomainMap();
298template <
class MatrixType>
299Teuchos::RCP<const Tpetra::Map<typename MDF<MatrixType>::local_ordinal_type,
303 TEUCHOS_TEST_FOR_EXCEPTION(
304 A_.is_null(), std::runtime_error,
305 "Ifpack2::MDF::getRangeMap: "
306 "The matrix is null. Please call setMatrix() with a nonnull input "
307 "before calling this method.");
310 TEUCHOS_TEST_FOR_EXCEPTION(
311 L_.is_null(), std::runtime_error,
312 "Ifpack2::MDF::getRangeMap: "
313 "The computed graph is null. Please call initialize() abd compute() before calling "
315 return L_->getRangeMap();
318template <
class MatrixType>
321 using Details::getParamTryingTypes;
322 using Teuchos::Array;
323 using Teuchos::ParameterList;
325 const char prefix[] =
"Ifpack2::MDF: ";
329 double overalloc = 2.;
341 const std::string paramName(
"fact: mdf level-of-fill");
342 getParamTryingTypes<int, int, global_ordinal_type, double, float>(fillLevel, params, paramName, prefix);
344 TEUCHOS_TEST_FOR_EXCEPTION(fillLevel != 0, std::runtime_error, prefix <<
"MDF with level of fill != 0 is not yet implemented.");
347 const std::string paramName(
"Verbosity");
348 getParamTryingTypes<int, int, global_ordinal_type, double, float>(verbosity, params, paramName, prefix);
351 const std::string paramName(
"fact: mdf overalloc");
352 getParamTryingTypes<double, double>(overalloc, params, paramName, prefix);
356 L_solver_->setParameters(params);
357 U_solver_->setParameters(params);
363 LevelOfFill_ = fillLevel;
364 Overalloc_ = overalloc;
365 Verbosity_ = verbosity;
368template <
class MatrixType>
369Teuchos::RCP<const typename MDF<MatrixType>::row_matrix_type>
371 return Teuchos::rcp_implicit_cast<const row_matrix_type>(A_);
374template <
class MatrixType>
375Teuchos::RCP<const typename MDF<MatrixType>::crs_matrix_type>
377 return Teuchos::rcp_dynamic_cast<const crs_matrix_type>(A_,
true);
380template <
class MatrixType>
381Teuchos::RCP<const typename MDF<MatrixType>::row_matrix_type>
385 using Teuchos::rcp_dynamic_cast;
386 using Teuchos::rcp_implicit_cast;
391 if (A->getRowMap()->getComm()->getSize() == 1 ||
392 A->getRowMap()->isSameAs(*(A->getColMap()))) {
399 RCP<const LocalFilter<row_matrix_type>> A_lf_r =
400 rcp_dynamic_cast<const LocalFilter<row_matrix_type>>(A);
401 if (!A_lf_r.is_null()) {
402 return rcp_implicit_cast<const row_matrix_type>(A_lf_r);
407 return rcp(
new LocalFilter<row_matrix_type>(A));
411template <
class MatrixType>
413 using Teuchos::Array;
414 using Teuchos::ArrayView;
417 using Teuchos::rcp_const_cast;
418 using Teuchos::rcp_dynamic_cast;
419 using Teuchos::rcp_implicit_cast;
420 const char prefix[] =
"Ifpack2::MDF::initialize: ";
422 TEUCHOS_TEST_FOR_EXCEPTION(A_.is_null(), std::runtime_error, prefix <<
"The matrix is null. Please "
423 "call setMatrix() with a nonnull input before calling this method.");
424 TEUCHOS_TEST_FOR_EXCEPTION(!A_->isFillComplete(), std::runtime_error, prefix <<
"The matrix is not "
425 "fill complete. You may not invoke initialize() or compute() with this "
426 "matrix until the matrix is fill complete. If your matrix is a "
427 "Tpetra::CrsMatrix, please call fillComplete on it (with the domain and "
428 "range Maps, if appropriate) before calling this method.");
430 Teuchos::Time timer(
"MDF::initialize");
431 double startTime = timer.wallTime();
433 Teuchos::TimeMonitor timeMon(timer);
442 isInitialized_ =
false;
443 isAllocated_ =
false;
445 MDF_handle_ = Teuchos::null;
447 A_local_ = makeLocalFilter(A_);
448 TEUCHOS_TEST_FOR_EXCEPTION(
449 A_local_.is_null(), std::logic_error,
450 "Ifpack2::MDF::initialize: "
451 "makeLocalFilter returned null; it failed to compute A_local. "
452 "Please report this bug to the Ifpack2 developers.");
460 RCP<const crs_matrix_type> A_local_crs = Details::MDFImpl::get_local_crs_row_matrix(A_local_);
462 auto A_local_device = A_local_crs->getLocalMatrixDevice();
463 MDF_handle_ = rcp(
new MDF_handle_device_type(A_local_device));
464 MDF_handle_->set_verbosity(Verbosity_);
466 KokkosSparse::Experimental::mdf_symbolic(A_local_device, *MDF_handle_);
471 checkOrderingConsistency(*A_local_);
474 isInitialized_ =
true;
476 initializeTime_ += (timer.wallTime() - startTime);
479template <
class MatrixType>
485 Teuchos::ArrayView<const global_ordinal_type> rowGIDs = A.getRowMap()->getLocalElementList();
486 Teuchos::ArrayView<const global_ordinal_type> colGIDs = A.getColMap()->getLocalElementList();
487 bool gidsAreConsistentlyOrdered =
true;
488 global_ordinal_type indexOfInconsistentGID = 0;
489 for (global_ordinal_type i = 0; i < rowGIDs.size(); ++i) {
490 if (rowGIDs[i] != colGIDs[i]) {
491 gidsAreConsistentlyOrdered =
false;
492 indexOfInconsistentGID = i;
496 TEUCHOS_TEST_FOR_EXCEPTION(gidsAreConsistentlyOrdered ==
false, std::runtime_error,
497 "The ordering of the local GIDs in the row and column maps is not the same"
499 <<
"at index " << indexOfInconsistentGID
500 <<
". Consistency is required, as all calculations are done with"
502 <<
"local indexing.");
505template <
class MatrixType>
507 using Teuchos::Array;
508 using Teuchos::ArrayView;
511 using Teuchos::rcp_const_cast;
512 using Teuchos::rcp_dynamic_cast;
513 const char prefix[] =
"Ifpack2::MDF::compute: ";
518 TEUCHOS_TEST_FOR_EXCEPTION(A_.is_null(), std::runtime_error, prefix <<
"The matrix is null. Please "
519 "call setMatrix() with a nonnull input before calling this method.");
520 TEUCHOS_TEST_FOR_EXCEPTION(!A_->isFillComplete(), std::runtime_error, prefix <<
"The matrix is not "
521 "fill complete. You may not invoke initialize() or compute() with this "
522 "matrix until the matrix is fill complete. If your matrix is a "
523 "Tpetra::CrsMatrix, please call fillComplete on it (with the domain and "
524 "range Maps, if appropriate) before calling this method.");
526 if (!isInitialized()) {
530 Teuchos::Time timer(
"MDF::compute");
533 Teuchos::TimeMonitor timeMon(timer);
534 double startTime = timer.wallTime();
539 RCP<const crs_matrix_type> A_local_crs = Details::MDFImpl::get_local_crs_row_matrix(A_local_);
542 auto A_local_device = A_local_crs->getLocalMatrixDevice();
544 KokkosSparse::Experimental::mdf_numeric(A_local_device, *MDF_handle_);
548 Details::MDFImpl::copy_dev_view_to_host_array(reversePermutations_, MDF_handle_->permutation);
549 Details::MDFImpl::copy_dev_view_to_host_array(permutations_, MDF_handle_->permutation_inv);
554 auto L_mdf = MDF_handle_->getL();
556 A_local_->getRowMap(),
557 A_local_->getColMap(),
558 Details::MDFImpl::copy_view(L_mdf.graph.row_map),
559 Details::MDFImpl::copy_view(L_mdf.graph.entries),
560 Details::MDFImpl::copy_view(L_mdf.values)));
563 auto U_mdf = MDF_handle_->getU();
565 A_local_->getRowMap(),
566 A_local_->getColMap(),
567 Details::MDFImpl::copy_view(U_mdf.graph.row_map),
568 Details::MDFImpl::copy_view(U_mdf.graph.entries),
569 Details::MDFImpl::copy_view(U_mdf.values)));
573 L_solver_->setMatrix(L_);
574 L_solver_->initialize();
575 L_solver_->compute();
576 U_solver_->setMatrix(U_);
577 U_solver_->initialize();
578 U_solver_->compute();
582 computeTime_ += (timer.wallTime() - startTime);
585template <
class MatrixType>
587 apply_impl(
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
588 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
589 Teuchos::ETransp mode,
591 scalar_type beta)
const {
592 const scalar_type one = STS::one();
593 const scalar_type zero = STS::zero();
595 if (alpha == one && beta == zero) {
596 MV tmp(Y.getMap(), Y.getNumVectors());
597 Details::MDFImpl::applyReorderingPermutations(X, tmp, permutations_);
598 if (mode == Teuchos::NO_TRANS) {
600 L_solver_->apply(tmp, Y, mode);
601 U_solver_->apply(Y, tmp, mode);
604 U_solver_->apply(tmp, Y, mode);
605 L_solver_->apply(Y, tmp, mode);
607 Details::MDFImpl::applyReorderingPermutations(tmp, Y, reversePermutations_);
619 MV Y_tmp(Y.getMap(), Y.getNumVectors());
620 apply_impl(X, Y_tmp, mode);
621 Y.update(alpha, Y_tmp, beta);
626template <
class MatrixType>
628 apply(
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
629 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
630 Teuchos::ETransp mode,
634 using Teuchos::rcpFromRef;
636 TEUCHOS_TEST_FOR_EXCEPTION(
637 A_.is_null(), std::runtime_error,
638 "Ifpack2::MDF::apply: The matrix is "
639 "null. Please call setMatrix() with a nonnull input, then initialize() "
640 "and compute(), before calling this method.");
641 TEUCHOS_TEST_FOR_EXCEPTION(
642 !isComputed(), std::runtime_error,
643 "Ifpack2::MDF::apply: If you have not yet called compute(), "
644 "you must call compute() before calling this method.");
645 TEUCHOS_TEST_FOR_EXCEPTION(
646 X.getNumVectors() != Y.getNumVectors(), std::invalid_argument,
647 "Ifpack2::MDF::apply: X and Y do not have the same number of columns. "
648 "X.getNumVectors() = "
650 <<
" != Y.getNumVectors() = " << Y.getNumVectors() <<
".");
651 TEUCHOS_TEST_FOR_EXCEPTION(
652 STS::isComplex && mode == Teuchos::CONJ_TRANS, std::logic_error,
653 "Ifpack2::MDF::apply: mode = Teuchos::CONJ_TRANS is not implemented for "
654 "complex Scalar type. Please talk to the Ifpack2 developers to get this "
655 "fixed. There is a FIXME in this file about this very issue.");
657 Teuchos::Array<magnitude_type> norms(X.getNumVectors());
660 for (
size_t j = 0; j < X.getNumVectors(); ++j) {
661 if (STM::isnaninf(norms[j])) {
666 TEUCHOS_TEST_FOR_EXCEPTION(!good, std::runtime_error,
"Ifpack2::MDF::apply: The 1-norm of the input X is NaN or Inf.");
669 Teuchos::Time timer(
"MDF::apply");
670 double startTime = timer.wallTime();
672 Teuchos::TimeMonitor timeMon(timer);
673 apply_impl(X, Y, mode, alpha, beta);
677 Teuchos::Array<magnitude_type> norms(Y.getNumVectors());
680 for (
size_t j = 0; j < Y.getNumVectors(); ++j) {
681 if (STM::isnaninf(norms[j])) {
686 TEUCHOS_TEST_FOR_EXCEPTION(!good, std::runtime_error,
"Ifpack2::MDF::apply: The 1-norm of the output Y is NaN or Inf.");
690 applyTime_ += (timer.wallTime() - startTime);
693template <
class MatrixType>
695 std::ostringstream os;
700 os <<
"\"Ifpack2::MDF\": {";
701 os <<
"Initialized: " << (isInitialized() ?
"true" :
"false") <<
", "
702 <<
"Computed: " << (isComputed() ?
"true" :
"false") <<
", ";
704 os <<
"Level-of-fill: " << getLevelOfFill() <<
", ";
707 os <<
"Matrix: null";
709 os <<
"Global matrix dimensions: ["
710 << A_->getGlobalNumRows() <<
", " << A_->getGlobalNumCols() <<
"]"
711 <<
", Global nnz: " << A_->getGlobalNumEntries();
714 if (!L_solver_.is_null()) os <<
", " << L_solver_->description();
715 if (!U_solver_.is_null()) os <<
", " << U_solver_->description();
723#define IFPACK2_MDF_INSTANT(S, LO, GO, N) \
724 template class Ifpack2::MDF<Tpetra::RowMatrix<S, LO, GO, N>>;
Declaration of Ifpack2::Details::Behavior, a class that describes Ifpack2's run-time behavior.
Ifpack2::ScalingType enumerable type.
static bool debug()
Whether Ifpack2 is in debug mode.
Definition Ifpack2_Details_Behavior.cpp:31
MDF (incomplete LU factorization with minimum discarded fill reordering) of a Tpetra sparse matrix.
Definition Ifpack2_MDF_decl.hpp:57
void setParameters(const Teuchos::ParameterList ¶ms)
Definition Ifpack2_MDF_def.hpp:320
const crs_matrix_type & getL() const
Return the L factor of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:215
void apply(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
Apply the (inverse of the) incomplete factorization to X, resulting in Y.
Definition Ifpack2_MDF_def.hpp:628
permutations_type & getReversePermutations() const
Return the reverse permutations of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:240
const crs_matrix_type & getU() const
Return the U factor of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:253
void compute()
Compute the (numeric) incomplete factorization.
Definition Ifpack2_MDF_def.hpp:506
void initialize()
Initialize by computing the symbolic incomplete factorization.
Definition Ifpack2_MDF_def.hpp:412
std::string description() const
A one-line description of this object.
Definition Ifpack2_MDF_def.hpp:694
Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getRangeMap() const
Returns the Tpetra::Map object associated with the range of this operator.
Definition Ifpack2_MDF_def.hpp:302
Tpetra::CrsMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > crs_matrix_type
Tpetra::CrsMatrix specialization used by this class for representing L and U.
Definition Ifpack2_MDF_decl.hpp:94
Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getDomainMap() const
Returns the Tpetra::Map object associated with the domain of this operator.
Definition Ifpack2_MDF_def.hpp:282
Teuchos::RCP< const crs_matrix_type > getCrsMatrix() const
Return the input matrix A as a Tpetra::CrsMatrix, if possible; else throws.
Definition Ifpack2_MDF_def.hpp:376
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition Ifpack2_MDF_decl.hpp:69
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition Ifpack2_MDF_decl.hpp:66
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition Ifpack2_MDF_decl.hpp:60
Teuchos::RCP< const row_matrix_type > getMatrix() const
Get the input matrix.
Definition Ifpack2_MDF_def.hpp:370
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition Ifpack2_MDF_def.hpp:181
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Definition Ifpack2_MDF_def.hpp:265
permutations_type & getPermutations() const
Return the permutations of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:228
Ifpack2 implementation details.
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:40