469,950 Members | 2,370 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

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 4831
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by drife | last post: by
1 post views Thread by Edward C. Jones | last post: by
1 post views Thread by pervinder | last post: by
6 posts views Thread by Santosh | last post: by
3 posts views Thread by eri | last post: by
7 posts views Thread by taoyangsjtu | last post: by
1 post views Thread by Ken Dere | last post: by
2 posts views Thread by Frédéric Degraeve | last post: by
2 posts views Thread by aberte | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.