Esempio n. 1
0
MatrixType
cholesky_invert(MatrixType a)
{
    // factorize
    int info = potrf(a);
    if (info != 0)
    {
        throw std::runtime_error("potrf failed in cholesky_invert " +
                                 std::to_string(info));
    }

    potri(a);
    return make_symmetric(a);
}
Esempio n. 2
0
      inline
      int potri (CBLAS_UPLO const uplo, SymmA& a) {

        CBLAS_ORDER const stor_ord
          = enum_cast<CBLAS_ORDER const>
          (storage_order<
#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
            typename traits::matrix_traits<SymmA>::ordering_type
#else
            typename SymmA::orientation_category 
#endif 
           >::value); 

        int const n = traits::matrix_size1 (a);
        assert (n == traits::matrix_size2 (a)); 

        return potri (stor_ord, uplo, n, 
                      traits::matrix_storage (a), 
                      traits::leading_dimension (a));
      }
Esempio n. 3
0
 inline
 int cholesky_invert (SymmA& a) { return potri (a); }