16 #ifndef dealii_scalapack_h 17 #define dealii_scalapack_h 19 #include <deal.II/base/config.h> 21 #ifdef DEAL_II_WITH_SCALAPACK 23 #include <deal.II/base/exceptions.h> 24 #include <deal.II/base/process_grid.h> 25 #include <deal.II/lac/full_matrix.h> 26 #include <deal.II/lac/lapack_support.h> 27 #include <deal.II/base/mpi.h> 28 #include <deal.II/base/thread_management.h> 33 DEAL_II_NAMESPACE_OPEN
104 template <
typename NumberType>
120 const std::shared_ptr<const Utilities::MPI::ProcessGrid> &process_grid,
130 const std::shared_ptr<const Utilities::MPI::ProcessGrid> process_grid,
145 const std::shared_ptr<const Utilities::MPI::ProcessGrid> &process_grid,
154 const std::shared_ptr<const Utilities::MPI::ProcessGrid> process_grid,
218 const std::pair<unsigned int,unsigned int> &offset_A,
219 const std::pair<unsigned int,unsigned int> &offset_B,
220 const std::pair<unsigned int,unsigned int> &submatrix_size)
const;
242 const NumberType a=0.,
243 const NumberType b=1.,
244 const bool transpose_B=
false);
254 void add(
const NumberType b,
265 void Tadd(
const NumberType b,
285 void mult(
const NumberType b,
289 const bool transpose_A=
false,
290 const bool transpose_B=
false)
const;
309 const bool adding=
false)
const;
328 const bool adding=
false)
const;
347 const bool adding=
false)
const;
367 const bool adding=
false)
const;
387 void save(
const char *filename,
401 void load(
const char *filename);
443 const bool compute_eigenvectors);
454 const bool compute_eigenvectors);
471 const bool compute_eigenvectors);
483 const bool compute_eigenvectors);
617 unsigned int global_row(
const unsigned int loc_row)
const;
622 unsigned int global_column(
const unsigned int loc_column)
const;
627 NumberType
local_el(
const unsigned int loc_row,
const unsigned int loc_column)
const;
632 NumberType &
local_el(
const unsigned int loc_row,
const unsigned int loc_column);
644 template <
class InputVector>
657 template <
class InputVector>
685 const std::pair<unsigned int,unsigned int> &index_limits=
687 const std::pair<NumberType,NumberType> &value_limits=
688 std::make_pair(std::numeric_limits<NumberType>::quiet_NaN(),std::numeric_limits<NumberType>::quiet_NaN()));
709 const std::pair<unsigned int,unsigned int> &index_limits=
711 const std::pair<NumberType,NumberType> &value_limits=
712 std::make_pair(std::numeric_limits<NumberType>::quiet_NaN(),std::numeric_limits<NumberType>::quiet_NaN()));
718 void save_serial(
const char *filename,
719 const std::pair<unsigned int,unsigned int> &chunk_size)
const;
725 void load_serial(
const char *filename);
731 void save_parallel(
const char *filename,
732 const std::pair<unsigned int,unsigned int> &chunk_size)
const;
738 void load_parallel(
const char *filename);
756 std::shared_ptr<const Utilities::MPI::ProcessGrid>
grid;
796 mutable std::vector<NumberType>
work;
849 template <
typename NumberType>
854 return (*
this)(loc_row,loc_column);
859 template <
typename NumberType>
864 return (*
this)(loc_row,loc_column);
868 template <
typename NumberType>
878 template <
typename NumberType>
888 template <
typename NumberType>
897 template <
typename NumberType>
901 return n_local_columns;
907 DEAL_II_NAMESPACE_CLOSE
909 #endif // DEAL_II_WITH_SCALAPACK std::vector< NumberType > eigenpairs_symmetric_by_index_MRRR(const std::pair< unsigned int, unsigned int > &index_limits, const bool compute_eigenvectors)
void copy_transposed(const ScaLAPACKMatrix< NumberType > &B)
ScaLAPACKMatrix(const size_type n_rows, const size_type n_columns, const std::shared_ptr< const Utilities::MPI::ProcessGrid > &process_grid, const size_type row_block_size=32, const size_type column_block_size=32, const LAPACKSupport::Property property=LAPACKSupport::Property::general)
std::vector< NumberType > eigenpairs_symmetric_by_value_MRRR(const std::pair< NumberType, NumberType > &value_limits, const bool compute_eigenvectors)
void mmult(ScaLAPACKMatrix< NumberType > &C, const ScaLAPACKMatrix< NumberType > &B, const bool adding=false) const
static const unsigned int invalid_unsigned_int
LAPACKSupport::State state
unsigned int global_row(const unsigned int loc_row) const
NumberType l1_norm() const
void Tmmult(ScaLAPACKMatrix< NumberType > &C, const ScaLAPACKMatrix< NumberType > &B, const bool adding=false) const
ScaLAPACKMatrix< NumberType > & operator=(const FullMatrix< NumberType > &)
unsigned int pseudoinverse(const NumberType ratio)
void load(const char *filename)
const TableIndices< N > & size() const
std::vector< NumberType > eigenpairs_symmetric(const bool compute_eigenvectors, const std::pair< unsigned int, unsigned int > &index_limits=std::make_pair(numbers::invalid_unsigned_int, numbers::invalid_unsigned_int), const std::pair< NumberType, NumberType > &value_limits=std::make_pair(std::numeric_limits< NumberType >::quiet_NaN(), std::numeric_limits< NumberType >::quiet_NaN()))
std::vector< NumberType > eigenpairs_symmetric_by_index(const std::pair< unsigned int, unsigned int > &index_limits, const bool compute_eigenvectors)
~ScaLAPACKMatrix()=default
void scale_columns(const InputVector &factors)
std::shared_ptr< const Utilities::MPI::ProcessGrid > grid
const int submatrix_column
void reinit(const size_type n_rows, const size_type n_columns, const std::shared_ptr< const Utilities::MPI::ProcessGrid > &process_grid, const size_type row_block_size=32, const size_type column_block_size=32, const LAPACKSupport::Property property=LAPACKSupport::Property::general)
void TmTmult(ScaLAPACKMatrix< NumberType > &C, const ScaLAPACKMatrix< NumberType > &B, const bool adding=false) const
void least_squares(ScaLAPACKMatrix< NumberType > &B, const bool transpose=false)
void mTmult(ScaLAPACKMatrix< NumberType > &C, const ScaLAPACKMatrix< NumberType > &B, const bool adding=false) const
void scale_rows(const InputVector &factors)
NumberType norm_symmetric(const char type) const
void set_property(const LAPACKSupport::Property property)
const int first_process_row
LAPACKSupport::State get_state() const
unsigned int global_column(const unsigned int loc_column) const
void add(const ScaLAPACKMatrix< NumberType > &B, const NumberType a=0., const NumberType b=1., const bool transpose_B=false)
std::vector< NumberType > eigenpairs_symmetric_by_value(const std::pair< NumberType, NumberType > &value_limits, const bool compute_eigenvectors)
NumberType norm_general(const char type) const
SymmetricTensor< rank_, dim, Number > transpose(const SymmetricTensor< rank_, dim, Number > &t)
void save(const char *filename, const std::pair< unsigned int, unsigned int > &chunk_size=std::make_pair(numbers::invalid_unsigned_int, numbers::invalid_unsigned_int)) const
unsigned int local_m() const
std::vector< NumberType > eigenpairs_symmetric_MRRR(const bool compute_eigenvectors, const std::pair< unsigned int, unsigned int > &index_limits=std::make_pair(numbers::invalid_unsigned_int, numbers::invalid_unsigned_int), const std::pair< NumberType, NumberType > &value_limits=std::make_pair(std::numeric_limits< NumberType >::quiet_NaN(), std::numeric_limits< NumberType >::quiet_NaN()))
std::vector< NumberType > compute_SVD(ScaLAPACKMatrix< NumberType > *U=nullptr, ScaLAPACKMatrix< NumberType > *VT=nullptr)
std::vector< NumberType > work
void mult(const NumberType b, const ScaLAPACKMatrix< NumberType > &B, const NumberType c, ScaLAPACKMatrix< NumberType > &C, const bool transpose_A=false, const bool transpose_B=false) const
void copy_to(FullMatrix< NumberType > &matrix) const
unsigned int local_n() const
const int first_process_column
LAPACKSupport::Property property
void Tadd(const NumberType b, const ScaLAPACKMatrix< NumberType > &B)
NumberType local_el(const unsigned int loc_row, const unsigned int loc_column) const
NumberType reciprocal_condition_number(const NumberType a_norm) const
NumberType linfty_norm() const
void compute_cholesky_factorization()
NumberType frobenius_norm() const
LAPACKSupport::Property get_property() const
void compute_lu_factorization()