Current gemm(H, H, LR) implementation converts C to Dense and recurse to gemm(H, H, D).
define_method(
void, gemm_omm,
(
const Hierarchical& A, const Hierarchical& B, LowRank& C,
const double alpha, const double beta,
const bool TransA, const bool TransB
)
) {
Dense CD(C);
gemm(A, B, CD, alpha, beta, TransA, TransB);
C = LowRank(CD, C.eps); //or C = LowRank(CD, rank);
}
However, converting C to Hierarchical (e.g. use split function) might be better since this avoids unnecessary multiplications with Dense block.
Hierarchical CH(C);
gemm(A, B, CH, alpha, beta, TransA, TransB);
C = LowRank(CH, C.eps); //or C = LowRank(CH, rank);
For this to work, additional LowRank constructor from a Hierarchical object is needed. Also when converting LowRank C to Hierarchical, make sure that C.eps is passed down to the resulting LowRank blocks
Current
gemm(H, H, LR)implementation converts C toDenseand recurse togemm(H, H, D).However, converting C to
Hierarchical(e.g. usesplitfunction) might be better since this avoids unnecessary multiplications withDenseblock.For this to work, additional
LowRankconstructor from aHierarchicalobject is needed. Also when convertingLowRankC toHierarchical, make sure thatC.epsis passed down to the resultingLowRankblocks