1#ifndef STRAWBERRY_DMRGCONGLUTINATIONS
2#define STRAWBERRY_DMRGCONGLUTINATIONS
8template<
typename MatrixType1,
typename MatrixType2>
16 Mout.conservativeResize(r1+r2, c1+c2);
18 Mout.bottomLeftCorner(r2,c1).setZero();
19 Mout.topRightCorner(r1,c2).setZero();
20 Mout.bottomRightCorner(r2,c2) = Min;
28template<
typename MatrixType1,
typename MatrixType2>
29void addRight (
const MatrixType1 &Min, MatrixType2 &Mout)
36 if (r1 == 0 and c2 != 0)
45 assert(Min.rows() == Mout.rows());
46 Mout.conservativeResize(r1, c1+c2);
47 Mout.rightCols(c2) = Min;
52template<
typename MatrixType1,
typename MatrixType2>
60 if (r == 0 and c2 != 0)
69 assert(Min.rows() == Mout.rows());
70 Mout.conservativeResize(c1+c2, c1+c2);
71 Mout.block(0,c1, r,c2) = Min;
72 Mout.bottomRows(c1+c2-r).setZero();
82template<
typename MatrixType1,
typename MatrixType2>
83void addBottom (
const MatrixType1 &Min, MatrixType2 &Mout)
90 if (r1 == 0 and r2 != 0)
99 assert(Min.cols() == Mout.cols());
100 Mout.conservativeResize(r1+r2, c1);
101 Mout.bottomRows(r2) = Min;
106template<
typename MatrixType1,
typename MatrixType2>
109 int r1 = Mout.rows();
114 if (r1 == 0 and r2 != 0)
123 assert(Min.cols() == Mout.cols());
124 Mout.conservativeResize(r1+r2, r1+r2);
125 Mout.block(r1,0, r2,c) = Min;
126 Mout.rightCols(r1+r2-c).setZero();
133template<
typename MatrixType1,
typename MatrixType2>
145template<
typename MatrixType>
148 size_t Mrows = M.rows();
149 size_t Mcols = M.cols()-1;
153 M.block(0,i,Mrows,Mcols-i) = M.block(0,i+1,Mrows,Mcols-i);
155 M.conservativeResize(Mrows,Mcols);
161template<
typename MatrixType>
164 size_t Mrows = M.rows()-1;
165 size_t Mcols = M.cols();
169 M.block(0,i,Mrows-i,Mcols) = M.block(i+1,0,Mrows-i,Mcols);
171 M.conservativeResize(Mrows,Mcols);
void addBottom(const MatrixType1 &Min, MatrixType2 &Mout)
void addBottomRight(const MatrixType1 &Min, MatrixType2 &Mout)
void addBottom_makeSquare(const MatrixType1 &Min, MatrixType2 &Mout)
void remove_row(size_t i, MatrixType &M)
void addRight(const MatrixType1 &Min, MatrixType2 &Mout)
void addPos(const MatrixType1 &Min, MatrixType2 &Mout, BLOCK_POSITION POS)
void remove_col(size_t i, MatrixType &M)
void addRight_makeSquare(const MatrixType1 &Min, MatrixType2 &Mout)