Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: pem <pemryan <at> gmail.com>
Subject: Re: Newbie getting started
Newsgroups: gmane.comp.lib.boost.ublas
Date: Wednesday 11th April 2012 16:33:46 UTC (over 5 years ago)
me too have no experience on the usage of numeric bindings.
once I called lapack routine like this:


#include 
#include 
#include 

extern "C"  void dgetri_(const int* n, double* a, const int* lda, 
const int* ipiv, double* work, const int* lwork, int* info);

int main() {

matrix A(2,2);
A(0,0) = ...; 
...

vector ipiv(2);
ipiv(0) = ...;  


int n = A.size2();
int lda = n;
int lwork = n*n;
vector work(lwork);
const int* ipiv_ = &ipiv.data()[0];
double* work_ = &work.data()[0];
double* A_ = &A.data()[0];

int info;
dgetri_(&n, A_, &lda, ipiv_, work_, &lwork, &info);

}

simply link with lapack would get it work.
note that by default ublas matrix is column major and there are options for
row major.

if you need to call many routines of lapack, I think it's more efficicent
to use the numric bindings you find in sanbox.

HTH.

Bests,

2012-04-12 



Ryan Ren 



发件人: Ushtarador 
发送时间: 2012-04-11  22:45:07 
收件人: ublas 
抄送: 
主题: [ublas] Newbie getting started 
 
Hey there,
I am trying to calculate eigenvalues of small, dense matrices. Since the
project is already using boost, I am trying to get LAPACK working, but
since
i am not very experienced, I am stuck at the moment. I've been searching
for
hours now, but noboy seems to have such basic problems.
I now have:
- The library file LAPACK.lib 
- A Visual Studio 2008 project where I would like to calculate eigenvalues
of a boost matrix
I also added the svn repository
"http://svn.boost.org/svn/boost/sandbox/numeric_bindings/boost/numeric/bindings"
to the boost-directory on my harddisk, but I am not sure if I did
something
wrong. 
Could someone please give me step-by-step instructions how to proceed now?
:)
 
CD: 5ms