Go to the documentation of this file.
33 #ifndef STRUMPACK_HODLR_MATRIX_HPP
34 #define STRUMPACK_HODLR_MATRIX_HPP
41 #include "dense/DistributedMatrix.hpp"
43 #include "sparse/CSRGraph.hpp"
55 std::unique_ptr<int[]> iwork;
56 int Ninter, Nallrows, Nallcols, Nalldat_loc,
57 *allrows, *allcols, *rowids, *colids, *pgids, Npmap, *pmaps;
84 using Vec_t = std::vector<std::size_t>;
85 using VecVec_t = std::vector<std::vector<std::size_t>>;
89 using real_t =
typename RealType<scalar_t>::value_type;
90 using mult_t =
typename std::function
92 using elem_t =
typename std::function
93 <scalar_t(std::size_t i, std::size_t j)>;
94 using delem_blocks_t =
typename std::function
95 <void(VecVec_t& I, VecVec_t& J, std::vector<DistMW_t>& B,
97 using elem_blocks_t =
typename std::function
98 <void(VecVec_t& I, VecVec_t& J, std::vector<DenseMW_t>& B,
138 const std::function<scalar_t(
int i,
int j)>& Aelem,
163 const elem_blocks_t& Aelem,
const opts_t& opts);
185 void(
Trans op,
const DenseM_t& R,DenseM_t& S)>& Amult,
216 template<
typename integer_t>
251 std::size_t
rows()
const {
return rows_; }
256 std::size_t
cols()
const {
return cols_; }
261 std::size_t
lrows()
const {
return lrows_; }
282 return get_stat(
"Mem_Fill") * 1024 * 1024;
300 return get_stat(
"Mem_Factor") * 1.e6;
337 double get_stat(
const std::string& name)
const;
353 (
const std::function<
void(
Trans op,
const DenseM_t& R,DenseM_t& S)>& Amult);
368 (
const std::function<
void(
Trans op,
const DenseM_t& R,DenseM_t& S)>& Amult,
378 void compress(
const delem_blocks_t& Aelem);
387 void compress(
const elem_blocks_t& Aelem);
403 void mult(
Trans op,
const DenseM_t& X, DenseM_t& Y)
const;
417 void mult(
Trans op,
const DistM_t& X, DistM_t& Y)
const;
438 long long int solve(
const DenseM_t& B, DenseM_t& X)
const;
452 long long int solve(
const DistM_t& B, DistM_t& X)
const;
466 long long int inv_mult(
Trans op,
const DenseM_t& B, DenseM_t& X)
const;
468 void extract_elements(
const VecVec_t& I,
const VecVec_t& J,
469 std::vector<DistM_t>& B);
470 void extract_elements(
const VecVec_t& I,
const VecVec_t& J,
471 std::vector<DenseM_t>& B);
485 void extract_elements(
const Vec_t& I,
const Vec_t& J, DenseM_t& B);
497 void set_sampling_parameter(
double sample_param);
499 DenseM_t redistribute_2D_to_1D(
const DistM_t& R)
const;
500 void redistribute_2D_to_1D(
const DistM_t& R2D, DenseM_t& R1D)
const;
501 void redistribute_1D_to_2D(
const DenseM_t& S1D, DistM_t& S2D)
const;
511 const std::vector<int>&
perm()
const {
return perm_; }
516 const std::vector<int>&
iperm()
const {
return iperm_; }
519 F2Cptr ho_bf_ =
nullptr;
520 F2Cptr options_ =
nullptr;
521 F2Cptr stats_ =
nullptr;
522 F2Cptr msh_ =
nullptr;
523 F2Cptr kerquant_ =
nullptr;
524 F2Cptr ptree_ =
nullptr;
527 int rows_ = 0, cols_ = 0, lrows_ = 0, lvls_ = 0;
528 std::vector<int> perm_, iperm_;
529 std::vector<int> dist_;
530 std::vector<int> leafs_;
532 void options_init(
const opts_t& opts);
536 template<
typename S>
friend class ButterflyMatrix;
541 const typename HODLRMatrix<scalar_t>::delem_blocks_t* Aelem;
547 template<
typename scalar_t>
void HODLR_block_evaluation
548 (
int* Ninter,
int* Nallrows,
int* Nallcols,
int* Nalldat_loc,
549 int* allrows,
int* allcols, scalar_t* alldat_loc,
550 int* rowids,
int* colids,
int* pgids,
int* Npmap,
int* pmaps,
553 template<
typename scalar_t>
void HODLR_block_evaluation_seq
554 (
int* Ninter,
int* Nallrows,
int* Nallcols,
int* Nalldat_loc,
555 int* allrows,
int* allcols, scalar_t* alldat_loc,
556 int* rowids,
int* colids,
int* pgids,
int* Npmap,
int* pmaps,
562 #endif // STRUMPACK_HODLR_MATRIX_HPP
This is a small wrapper class around a BLACS grid and a BLACS context.
Definition: BLACSGrid.hpp:66
double get_stat(const std::string &name) const
Definition: HODLRMatrix.hpp:540
std::size_t begin_row() const
Definition: HODLRMatrix.hpp:266
The cluster tree, or partition tree that represents the matrix partitioning of an HSS matrix.
Definition: HSSPartitionTree.hpp:65
std::size_t end_row() const
Definition: HODLRMatrix.hpp:271
Wrapper class around an MPI_Comm object.
Definition: MPIWrapper.hpp:190
std::size_t total_memory() const
Definition: HODLRMatrix.hpp:289
std::size_t memory() const
Definition: HODLRMatrix.hpp:281
HODLRMatrix(HODLRMatrix< scalar_t > &&h)
Definition: HODLRMatrix.hpp:229
Definition: StrumpackOptions.hpp:42
std::size_t rows() const
Definition: HODLRMatrix.hpp:251
const std::vector< int > & perm() const
Definition: HODLRMatrix.hpp:511
Definition: CompressedSparseMatrix.hpp:58
const MPIComm & Comm() const
Definition: HODLRMatrix.hpp:275
Like DenseMatrix, this class represents a matrix, stored in column major format, to allow direct use ...
Definition: DenseMatrix.hpp:991
Definitions of several kernel functions, and helper routines. Also provides driver routines for kerne...
Definition: DistributedMatrix.hpp:277
T all_reduce(T t, MPI_Op op) const
Definition: MPIWrapper.hpp:496
std::size_t total_factor_memory() const
Definition: HODLRMatrix.hpp:310
HODLRMatrix()
Definition: HODLRMatrix.hpp:104
Class containing several options for the HODLR code and data-structures.
Definition: HODLROptions.hpp:115
const std::vector< int > & iperm() const
Definition: HODLRMatrix.hpp:516
long long int inv_mult(Trans op, const DenseM_t &B, DenseM_t &X) const
std::size_t max_rank() const
Definition: HODLRMatrix.hpp:324
long long int solve(const DenseM_t &B, DenseM_t &X) const
std::size_t factor_memory() const
Definition: HODLRMatrix.hpp:299
int rank() const
Definition: MPIWrapper.hpp:267
Hierarchically low-rank matrix representation.
Definition: HODLRMatrix.hpp:78
DistM_t dense(const BLACSGrid *g) const
HODLRMatrix< scalar_t > & operator=(const HODLRMatrix< scalar_t > &h)=delete
void mult(Trans op, const DenseM_t &X, DenseM_t &Y) const
Contains the class holding HODLR matrix options.
std::size_t rank() const
Definition: HODLRMatrix.hpp:317
std::size_t cols() const
Definition: HODLRMatrix.hpp:256
void compress(const std::function< void(Trans op, const DenseM_t &R, DenseM_t &S)> &Amult)
Representation of a kernel matrix.
Definition: Kernel.hpp:73
std::size_t lrows() const
Definition: HODLRMatrix.hpp:261
Trans
Definition: DenseMatrix.hpp:50
This file contains the HSSPartitionTree class definition.
Definition: CompressedSparseMatrix.hpp:56