@@ -22,6 +22,9 @@ struct BlockDiagonalLDLT;
22
22
struct BlockDiagonal ;
23
23
24
24
struct BlockDiagonalLDLT {
25
+ using RealScalar = Eigen::SerializableLDLT::RealScalar;
26
+ using Scalar = Eigen::SerializableLDLT::Scalar;
27
+ using MatrixType = Eigen::SerializableLDLT::MatrixType;
25
28
std::vector<Eigen::SerializableLDLT> blocks;
26
29
27
30
template <class _Scalar , int _Rows, int _Cols>
@@ -50,10 +53,14 @@ struct BlockDiagonalLDLT {
50
53
sqrt_solve (const Eigen::Matrix<_Scalar, _Rows, _Cols> &rhs,
51
54
ThreadPool *pool) const ;
52
55
56
+ const BlockDiagonalLDLT &adjoint () const ;
57
+
53
58
std::map<size_t , Eigen::Index> block_to_row_map () const ;
54
59
55
60
double log_determinant () const ;
56
61
62
+ double rcond () const ;
63
+
57
64
Eigen::Index rows () const ;
58
65
59
66
Eigen::Index cols () const ;
@@ -197,6 +204,17 @@ inline double BlockDiagonalLDLT::log_determinant() const {
197
204
return output;
198
205
}
199
206
207
+ inline double BlockDiagonalLDLT::rcond () const {
208
+ // L1 induced norm is just the maximum absolute column sum.
209
+ // Therefore the L1 induced norm of a block-diagonal matrix is the
210
+ // maximum of the L1 induced norms of the individual blocks.
211
+ double l1_norm = -INFINITY;
212
+ for (const auto &b : blocks) {
213
+ l1_norm = std::max (l1_norm, b.l1_norm ());
214
+ }
215
+ return Eigen::internal::rcond_estimate_helper (l1_norm, *this );
216
+ }
217
+
200
218
inline Eigen::Index BlockDiagonalLDLT::rows () const {
201
219
Eigen::Index n = 0 ;
202
220
for (const auto &b : blocks) {
@@ -213,6 +231,10 @@ inline Eigen::Index BlockDiagonalLDLT::cols() const {
213
231
return n;
214
232
}
215
233
234
+ inline const BlockDiagonalLDLT &BlockDiagonalLDLT::adjoint () const {
235
+ return *this ;
236
+ }
237
+
216
238
/*
217
239
* Block Diagonal
218
240
*/
0 commit comments