Sorry guys, I was wrong and those code works. i should use a good code to test them.
 

From: ublas-bounces@lists.boost.org [mailto:ublas-bounces@lists.boost.org] On Behalf Of Mei, Longyu
Sent: Monday, September 17, 2007 10:09 AM
To: ublas mailing list
Subject: [ublas] LU Matrix Inversion

I am trying to use the LU Matrix Inversion to do matrix inversion. I have latest boost (boost_1_34_1). I am use this InvertMatrix method: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?LU_Matrix_Inversion
 
 
When I test it with the following piece of code, I cannot get the right answer, and the result is "inverseResult: Failed". Anybody can help me out?
 
Do I need to update "lu.hpp" header includes from boost-CVS? if yest, anybody can email me one or tell me how to get from there?
 
 
matrix<float>inverseTest(3,3);
    for(int i = 0; i < inverseTest.size1(); ++i)
    {
        for(int j = 0; j < inverseTest.size2(); ++j)
        {
            inverseTest(i, j) = j + 1;
        }
    }
    cout << "inverseTest: " << inverseTest << endl;
    
    matrix<float>inverseResult(3,3);
    bool status = InvertMatrix(inverseTest, inverseResult);
    if(status)
    {
        cout << "inverseResult: " << inverseResult << endl;
    }
    else
    {
        cout << "inverseResult: Failed" << endl;
    } 
 
thanks,
 
James 
****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.