473,327 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Using boostbindings with lapack

Hi,

don't know if this is the correct group, but try anyway.

I would like to use boostbindings from the boost sandbox together with
my project where I use boost::numeric::ublas vectors and matrices.

I would guess that I could use these directly with the bindings in the
boost sandbox like:

----
#include <boost/numeric/bindings/lapack/gesv.hpp>
#include "MechComputer.hpp"

#include <iostream>

using namespace boost::numeric;
namespace lapack = boost::numeric::bindings::lapack;
using namespace std;
namespace rw {
namespace dynamics {
MechComputer::MechComputer(const MechSystem& msystem,
const ublas::vector<double>& q0,
const ublas::vector<double>& v0)
: _system(msystem), _q(q0), _v(v0) {
}
const ublas::vector<double>& MechComputer::step(double h) {
ublas::matrix<doubledG = _system.DConstraints(_q);
std::vector<ublas::matrix<double ddG =
_system.DDConstraints(_q);
ublas::vector<doubledV = _system.DV(_q);
ublas::vector<doublem = _system.GetMass();

ublas::matrix<doublemM = M(dG, m);
ublas::vector<doublevFT = mFmT(dG, ddG, dV, _v, m);

ublas::matrix<doubleB(vFT.size(), 1);

lapack::gesv(M,B); // Result in B

return m; // Just return something
}
}
}
----

Compiling with this command-line:
----
preben@thinkgen ~/working/master/src $ icc -I
/home/preben/working/boost-sandbox -c MechComputer.cpp
MechComputer.cpp(31): error: no instance of overloaded function
"boost::numeric::bindings::lapack::gesv" matches the argument list
argument types are: (boost::numeric::ublas::matrix<double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>
(const boost::numeric::ublas::matrix<double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>
&, const boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>
&), boost::numeric::ublas::matrix<double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>)
lapack::gesv(M,B); // Result in B
^

compilation aborted for MechComputer.cpp (code 2)
preben@thinkgen ~/working/master/src $
----

I don't understand the error and why it's wrong.
g++ complains even more and the error message is even more unclear for me.
/ Preben
Dec 30 '06 #1
1 5102
Preben wrote:
don't know if this is the correct group, but try anyway.

I would like to use boostbindings from the boost sandbox together with
my project where I use boost::numeric::ublas vectors and matrices.

I would guess that I could use these directly with the bindings in the
boost sandbox like:

----
#include <boost/numeric/bindings/lapack/gesv.hpp>
#include "MechComputer.hpp"

#include <iostream>

using namespace boost::numeric;
namespace lapack = boost::numeric::bindings::lapack;
using namespace std;
namespace rw {
namespace dynamics {
MechComputer::MechComputer(const MechSystem& msystem,
const ublas::vector<double>& q0,
const ublas::vector<double>& v0)
: _system(msystem), _q(q0), _v(v0) {
}
const ublas::vector<double>& MechComputer::step(double h) {
ublas::matrix<doubledG = _system.DConstraints(_q);
std::vector<ublas::matrix<double ddG =
_system.DDConstraints(_q);
ublas::vector<doubledV = _system.DV(_q);
ublas::vector<doublem = _system.GetMass();

ublas::matrix<doublemM = M(dG, m);
ublas::vector<doublevFT = mFmT(dG, ddG, dV, _v, m);

ublas::matrix<doubleB(vFT.size(), 1);

lapack::gesv(M,B); // Result in B

return m; // Just return something
}
}
}
----

Compiling with this command-line:
----
preben@thinkgen ~/working/master/src $ icc -I
/home/preben/working/boost-sandbox -c MechComputer.cpp
MechComputer.cpp(31): error: no instance of overloaded function
"boost::numeric::bindings::lapack::gesv" matches the argument list
argument types are: (boost::numeric::ublas::matrix<double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>
(const boost::numeric::ublas::matrix<double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>
&, const boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>
&), boost::numeric::ublas::matrix<double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>)
lapack::gesv(M,B); // Result in B
^

compilation aborted for MechComputer.cpp (code 2)
preben@thinkgen ~/working/master/src $
----

I don't understand the error and why it's wrong.
g++ complains even more and the error message is even more unclear for me.
Probably better to try the Boost User list. Also, you might consider
using STLFilt to make template error messages more readable.

Cheers! --M

Dec 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: drife | last post by:
Hello, Could someone please provide instructions for install Numeric with ATLAS and LAPACK? I've actually done this correctly, I think. But I don't see any difference in the speed. I'm...
1
by: Edward C. Jones | last post by:
I have a PC with Debian sid installed. I install all my Python stuff in /usr/local. I just installed numarray 1.3.1. Blaslite and lapacklite were compiled. Did the installation process search for...
1
by: pervinder | last post by:
Hi, I am building a c++ executable which uses fortan math libs. blas, lapack etc. But when i build this on HP-UX, i get below linker errors while it build without anyissues on Sun and Linux...
6
by: Santosh | last post by:
Hello all, I am trying to interface c++ and fortran, the fortran code is already there and I was successful in calling the subroutines and functions, but was not able to send the fortran module...
3
by: eri | last post by:
Hi all I need to convert a Fortran program I wrote some months ago. I need BLAS / LAPACK routines and it seems to be very difficult to make it work under Win + MingW32 + DevCPP; so I wonder if...
7
by: taoyangsjtu | last post by:
Dear friends, Now, I have just installed the system with full fedora core 4. I had to use lapack, but I don't know how to install and use it. Can anybody tell me the installation process in...
1
by: Ken Dere | last post by:
I am trying to install numpy-0.9.8 prior to installing scipy (0.4.9) on a machine running Suse 10.0 with Python 2.4 I am able to get numpy installed to the point when I import it I can do the...
2
by: Frédéric Degraeve | last post by:
Hello, My compiler is visual 7.1 ( Microsoft Visual C++ .NET ). I work on a c++ library for a big company which do many scientific computes. I want to integrate lapack++ inside the library by...
2
by: aberte | last post by:
Hi, i'm learning how to use lapack library (in particular, Intel MKL). I wish to know how I have to format the my inputs. I'm calling lapack functions from c++ (zhetri, zhemm, zgemm, zhseqr,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.