Subject: [Boost-bugs] [Boost C++ Libraries] #11292: Matrix Memory problem after using lu_factorize
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-13 08:16:37
#11292: Matrix Memory problem after using lu_factorize
------------------------------+---------------------
Reporter: michael.cortis@⦠| Owner: guwi17
Type: Bugs | Status: new
Milestone: To Be Determined | Component: uBLAS
Version: Boost 1.55.0 | Severity: Problem
Keywords: |
------------------------------+---------------------
Discovered that after using lu_factorize the values of the matrix have
changed!
{{{
#include <iostream>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/lu.hpp>
using namespace std;
using namespace boost::numeric;
int main()
{
ublas::matrix<double> X(3,3); X.clear();
X(0,0) = 0.995182407377577; X(0,1) =-0.006473367705848; X(0,2)
=-0.002032391957706;
X(1,0) =-0.006473367705848; X(1,1) = 0.995182407377577; X(1,2)
=-0.002032391957706;
X(2,0) =-0.002032391957706; X(2,1) =-0.002032391957706; X(2,2) =
0.936175146339137;
cout<<setprecision(16)<<X<<endl;
cout<<ublas::lu_factorize(X)<<endl;
cout<<setprecision(16)<<X<<endl;
cout<<ublas::lu_factorize(X)<<endl;
cout<<setprecision(16)<<X<<endl;
}
}}}
Output:
{{{
[3,3]((0.995182407377577,-0.006473367705848,-0.002032391957706),(-0.006473367705848,0.995182407377577,-0.002032391957706),(-0.002032391957706,-0.002032391957706,0.936175146339137))
0
[3,3]((0.995182407377577,-0.006473367705848,-0.002032391957706),(-0.006504704723334175,0.9951403000320849,-0.002045612067272957),(-0.002042230592742885,-0.002055601674665375,0.9361667907625133))
0
[3,3]((0.995182407377577,-0.006473367705848,-0.002032391957706),(-0.006536193440632496,0.9950979888485471,-0.002058896174255709),(-0.002052116855767581,-0.002079077442455779,0.9361583394521271))
}}}
Is this fixed in newer versions?
Thanks
Michael Cortis
RA, Durham University
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11292> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC