votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::SymmetricTiles Class Reference

A real symmetric n x n matrix stored as the tiles of its lower triangle (about half the memory of the dense matrix). More...

#include <symmetric_tiles.h>

Collaboration diagram for votca::xtp::SymmetricTiles:

Public Member Functions

 SymmetricTiles ()=default
void Allocate (Index n, Index kind, Index tile=DefaultTile)
void Release ()
bool allocated () const
bool built () const
Index size () const
Index kind () const
void SetRowLower (Index r, const double *values)
 Row r, columns 0..r (values[0..r]); rows may be set in parallel.
void FinishBuild ()
 Fills the upper halves of the diagonal tiles; marks the matrix built.
Eigen::MatrixXd Multiply (const Eigen::MatrixXd &X, double factor=1.0) const
 factor * S * X
double operator() (Index i, Index j) const
 Element (i, j), for tests.

Static Public Member Functions

static double Bytes (Index n, Index tile=DefaultTile)
 Bytes the tiles of an n x n matrix need.

Static Public Attributes

static constexpr Index DefaultTile = 1024

Private Types

using RowMajorMap
using ConstRowMajorMap

Private Member Functions

Index TileStart (Index I) const
Index TileSize (Index I) const
double * TileData (Index I, Index J) const

Private Attributes

Index n_ = 0
Index tile_ = DefaultTile
Index ntiles_ = 0
Index kind_ = 0
bool built_ = false
std::vector< std::size_t > offset_
std::unique_ptr< double[]> data_

Detailed Description

A real symmetric n x n matrix stored as the tiles of its lower triangle (about half the memory of the dense matrix).

The tiles (I, J), I >= J, are tile x tile blocks (smaller at the end), row-major, so that a row segment within a tile is contiguous. The diagonal tiles are stored in full. Rows are written with SetRowLower, which takes the columns 0..r of row r; FinishBuild() then fills the upper halves of the diagonal tiles.

Multiply(X) gives S X with the tiles of the lower triangle and their transposes, one row block of the result per task.

Definition at line 48 of file symmetric_tiles.h.

Member Typedef Documentation

◆ ConstRowMajorMap

Initial value:
Eigen::Map<const Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic,
Eigen::RowMajor>>

Definition at line 81 of file symmetric_tiles.h.

◆ RowMajorMap

Initial value:
Eigen::Map<
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>>

Definition at line 79 of file symmetric_tiles.h.

Constructor & Destructor Documentation

◆ SymmetricTiles()

votca::xtp::SymmetricTiles::SymmetricTiles ( )
default

Member Function Documentation

◆ Allocate()

void votca::xtp::SymmetricTiles::Allocate ( Index n,
Index kind,
Index tile = DefaultTile )

Allocates (uninitialised) storage for an n x n matrix; kind is a tag of what the matrix holds, checked by users that share it.

Definition at line 47 of file symmetric_tiles.cc.

◆ allocated()

bool votca::xtp::SymmetricTiles::allocated ( ) const
inline

Definition at line 62 of file symmetric_tiles.h.

◆ built()

bool votca::xtp::SymmetricTiles::built ( ) const
inline

Definition at line 63 of file symmetric_tiles.h.

◆ Bytes()

double votca::xtp::SymmetricTiles::Bytes ( Index n,
Index tile = DefaultTile )
static

Bytes the tiles of an n x n matrix need.

Definition at line 31 of file symmetric_tiles.cc.

◆ FinishBuild()

void votca::xtp::SymmetricTiles::FinishBuild ( )

Fills the upper halves of the diagonal tiles; marks the matrix built.

Definition at line 88 of file symmetric_tiles.cc.

◆ kind()

Index votca::xtp::SymmetricTiles::kind ( ) const
inline

Definition at line 65 of file symmetric_tiles.h.

◆ Multiply()

Eigen::MatrixXd votca::xtp::SymmetricTiles::Multiply ( const Eigen::MatrixXd & X,
double factor = 1.0 ) const

factor * S * X

Definition at line 97 of file symmetric_tiles.cc.

◆ operator()()

double votca::xtp::SymmetricTiles::operator() ( Index i,
Index j ) const

Element (i, j), for tests.

Definition at line 129 of file symmetric_tiles.cc.

◆ Release()

void votca::xtp::SymmetricTiles::Release ( )

Definition at line 69 of file symmetric_tiles.cc.

◆ SetRowLower()

void votca::xtp::SymmetricTiles::SetRowLower ( Index r,
const double * values )

Row r, columns 0..r (values[0..r]); rows may be set in parallel.

Definition at line 77 of file symmetric_tiles.cc.

◆ size()

Index votca::xtp::SymmetricTiles::size ( ) const
inline

Definition at line 64 of file symmetric_tiles.h.

◆ TileData()

double * votca::xtp::SymmetricTiles::TileData ( Index I,
Index J ) const
inlineprivate

Definition at line 87 of file symmetric_tiles.h.

◆ TileSize()

Index votca::xtp::SymmetricTiles::TileSize ( Index I) const
inlineprivate

Definition at line 86 of file symmetric_tiles.h.

◆ TileStart()

Index votca::xtp::SymmetricTiles::TileStart ( Index I) const
inlineprivate

Definition at line 85 of file symmetric_tiles.h.

Member Data Documentation

◆ built_

bool votca::xtp::SymmetricTiles::built_ = false
private

Definition at line 95 of file symmetric_tiles.h.

◆ data_

std::unique_ptr<double[]> votca::xtp::SymmetricTiles::data_
private

Definition at line 97 of file symmetric_tiles.h.

◆ DefaultTile

Index votca::xtp::SymmetricTiles::DefaultTile = 1024
staticconstexpr

Definition at line 50 of file symmetric_tiles.h.

◆ kind_

Index votca::xtp::SymmetricTiles::kind_ = 0
private

Definition at line 94 of file symmetric_tiles.h.

◆ n_

Index votca::xtp::SymmetricTiles::n_ = 0
private

Definition at line 91 of file symmetric_tiles.h.

◆ ntiles_

Index votca::xtp::SymmetricTiles::ntiles_ = 0
private

Definition at line 93 of file symmetric_tiles.h.

◆ offset_

std::vector<std::size_t> votca::xtp::SymmetricTiles::offset_
private

Definition at line 96 of file symmetric_tiles.h.

◆ tile_

Index votca::xtp::SymmetricTiles::tile_ = DefaultTile
private

Definition at line 92 of file symmetric_tiles.h.


The documentation for this class was generated from the following files: