Skip to content

Commit

Permalink
sqrt_transpose in BlockDiagonalLDLT
Browse files Browse the repository at this point in the history
  • Loading branch information
akleeman committed Jan 11, 2023
1 parent 74b2d30 commit 884903e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/albatross/src/linalg/block_diagonal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ struct BlockDiagonalLDLT {
sqrt_solve(const Eigen::Matrix<_Scalar, _Rows, _Cols> &rhs,
ThreadPool *pool) const;

BlockDiagonal sqrt_transpose() const;

std::map<size_t, Eigen::Index> block_to_row_map() const;

double log_determinant() const;
Expand Down Expand Up @@ -102,6 +104,13 @@ inline Eigen::Matrix<_Scalar, _Rows, _Cols> BlockDiagonalLDLT::sqrt_solve(
return output;
}

inline BlockDiagonal BlockDiagonalLDLT::sqrt_transpose() const {
auto sqrt_transpose_block = [](const auto &b) { return b.sqrt_transpose(); };
BlockDiagonal output;
output.blocks = apply(this->blocks, sqrt_transpose_block);
return output;
}

inline std::map<size_t, Eigen::Index>
BlockDiagonalLDLT::block_to_row_map() const {
Eigen::Index row = 0;
Expand Down

0 comments on commit 884903e

Please sign in to comment.