Boost logo

Ublas :

Subject: Re: [ublas] question about the atlas and
From: Kaveh Kohan (kaveh.kohan_at_[hidden])
Date: 2009-03-31 18:46:20


Dear Jesse,

Thank you for you reply.

Yes, I have installed boost using repository. About the atlas, that is already installed on my machine because I can see libatlas.so and libatlas.a in the share libraries folder. My question is that the boost library installed in my machine does not have binding folder. How can I get it? should I do something like this:

 svn checkout https://svn.boost.org/svn/boost/sandbox/numeric_bindings-v1/libs/numeric/bindings/

but after this, do I need to compile it to make libraries or it is not necessary?

Having the binding folder, I guess if I do the following (copied and passed from one of uBlas mailing list), it should do the job:

#include <boost/numeric/bindings/atlas/cblas3.hpp>
#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
namespace atlas = boost::numeric::bindings::atlas;

int main()
{
     size_t n = 100;
     ublas::matrix<double, ublas::column_major> A(n,n),B(n,n),C(n,n);

     // fill A and B
     atlas::gemm(A,B,C);
}

About your second advice, I really appreciate it but could please tell me why noalis() increase the performance? I did that I got no improvement.

Thank you for your help,

Regards,
Kaveh

________________________________
From: Jesse Perla <jesseperla_at_[hidden]>
To: ublas mailing list <ublas_at_[hidden]>
Sent: Tuesday, March 31, 2009 5:06:57 PM
Subject: Re: [ublas] question about the atlas and

2009/3/31 Kaveh Kohan <kaveh.kohan_at_[hidden]>

Dear All,

- I am a Linux user (Ubuntu 8.10, 64bit, gcc 4.3.2, 4Gig RAM) and I have isntalled boost using repository. It seems that atals is not officially part of the boost (pleas correct me if I am wrong)? Could anybody kindly tell how I can install it? I know that I should find in the sandbox but I could find any instruction or step through.

Do you mean the installation of atlas itself or the boost numeric bindings to atlas? Atlas is something you build separately, then you link things into your project. The numeric bindings will let you use atlas, blas, etc. with ublas (or other) matrices. The stable interface for the numeric bindings is in: https://svn.boost.org/svn/boost/sandbox/numeric_bindings-v1/

I have never used the atlas bindings, but you should check out:
http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Linear_Algebra_With_UBLAS

Also take a look at:
http://www.guwi17.de/ublas/examples/
and there are some examples at: http://www.cs.colostate.edu/~nate/tutorial/tutorial.html#tabexs

- My program involves multiplication of very tall matrix by almost square matrix (1000000x 30 by 30 x 30). I have performed this multiplication using gsl and it produced the result after 4.1second. Similar operation, using ublas took about 37second! Similar operation takes about 0.5second in MATLAB. I presume that there is a blunder in my program but I cannot figure it out:

For performance, here is an older link: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Frequently_Asked_Questions_Using_UBLAS

>From what everyone says, the first thing you do for speed is remove aliasing.
 i.e in your code:
noalias(X) = ublas::prod(A,B) ;