Boost logo

Ublas :

From: nisha kannookadan (nishak44_at_[hidden])
Date: 2008-01-12 13:52:20


Hi Karl

Thanx so much, but this isnt the problem. I have all this in it, but it has some mistakes
in the email, it doesnt show it. I post it again and hope, it will appear, when I sent it.

Im obviously a newbie with this bindings, I downloaded LAPACK now and I guess I need
to link it, but I have no clue about this all. I dont even make to install LAPACK on my
mac, Im happy about any help.

Nisha

Code

#include \
#include \
#include \
#include \

namespace ublas = boost::numeric::ublas;
namespace lapack = boost::numeric::bindings::lapack;

int main() {
        
        ublas::matrix\ A(3,3);
        A(0,0) = 1;
        A(0,1) = 1;
        A(0,2) = 1;
        A(1,0) = 2;
        A(1,1) = 3;
        A(1,2) = 1;
        A(2,0) = 1;
        A(2,1) = -1;
        A(2,2) = -1;
        
        std:: cout << A << std::endl;
        
        ublas::matrix\ B(3,1);
        B(0,0) = 4;
        B(0,1) = 9;
        B(0,2) = -2;
        
        std::cout << B << std::endl;
        
        lapack::gesv(A,B);
                                 
        std::cout << B << std::endl;
}

----------------------------------------
> Date: Sat, 12 Jan 2008 19:03:14 +0100
> From: karl.meerbergen_at_[hidden]
> To: ublas_at_[hidden]
> Subject: Re: [ublas] Lapack-solve linear equations
>
> Dear Nisha,
>
> You should include the following files:
> boost/numeric/bindings/traits/ublas_matrix.hpp
> boostnumeric/bindings/lapack/gesv.hpp
>
> Also, make sure dense_matrix is column_major!
>
> Good luck,
>
> Karl
>
>
>
>
> nisha kannookadan wrote:
>> Hi all
>>
>> Im trying to use the bindings, but something is wrong, but the error feedback aint helpful.
>>
>> This is the code:
>>
>>
>> #include
>> #include
>> #include
>> #include
>> #include
>> #include
>>
>>
>> #include
>> #include
>>
>>
>> #define NDEBUG
>>
>> using namespace boost::numeric;
>>
>> int main() {
>>
>> ublas::matrix A(5,5);
>> ublas::matrix b(5,1);
>>
>> // Construct a simple matrix
>> for (int i=0; i<=j ? 5.0+i-j : 0.0;
>>
>> std::cout << A << std::endl;
>>
>> for (int i=0; i<< b << std::endl;
>> }
>>
>> I believe, this should work, but the line: bindings::lapack::gesv(A,b); gives trouble, it says "Undefined symbols",
>> but I put its header in it.
>>
>> Thanks for any help
>>
>> Nisha K
>> _________________________________________________________________
>> Express yourself instantly with MSN Messenger! Download today it's FREE!
>> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>> _______________________________________________
>> ublas mailing list
>> ublas_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/ublas
>>
>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/