Posted by
Peter Caspers-4 on
Apr 11, 2017; 6:59pm
URL: http://quantlib.414.s1.nabble.com/matrix-inverse-boost-exception-tp18181.html
Hi,
the following Code
#include <ql/math/matrix.hpp>
#include <iostream>
using namespace QuantLib;
int main() {
Real data[8][8] = {{0.0006474874439615692, 0.002486659100900001, 0.0006628267415236041, 0.04673067750857564,
0.1685162462417822, 0.1516341778778243, 0.1219910757564679, 0.507330849328965},
{5.165711089877979e-06, 0.001690175534926361, 2.136045858343317e-05, 0.04475379133340539,
0.1394666326109254, 0.1636645892860261, 0.12811590642367, 0.5222823786413735},
{4.3468717221017e-07, 3.324472127119397e-05, 1.632530899871639e-05, 0.0473437145861729,
0.09087902924968709, 0.1932661669150169, 0.1257053481714577, 0.5427557363602231},
{3.883601299340593e-07, 5.96026473031791e-06, 1.108224823791975e-05, 0.05269312648895734,
0.1170973364539729, 0.2225313741567021, 0.08459583680146567, 0.5230648952258039},
{1.311427219168951e-07, 1.451479950650993e-06, 9.870251521216817e-06, 0.002430611065235592,
0.1217894913776252, 0.2748389234300169, 0.07704266870962403, 0.5238868525433042},
{3.858458712871179e-08, 6.299157109034205e-07, 9.478963012990911e-06, 0.0006947826112014794,
0.007430976289762706, 0.2725490552732179, 0.07467942912312821, 0.6446356092393787},
{8.037084743179829e-09, 1.06623621797325e-07, 7.740443849605495e-06, 0.0005175216683466955,
0.004174347052491365, 0.02170492331427787, 0.06116825771382062, 0.9124270951465073},
{0, 0, 0, 0, 0, 0, 0, 1}};
Matrix m(8, 8);
for (Size i = 0; i < 8; ++i)
for (Size j = 0; j < 8; ++j)
m(i, j) = data[i][j];
std::clog << inverse(m) << std::endl;
return 0;
}
results in
Check failed in file /usr/local/include/boost/numeric/ublas/lu.hpp at line 298:
detail::expression_type_check (prod (triangular_adaptor<const_matrix_type, upper> (m), e), cm2)
libc++abi.dylib: terminating with uncaught exception of type boost::numeric::ublas::internal_logic: internal logic
for me. Does anyone have an idea what might go wrong here?
I am using Boost 1.59 + a recent QL version on OSX with clang 4.0.0. I believe QuantLib only wraps ublas functions here, so probably I should create a ticket in the boost project?
Thanks a lot
Peter
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org!
http://sdm.link/slashdot_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev