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

#include <screening_kernels.h>

Public Types

using RowsVisitor
 Calls use(R_m); R_m may be a block of stored data or a temporary.
using RowsFn = std::function<void(Index m, const RowsVisitor& use)>
using WeightsFn = std::function<void(Index m, Eigen::VectorXd& w)>
 Writes the weights of block m; their number is the number of rows.

Static Public Member Functions

static void setBatchMemory (double bytes)
 Bytes for the stacked rows of one batch of blocks.
static Eigen::MatrixXd Compute (Index nblocks, Index ncols, const WeightsFn &weights, const RowsFn &rows)

Static Private Attributes

static double batch_bytes_ = 5e8

Detailed Description

Weighted Gram matrix S = sum_m R_m^T diag(w_m) R_m over a set of row blocks R_m (n_m x ncols), as in the RPA response sum_{v,c} M_vc^T d_vc M_vc.

Only the lower triangle is computed (half the flops of the full product), in tiles of S over row blocks stacked from several m, each tile one GEMM; rows with negative weights are kept apart, so S = Xp^T Xp - Xn^T Xn with X = sqrt|w| R. One output matrix, no per-thread copies of S.

Definition at line 43 of file screening_kernels.h.

Member Typedef Documentation

◆ RowsFn

using votca::xtp::WeightedGram::RowsFn = std::function<void(Index m, const RowsVisitor& use)>

Definition at line 48 of file screening_kernels.h.

◆ RowsVisitor

Initial value:
std::function<void(const Eigen::Ref<const Eigen::MatrixXd>&)>

Calls use(R_m); R_m may be a block of stored data or a temporary.

Definition at line 46 of file screening_kernels.h.

◆ WeightsFn

using votca::xtp::WeightedGram::WeightsFn = std::function<void(Index m, Eigen::VectorXd& w)>

Writes the weights of block m; their number is the number of rows.

Definition at line 50 of file screening_kernels.h.

Member Function Documentation

◆ Compute()

Eigen::MatrixXd votca::xtp::WeightedGram::Compute ( Index nblocks,
Index ncols,
const WeightsFn & weights,
const RowsFn & rows )
static

Definition at line 75 of file screening_kernels.cc.

◆ setBatchMemory()

void votca::xtp::WeightedGram::setBatchMemory ( double bytes)
inlinestatic

Bytes for the stacked rows of one batch of blocks.

Definition at line 53 of file screening_kernels.h.

Member Data Documentation

◆ batch_bytes_

double votca::xtp::WeightedGram::batch_bytes_ = 5e8
staticprivate

Definition at line 59 of file screening_kernels.h.


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