18 #ifndef AMESOS2_KLU2_DECL_HPP
19 #define AMESOS2_KLU2_DECL_HPP
22 #include "Amesos2_SolverCore.hpp"
36 template <
class Matrix,
52 typedef typename VectorTraits<Vector>::scalar_t vector_scalar_type;
53 typedef typename super_type::scalar_type scalar_type;
54 typedef typename super_type::local_ordinal_type local_ordinal_type;
55 typedef typename super_type::global_ordinal_type global_ordinal_type;
56 typedef typename super_type::global_size_type global_size_type;
65 typedef typename type_map::type klu2_type;
66 typedef typename type_map::dtype klu2_dtype;
70 typedef Matrix matrix_type;
82 KLU2(Teuchos::RCP<const Matrix> A,
83 Teuchos::RCP<Vector> X,
84 Teuchos::RCP<const Vector> B);
137 int
solve_impl(const Teuchos::Ptr<MultiVecAdapter<Vector> > X,
138 const Teuchos::Ptr<const MultiVecAdapter<Vector> > B) const;
175 const Teuchos::RCP<Teuchos::ParameterList> & parameterList );
198 mutable struct KLU2Data {
199 ::KLU2::klu_symbolic<klu2_dtype, local_ordinal_type> *symbolic_;
200 ::KLU2::klu_numeric<klu2_dtype, local_ordinal_type> *numeric_;
201 ::KLU2::klu_common<klu2_dtype, local_ordinal_type> common_;
204 typedef Kokkos::DefaultHostExecutionSpace HostSpaceType;
205 typedef Kokkos::View<local_ordinal_type*, HostSpaceType> host_ordinal_type_array;
207 typedef Kokkos::View<klu2_type*, HostSpaceType> host_value_type_array;
218 typedef typename Kokkos::View<klu2_type**, Kokkos::LayoutLeft, HostSpaceType>
239 #ifdef HAVE_TEUCHOS_COMPLEX
240 typedef Meta::make_list6<float,
242 Kokkos::complex<float>,
243 Kokkos::complex<double>,
245 std::complex<double> > supported_scalars;
247 typedef Meta::make_list2<float, double> supported_scalars;
251 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
252 struct solver_supports_matrix<KLU2,
253 KokkosSparse::CrsMatrix<Scalar, LocalOrdinal, ExecutionSpace>> {
254 static const bool value =
true;
259 #endif // AMESOS2_KLU2_DECL_HPP
Amesos2::SolverCore: A templated interface for interaction with third-party direct sparse solvers...
Definition: Amesos2_SolverCore_decl.hpp:71
int solve_impl(const Teuchos::Ptr< MultiVecAdapter< Vector > > X, const Teuchos::Ptr< const MultiVecAdapter< Vector > > B) const
KLU2 specific solve.
Definition: Amesos2_KLU2_def.hpp:196
bool loadA_impl(EPhase current_phase)
Reads matrix data into internal structures.
Definition: Amesos2_KLU2_def.hpp:456
Map types to solver-specific data-types and enums.
Definition: Amesos2_TypeMap.hpp:48
host_solve_array_t bValues_
Persisting 1D store for B.
Definition: Amesos2_KLU2_decl.hpp:225
host_solve_array_t xValues_
Persisting 1D store for X.
Definition: Amesos2_KLU2_decl.hpp:222
host_ordinal_type_array host_rows_view_
Stores the location in Ai_ and Aval_ that starts row j.
Definition: Amesos2_KLU2_decl.hpp:214
Provides a mechanism to map function calls to the correct Solver function based on the scalar type of...
Provides traits about solvers.
Definition: Amesos2_SolverTraits.hpp:37
host_ordinal_type_array host_col_ptr_view_
Stores the row indices of the nonzero entries.
Definition: Amesos2_KLU2_decl.hpp:216
void setParameters_impl(const Teuchos::RCP< Teuchos::ParameterList > ¶meterList)
Definition: Amesos2_KLU2_def.hpp:394
int symbolicFactorization_impl()
Perform symbolic factorization of the matrix using KLU2.
Definition: Amesos2_KLU2_def.hpp:98
int preOrdering_impl()
Performs pre-ordering on the matrix to increase efficiency.
Definition: Amesos2_KLU2_def.hpp:84
bool matrixShapeOK_impl() const
Determines whether the shape of the matrix is OK for this solver.
Definition: Amesos2_KLU2_def.hpp:383
A Matrix adapter interface for Amesos2.
Definition: Amesos2_MatrixAdapter_decl.hpp:42
std::string name() const override
Return the name of this solver.
Definition: Amesos2_SolverCore_def.hpp:738
int numericFactorization_impl()
KLU2 specific numeric factorization.
Definition: Amesos2_KLU2_def.hpp:128
Amesos2 interface to the KLU2 package.
Definition: Amesos2_KLU2_decl.hpp:38
Passes functions to TPL functions based on type.
Definition: Amesos2_FunctionMap.hpp:42
bool single_proc_optimization() const
can we optimize size_type and ordinal_type for straight pass through, also check that is_contiguous_ ...
Definition: Amesos2_KLU2_def.hpp:78
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters_impl() const
Definition: Amesos2_KLU2_def.hpp:422
host_value_type_array host_nzvals_view_
Stores the values of the nonzero entries for CHOLMOD.
Definition: Amesos2_KLU2_decl.hpp:211
Provides access to interesting solver traits.
int transFlag_
Definition: Amesos2_KLU2_decl.hpp:229