2
#ifndef _psi3_dboc_stringblocks_h_
3
#define _psi3_dboc_stringblocks_h_
11
/// Manages logic of arranging strings into blocks of manageble size
14
StringBlocks(int nstr, int nstr_per_block);
17
/// How many strings per block?
18
int nstr_per_block() const;
22
int size(int block) const;
23
/// To which block does this string belong?
24
int block(int str) const;
25
/// Index within the block
26
int rel_to_block_begin(int str) const;
27
/// First string in this block
28
int begin(int block) const;
29
/// Last string in this block
30
int end(int block) const;
38
/// Manages matrices in the basis of blocked strings
39
class StringBlockedMatrix {
41
StringBlockedMatrix(const StringBlocks* strblk_bra, const StringBlocks* strblk_ket, const std::string& prefix);
42
/// Makes a copy of A, including deep copy of the buffer
43
StringBlockedMatrix(const StringBlockedMatrix& A);
44
~StringBlockedMatrix();
46
StringBlocks* strblk_bra() const { return strblk_bra_; }
47
StringBlocks* strblk_ket() const { return strblk_ket_; }
50
void read(int brablk, int ketblk);
51
void write(int brablk, int ketblk);
56
StringBlocks* strblk_bra_;
57
StringBlocks* strblk_ket_;
58
/// block size in bytes
60
int current_brablk_, current_ketblk_;
63
static const unsigned int psio_unit_ = PSIF_DBOC;
64
int need_to_init_psio_;
67
std::string key(int brablk, int ketblk);