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/mpi.h> 25 # include <deal.II/base/process_grid.h> 26 # include <deal.II/base/thread_management.h> 28 # include <deal.II/lac/full_matrix.h> 29 # include <deal.II/lac/lapack_support.h> 35 DEAL_II_NAMESPACE_OPEN
106 template <
typename NumberType>
122 const std::shared_ptr<const Utilities::MPI::ProcessGrid> &process_grid,
133 const std::shared_ptr<const Utilities::MPI::ProcessGrid> process_grid,
136 LAPACKSupport::Property::symmetric);
151 const std::shared_ptr<const Utilities::MPI::ProcessGrid> &process_grid,
161 const std::shared_ptr<const Utilities::MPI::ProcessGrid> process_grid,
164 LAPACKSupport::Property::symmetric);
236 const std::pair<unsigned int, unsigned int> &offset_A,
237 const std::pair<unsigned int, unsigned int> &offset_B,
238 const std::pair<unsigned int, unsigned int> &submatrix_size)
const;
264 const NumberType a = 0.,
265 const NumberType b = 1.,
266 const bool transpose_B =
false);
313 mult(
const NumberType b,
317 const bool transpose_A =
false,
318 const bool transpose_B =
false)
const;
340 const bool adding =
false)
const;
362 const bool adding =
false)
const;
384 const bool adding =
false)
const;
407 const bool adding =
false)
const;
430 save(
const char * filename,
431 const std::pair<unsigned int, unsigned int> &chunk_size =
447 load(
const char *filename);
495 std::vector<NumberType>
497 const std::pair<unsigned int, unsigned int> &index_limits,
498 const bool compute_eigenvectors);
508 std::vector<NumberType>
510 const std::pair<NumberType, NumberType> &value_limits,
511 const bool compute_eigenvectors);
529 std::vector<NumberType>
531 const std::pair<unsigned int, unsigned int> &index_limits,
532 const bool compute_eigenvectors);
544 std::vector<NumberType>
546 const std::pair<NumberType, NumberType> &value_limits,
547 const bool compute_eigenvectors);
577 std::vector<NumberType>
725 local_el(
const unsigned int loc_row,
const unsigned int loc_column)
const;
731 local_el(
const unsigned int loc_row,
const unsigned int loc_column);
743 template <
class InputVector>
757 template <
class InputVector>
786 std::vector<NumberType>
788 const bool compute_eigenvectors,
789 const std::pair<unsigned int, unsigned int> &index_limits =
792 const std::pair<NumberType, NumberType> &value_limits =
793 std::make_pair(std::numeric_limits<NumberType>::quiet_NaN(),
794 std::numeric_limits<NumberType>::quiet_NaN()));
815 std::vector<NumberType>
817 const bool compute_eigenvectors,
818 const std::pair<unsigned int, unsigned int> &index_limits =
821 const std::pair<NumberType, NumberType> &value_limits =
822 std::make_pair(std::numeric_limits<NumberType>::quiet_NaN(),
823 std::numeric_limits<NumberType>::quiet_NaN()));
830 save_serial(
const char * filename,
831 const std::pair<unsigned int, unsigned int> &chunk_size)
const;
838 load_serial(
const char *filename);
845 save_parallel(
const char * filename,
846 const std::pair<unsigned int, unsigned int> &chunk_size)
const;
853 load_parallel(
const char *filename);
872 std::shared_ptr<const Utilities::MPI::ProcessGrid>
grid;
912 mutable std::vector<NumberType>
work;
965 template <
typename NumberType>
968 const unsigned int loc_column)
const 970 return (*
this)(loc_row, loc_column);
975 template <
typename NumberType>
978 const unsigned int loc_column)
980 return (*
this)(loc_row, loc_column);
984 template <
typename NumberType>
993 template <
typename NumberType>
1002 template <
typename NumberType>
1011 template <
typename NumberType>
1021 DEAL_II_NAMESPACE_CLOSE
1023 #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)
NumberType reciprocal_condition_number(const NumberType a_norm) const
static const unsigned int invalid_unsigned_int
LAPACKSupport::State state
unsigned int global_column(const unsigned int loc_column) const
void copy_to(FullMatrix< NumberType > &matrix) const
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
NumberType norm_general(const char type) const
ScaLAPACKMatrix< NumberType > & operator=(const FullMatrix< NumberType > &)
unsigned int pseudoinverse(const NumberType ratio)
void load(const char *filename)
unsigned int local_m() const
void mTmult(ScaLAPACKMatrix< NumberType > &C, const ScaLAPACKMatrix< NumberType > &B, const bool adding=false) 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)
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 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)
const TableIndices< N > & size() const
LAPACKSupport::Property get_property() const
void least_squares(ScaLAPACKMatrix< NumberType > &B, const bool transpose=false)
NumberType norm_symmetric(const char type) const
void scale_rows(const InputVector &factors)
void set_property(const LAPACKSupport::Property property)
const int first_process_row
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)
SymmetricTensor< rank_, dim, Number > transpose(const SymmetricTensor< rank_, dim, Number > &t)
NumberType l1_norm() const
void TmTmult(ScaLAPACKMatrix< NumberType > &C, const ScaLAPACKMatrix< NumberType > &B, const bool adding=false) const
void mmult(ScaLAPACKMatrix< NumberType > &C, const ScaLAPACKMatrix< NumberType > &B, const bool adding=false) const
NumberType local_el(const unsigned int loc_row, const unsigned int loc_column) const
NumberType frobenius_norm() 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)
unsigned int local_n() const
std::vector< NumberType > work
const int first_process_column
LAPACKSupport::Property property
void Tadd(const NumberType b, const ScaLAPACKMatrix< NumberType > &B)
~ScaLAPACKMatrix() override=default
unsigned int global_row(const unsigned int loc_row) const
void Tmmult(ScaLAPACKMatrix< NumberType > &C, const ScaLAPACKMatrix< NumberType > &B, const bool adding=false) const
void compute_cholesky_factorization()
NumberType linfty_norm() const
LAPACKSupport::State get_state() const
void compute_lu_factorization()