Hi Rutger, This seems like a very thorough effort. However, a bit tangential to my questions, but that is all right. I do have already written, a fair amount of code using uBlas matrices and mkl and would like to clean it up; so I cannot afford to redo everything now. Also, if I may, there are benefits in wrapping the driver functions into classes rather than functions (albeit template), the primary one being wrapping all the necessary workspace related functionality, away from the user and solving the allocation size issues for them( reusability can be served by the persistence of the class members, now, a luxury that was not there in fortran ). Of course, if I had the bindings machinery at the time, things would be much better for the wrapping. Having said all that, I will definitely look more into it when I have more time. Thank you again, Petros -----Original Message----- From: Rutger ter Borg Sent: Tuesday, March 29, 2011 3:53 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Matrix of external data On 2011-03-29 20:32, petros wrote:
Hi, I am new to the matrix functionality of ublas and would like to ask a couple of questions. What I want to do is use the matrix data structures from ublas, together with a vendor supplied lapack (mkl). The issue is that , lapack acts on raw pointers to the matrix data, which, most of the time, it assumes to be contiguous – or some striding info is requested. Here are the questions: a) it is not clear to me that the storage is guaranteed to be contiguous. What would be the appropriate storage class to use? I would prefer that this is not stl-vector-based choice, since this is no longer guaranteed (to my knowledge) to possess this property. b) is there a way to wrap the data structure into a reference counted pointer? There would be a few benefits to this, as using the same matrix from different threads. Also, obviously, sharing the same data from many matrices, views to matrices etc. Also, very importantly to me, I would like to have the ability to “create” a matrix form an existing raw pointer, by “dressing” it into a ref-counted one, therefore separating the data ownership from the matrix functionality. Is there an example that does something along these lines? Thank you very much, in advance, for your help, Petros
Hello Petros, are you aware of Boost.NumericBindings library, which is under development? It provides modern-C++-glue between numeric algorithms such as those provided by LAPACK, BLAS, and matrix and vector containers such as those provided by uBLAS, eigen, MTL, and more. The library may be found here: http://svn.boost.org/svn/boost/sandbox/numeric_bindings/ Cheers, Rutger _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users