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"
19#include "Kokkos_Core.hpp"
20#include "Kokkos_Sort.hpp"
21#include "KokkosSparse_mdf.hpp"
22#include "KokkosKernels_Sorting.hpp"
32template <
class dev_view_t>
33auto copy_view(
const dev_view_t& vals) {
34 using Kokkos::view_alloc;
35 using Kokkos::WithoutInitializing;
36 typename dev_view_t::non_const_type newvals(view_alloc(vals.label(), WithoutInitializing), vals.extent(0));
37 Kokkos::deep_copy(newvals, vals);
41template <
class array_t,
class dev_view_t>
42void copy_dev_view_to_host_array(array_t& array,
const dev_view_t& dev_view) {
43 using host_view_t =
typename dev_view_t::host_mirror_type;
46 const auto ext = dev_view.extent(0);
48 TEUCHOS_TEST_FOR_EXCEPTION(
49 ext !=
size_t(array.size()), std::logic_error,
50 "Ifpack2::MDF::copy_dev_view_to_host_array: "
51 "Size of permuations on host and device do not match. "
52 "Please report this bug to the Ifpack2 developers.");
55 Kokkos::deep_copy(host_view_t(array.get(), ext), dev_view);
58template <
class scalar_type,
class local_ordinal_type,
class global_ordinal_type,
class node_type>
59void applyReorderingPermutations(
60 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
61 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
62 const Teuchos::ArrayRCP<local_ordinal_type>& perm) {
63 TEUCHOS_TEST_FOR_EXCEPTION(X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
64 "Ifpack2::MDF::applyReorderingPermuations ERROR: X.getNumVectors() != Y.getNumVectors().");
66 Teuchos::ArrayRCP<Teuchos::ArrayRCP<const scalar_type>> x_ptr = X.get2dView();
67 Teuchos::ArrayRCP<Teuchos::ArrayRCP<scalar_type>> y_ptr = Y.get2dViewNonConst();
69 for (
size_t k = 0; k < X.getNumVectors(); k++)
70 for (local_ordinal_type i = 0; (size_t)i < X.getLocalLength(); i++)
71 y_ptr[k][perm[i]] = x_ptr[k][i];
74template <
class scalar_type,
class local_ordinal_type,
class global_ordinal_type,
class node_type>
75auto get_local_crs_row_matrix(
76 Teuchos::RCP<
const Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>> A_local) {
80 using Teuchos::rcp_const_cast;
81 using Teuchos::rcp_dynamic_cast;
83 using crs_matrix_type = Tpetra::CrsMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>;
85 using nonconst_local_inds_host_view_type =
typename crs_matrix_type::nonconst_local_inds_host_view_type;
86 using nonconst_values_host_view_type =
typename crs_matrix_type::nonconst_values_host_view_type;
88 RCP<const crs_matrix_type> A_local_crs = rcp_dynamic_cast<const crs_matrix_type>(A_local);
89 if (A_local_crs.is_null()) {
90 local_ordinal_type numRows = A_local->getLocalNumRows();
91 Array<size_t> entriesPerRow(numRows);
92 for (local_ordinal_type i = 0; i < numRows; i++) {
93 entriesPerRow[i] = A_local->getNumEntriesInLocalRow(i);
95 RCP<crs_matrix_type> A_local_crs_nc =
96 rcp(
new crs_matrix_type(A_local->getRowMap(),
100 nonconst_local_inds_host_view_type indices(
"indices", A_local->getLocalMaxNumRowEntries());
101 nonconst_values_host_view_type values(
"values", A_local->getLocalMaxNumRowEntries());
102 for (local_ordinal_type i = 0; i < numRows; i++) {
103 size_t numEntries = 0;
104 A_local->getLocalRowCopy(i, indices, values, numEntries);
105 A_local_crs_nc->insertLocalValues(i, numEntries,
reinterpret_cast<scalar_type*
>(values.data()), indices.data());
107 A_local_crs_nc->fillComplete(A_local->getDomainMap(), A_local->getRangeMap());
108 A_local_crs = rcp_const_cast<const crs_matrix_type>(A_local_crs_nc);
118template <
class MatrixType>
124 , isAllocated_(false)
125 , isInitialized_(false)
130 , initializeTime_(0.0)
134 allocatePermutations();
137template <
class MatrixType>
143 , isAllocated_(false)
144 , isInitialized_(false)
149 , initializeTime_(0.0)
153 allocatePermutations();
156template <
class MatrixType>
158 if (A_.is_null())
return;
161 if (force || permutations_.is_null() || A_->getLocalNumRows() !=
size_t(permutations_.size())) {
162 permutations_ = Teuchos::null;
163 reversePermutations_ = Teuchos::null;
164 permutations_ = permutations_type(A_->getLocalNumRows());
165 reversePermutations_ = permutations_type(A_->getLocalNumRows());
169template <
class MatrixType>
170void MDF<MatrixType>::allocateSolvers() {
171 L_solver_ = Teuchos::null;
172 U_solver_ = Teuchos::null;
173 L_solver_ = Teuchos::rcp(
new LocalSparseTriangularSolver<row_matrix_type>());
174 L_solver_->setObjectLabel(
"lower");
175 U_solver_ = Teuchos::rcp(
new LocalSparseTriangularSolver<row_matrix_type>());
176 U_solver_->setObjectLabel(
"upper");
179template <
class MatrixType>
185 if (A.getRawPtr() != A_.getRawPtr()) {
186 isAllocated_ =
false;
187 isInitialized_ =
false;
189 A_local_ = Teuchos::null;
190 MDF_handle_ = Teuchos::null;
197 if (!L_solver_.is_null()) {
198 L_solver_->setMatrix(Teuchos::null);
200 if (!U_solver_.is_null()) {
201 U_solver_->setMatrix(Teuchos::null);
208 allocatePermutations(
true);
212template <
class MatrixType>
215 TEUCHOS_TEST_FOR_EXCEPTION(
216 L_.is_null(), std::runtime_error,
217 "Ifpack2::MDF::getL: The L factor "
218 "is null. Please call initialize() and compute() "
219 "before calling this method. If the input matrix has not yet been set, "
220 "you must first call setMatrix() with a nonnull input matrix before you "
221 "may call initialize() or compute().");
225template <
class MatrixType>
226typename MDF<MatrixType>::permutations_type&
228 TEUCHOS_TEST_FOR_EXCEPTION(
229 permutations_.is_null(), std::runtime_error,
230 "Ifpack2::MDF::getPermutations: "
231 "The permulations are null. Please call initialize() and compute() "
232 "before calling this method. If the input matrix has not yet been set, "
233 "you must first call setMatrix() with a nonnull input matrix before you "
234 "may call initialize() or compute().");
235 return const_cast<permutations_type&
>(permutations_);
237template <
class MatrixType>
238typename MDF<MatrixType>::permutations_type&
240 TEUCHOS_TEST_FOR_EXCEPTION(
241 reversePermutations_.is_null(), std::runtime_error,
242 "Ifpack2::MDF::getReversePermutations: "
243 "The permulations are null. Please call initialize() and compute() "
244 "before calling this method. If the input matrix has not yet been set, "
245 "you must first call setMatrix() with a nonnull input matrix before you "
246 "may call initialize() or compute().");
247 return const_cast<permutations_type&
>(reversePermutations_);
250template <
class MatrixType>
253 TEUCHOS_TEST_FOR_EXCEPTION(
254 U_.is_null(), std::runtime_error,
255 "Ifpack2::MDF::getU: The U factor "
256 "is null. Please call initialize() and compute() "
257 "before calling this method. If the input matrix has not yet been set, "
258 "you must first call setMatrix() with a nonnull input matrix before you "
259 "may call initialize() or compute().");
263template <
class MatrixType>
265 TEUCHOS_TEST_FOR_EXCEPTION(
266 A_.is_null(), std::runtime_error,
267 "Ifpack2::MDF::getNodeSmootherComplexity: "
268 "The input matrix A is null. Please call setMatrix() with a nonnull "
269 "input matrix, then call compute(), before calling this method.");
271 if (!L_.is_null() && !U_.is_null())
272 return A_->getLocalNumEntries() + L_->getLocalNumEntries() + U_->getLocalNumEntries();
277template <
class MatrixType>
278Teuchos::RCP<const Tpetra::Map<typename MDF<MatrixType>::local_ordinal_type,
282 TEUCHOS_TEST_FOR_EXCEPTION(
283 A_.is_null(), std::runtime_error,
284 "Ifpack2::MDF::getDomainMap: "
285 "The matrix is null. Please call setMatrix() with a nonnull input "
286 "before calling this method.");
289 TEUCHOS_TEST_FOR_EXCEPTION(
290 L_.is_null(), std::runtime_error,
291 "Ifpack2::MDF::getDomainMap: "
292 "The computed graph is null. Please call initialize() and compute() before calling "
294 return L_->getDomainMap();
297template <
class MatrixType>
298Teuchos::RCP<const Tpetra::Map<typename MDF<MatrixType>::local_ordinal_type,
302 TEUCHOS_TEST_FOR_EXCEPTION(
303 A_.is_null(), std::runtime_error,
304 "Ifpack2::MDF::getRangeMap: "
305 "The matrix is null. Please call setMatrix() with a nonnull input "
306 "before calling this method.");
309 TEUCHOS_TEST_FOR_EXCEPTION(
310 L_.is_null(), std::runtime_error,
311 "Ifpack2::MDF::getRangeMap: "
312 "The computed graph is null. Please call initialize() abd compute() before calling "
314 return L_->getRangeMap();
317template <
class MatrixType>
320 using Details::getParamTryingTypes;
321 using Teuchos::Array;
322 using Teuchos::ParameterList;
324 const char prefix[] =
"Ifpack2::MDF: ";
328 double overalloc = 2.;
340 const std::string paramName(
"fact: mdf level-of-fill");
341 getParamTryingTypes<int, int, global_ordinal_type, double, float>(fillLevel, params, paramName, prefix);
343 TEUCHOS_TEST_FOR_EXCEPTION(fillLevel != 0, std::runtime_error, prefix <<
"MDF with level of fill != 0 is not yet implemented.");
346 const std::string paramName(
"Verbosity");
347 getParamTryingTypes<int, int, global_ordinal_type, double, float>(verbosity, params, paramName, prefix);
350 const std::string paramName(
"fact: mdf overalloc");
351 getParamTryingTypes<double, double>(overalloc, params, paramName, prefix);
355 L_solver_->setParameters(params);
356 U_solver_->setParameters(params);
362 LevelOfFill_ = fillLevel;
363 Overalloc_ = overalloc;
364 Verbosity_ = verbosity;
367template <
class MatrixType>
368Teuchos::RCP<const typename MDF<MatrixType>::row_matrix_type>
370 return Teuchos::rcp_implicit_cast<const row_matrix_type>(A_);
373template <
class MatrixType>
374Teuchos::RCP<const typename MDF<MatrixType>::crs_matrix_type>
376 return Teuchos::rcp_dynamic_cast<const crs_matrix_type>(A_,
true);
379template <
class MatrixType>
380Teuchos::RCP<const typename MDF<MatrixType>::row_matrix_type>
384 using Teuchos::rcp_dynamic_cast;
385 using Teuchos::rcp_implicit_cast;
390 if (A->getRowMap()->getComm()->getSize() == 1 ||
391 A->getRowMap()->isSameAs(*(A->getColMap()))) {
398 RCP<const LocalFilter<row_matrix_type>> A_lf_r =
399 rcp_dynamic_cast<const LocalFilter<row_matrix_type>>(A);
400 if (!A_lf_r.is_null()) {
401 return rcp_implicit_cast<const row_matrix_type>(A_lf_r);
406 return rcp(
new LocalFilter<row_matrix_type>(A));
410template <
class MatrixType>
412 using Teuchos::Array;
413 using Teuchos::ArrayView;
416 using Teuchos::rcp_const_cast;
417 using Teuchos::rcp_dynamic_cast;
418 using Teuchos::rcp_implicit_cast;
419 const char prefix[] =
"Ifpack2::MDF::initialize: ";
421 TEUCHOS_TEST_FOR_EXCEPTION(A_.is_null(), std::runtime_error, prefix <<
"The matrix is null. Please "
422 "call setMatrix() with a nonnull input before calling this method.");
423 TEUCHOS_TEST_FOR_EXCEPTION(!A_->isFillComplete(), std::runtime_error, prefix <<
"The matrix is not "
424 "fill complete. You may not invoke initialize() or compute() with this "
425 "matrix until the matrix is fill complete. If your matrix is a "
426 "Tpetra::CrsMatrix, please call fillComplete on it (with the domain and "
427 "range Maps, if appropriate) before calling this method.");
429 Teuchos::Time timer(
"MDF::initialize");
430 double startTime = timer.wallTime();
432 Teuchos::TimeMonitor timeMon(timer);
441 isInitialized_ =
false;
442 isAllocated_ =
false;
444 MDF_handle_ = Teuchos::null;
446 A_local_ = makeLocalFilter(A_);
447 TEUCHOS_TEST_FOR_EXCEPTION(
448 A_local_.is_null(), std::logic_error,
449 "Ifpack2::MDF::initialize: "
450 "makeLocalFilter returned null; it failed to compute A_local. "
451 "Please report this bug to the Ifpack2 developers.");
459 RCP<const crs_matrix_type> A_local_crs = Details::MDFImpl::get_local_crs_row_matrix(A_local_);
461 auto A_local_device = A_local_crs->getLocalMatrixDevice();
462 MDF_handle_ = rcp(
new MDF_handle_device_type(A_local_device));
463 MDF_handle_->set_verbosity(Verbosity_);
465 KokkosSparse::Experimental::mdf_symbolic(A_local_device, *MDF_handle_);
470 checkOrderingConsistency(*A_local_);
473 isInitialized_ =
true;
475 initializeTime_ += (timer.wallTime() - startTime);
478template <
class MatrixType>
484 Teuchos::ArrayView<const global_ordinal_type> rowGIDs = A.getRowMap()->getLocalElementList();
485 Teuchos::ArrayView<const global_ordinal_type> colGIDs = A.getColMap()->getLocalElementList();
486 bool gidsAreConsistentlyOrdered =
true;
487 global_ordinal_type indexOfInconsistentGID = 0;
488 for (global_ordinal_type i = 0; i < rowGIDs.size(); ++i) {
489 if (rowGIDs[i] != colGIDs[i]) {
490 gidsAreConsistentlyOrdered =
false;
491 indexOfInconsistentGID = i;
495 TEUCHOS_TEST_FOR_EXCEPTION(gidsAreConsistentlyOrdered ==
false, std::runtime_error,
496 "The ordering of the local GIDs in the row and column maps is not the same"
498 <<
"at index " << indexOfInconsistentGID
499 <<
". Consistency is required, as all calculations are done with"
501 <<
"local indexing.");
504template <
class MatrixType>
506 using Teuchos::Array;
507 using Teuchos::ArrayView;
510 using Teuchos::rcp_const_cast;
511 using Teuchos::rcp_dynamic_cast;
512 const char prefix[] =
"Ifpack2::MDF::compute: ";
517 TEUCHOS_TEST_FOR_EXCEPTION(A_.is_null(), std::runtime_error, prefix <<
"The matrix is null. Please "
518 "call setMatrix() with a nonnull input before calling this method.");
519 TEUCHOS_TEST_FOR_EXCEPTION(!A_->isFillComplete(), std::runtime_error, prefix <<
"The matrix is not "
520 "fill complete. You may not invoke initialize() or compute() with this "
521 "matrix until the matrix is fill complete. If your matrix is a "
522 "Tpetra::CrsMatrix, please call fillComplete on it (with the domain and "
523 "range Maps, if appropriate) before calling this method.");
525 if (!isInitialized()) {
529 Teuchos::Time timer(
"MDF::compute");
532 Teuchos::TimeMonitor timeMon(timer);
533 double startTime = timer.wallTime();
538 RCP<const crs_matrix_type> A_local_crs = Details::MDFImpl::get_local_crs_row_matrix(A_local_);
541 auto A_local_device = A_local_crs->getLocalMatrixDevice();
543 KokkosSparse::Experimental::mdf_numeric(A_local_device, *MDF_handle_);
547 Details::MDFImpl::copy_dev_view_to_host_array(reversePermutations_, MDF_handle_->permutation);
548 Details::MDFImpl::copy_dev_view_to_host_array(permutations_, MDF_handle_->permutation_inv);
553 auto L_mdf = MDF_handle_->getL();
555 A_local_->getRowMap(),
556 A_local_->getColMap(),
557 Details::MDFImpl::copy_view(L_mdf.graph.row_map),
558 Details::MDFImpl::copy_view(L_mdf.graph.entries),
559 Details::MDFImpl::copy_view(L_mdf.values)));
562 auto U_mdf = MDF_handle_->getU();
564 A_local_->getRowMap(),
565 A_local_->getColMap(),
566 Details::MDFImpl::copy_view(U_mdf.graph.row_map),
567 Details::MDFImpl::copy_view(U_mdf.graph.entries),
568 Details::MDFImpl::copy_view(U_mdf.values)));
572 L_solver_->setMatrix(L_);
573 L_solver_->initialize();
574 L_solver_->compute();
575 U_solver_->setMatrix(U_);
576 U_solver_->initialize();
577 U_solver_->compute();
581 computeTime_ += (timer.wallTime() - startTime);
584template <
class MatrixType>
586 apply_impl(
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
587 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
588 Teuchos::ETransp mode,
590 scalar_type beta)
const {
591 const scalar_type one = STS::one();
592 const scalar_type zero = STS::zero();
594 if (alpha == one && beta == zero) {
595 MV tmp(Y.getMap(), Y.getNumVectors());
596 Details::MDFImpl::applyReorderingPermutations(X, tmp, permutations_);
597 if (mode == Teuchos::NO_TRANS) {
599 L_solver_->apply(tmp, Y, mode);
600 U_solver_->apply(Y, tmp, mode);
603 U_solver_->apply(tmp, Y, mode);
604 L_solver_->apply(Y, tmp, mode);
606 Details::MDFImpl::applyReorderingPermutations(tmp, Y, reversePermutations_);
618 MV Y_tmp(Y.getMap(), Y.getNumVectors());
619 apply_impl(X, Y_tmp, mode);
620 Y.update(alpha, Y_tmp, beta);
625template <
class MatrixType>
627 apply(
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
628 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
629 Teuchos::ETransp mode,
633 using Teuchos::rcpFromRef;
635 TEUCHOS_TEST_FOR_EXCEPTION(
636 A_.is_null(), std::runtime_error,
637 "Ifpack2::MDF::apply: The matrix is "
638 "null. Please call setMatrix() with a nonnull input, then initialize() "
639 "and compute(), before calling this method.");
640 TEUCHOS_TEST_FOR_EXCEPTION(
641 !isComputed(), std::runtime_error,
642 "Ifpack2::MDF::apply: If you have not yet called compute(), "
643 "you must call compute() before calling this method.");
644 TEUCHOS_TEST_FOR_EXCEPTION(
645 X.getNumVectors() != Y.getNumVectors(), std::invalid_argument,
646 "Ifpack2::MDF::apply: X and Y do not have the same number of columns. "
647 "X.getNumVectors() = "
649 <<
" != Y.getNumVectors() = " << Y.getNumVectors() <<
".");
650 TEUCHOS_TEST_FOR_EXCEPTION(
651 STS::isComplex && mode == Teuchos::CONJ_TRANS, std::logic_error,
652 "Ifpack2::MDF::apply: mode = Teuchos::CONJ_TRANS is not implemented for "
653 "complex Scalar type. Please talk to the Ifpack2 developers to get this "
654 "fixed. There is a FIXME in this file about this very issue.");
655#ifdef HAVE_IFPACK2_DEBUG
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.");
670 Teuchos::Time timer(
"MDF::apply");
671 double startTime = timer.wallTime();
673 Teuchos::TimeMonitor timeMon(timer);
674 apply_impl(X, Y, mode, alpha, beta);
677#ifdef HAVE_IFPACK2_DEBUG
679 Teuchos::Array<magnitude_type> norms(Y.getNumVectors());
682 for (
size_t j = 0; j < Y.getNumVectors(); ++j) {
683 if (STM::isnaninf(norms[j])) {
688 TEUCHOS_TEST_FOR_EXCEPTION(!good, std::runtime_error,
"Ifpack2::MDF::apply: The 1-norm of the output Y is NaN or Inf.");
693 applyTime_ += (timer.wallTime() - startTime);
696template <
class MatrixType>
698 std::ostringstream os;
703 os <<
"\"Ifpack2::MDF\": {";
704 os <<
"Initialized: " << (isInitialized() ?
"true" :
"false") <<
", "
705 <<
"Computed: " << (isComputed() ?
"true" :
"false") <<
", ";
707 os <<
"Level-of-fill: " << getLevelOfFill() <<
", ";
710 os <<
"Matrix: null";
712 os <<
"Global matrix dimensions: ["
713 << A_->getGlobalNumRows() <<
", " << A_->getGlobalNumCols() <<
"]"
714 <<
", Global nnz: " << A_->getGlobalNumEntries();
717 if (!L_solver_.is_null()) os <<
", " << L_solver_->description();
718 if (!U_solver_.is_null()) os <<
", " << U_solver_->description();
726#define IFPACK2_MDF_INSTANT(S, LO, GO, N) \
727 template class Ifpack2::MDF<Tpetra::RowMatrix<S, LO, GO, N>>;
Ifpack2::ScalingType enumerable type.
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:319
const crs_matrix_type & getL() const
Return the L factor of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:214
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:627
permutations_type & getReversePermutations() const
Return the reverse permutations of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:239
const crs_matrix_type & getU() const
Return the U factor of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:252
void compute()
Compute the (numeric) incomplete factorization.
Definition Ifpack2_MDF_def.hpp:505
void initialize()
Initialize by computing the symbolic incomplete factorization.
Definition Ifpack2_MDF_def.hpp:411
std::string description() const
A one-line description of this object.
Definition Ifpack2_MDF_def.hpp:697
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:301
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:281
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:375
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:369
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition Ifpack2_MDF_def.hpp:180
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Definition Ifpack2_MDF_def.hpp:264
permutations_type & getPermutations() const
Return the permutations of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:227
Ifpack2 implementation details.
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:40