By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,134 Members | 1,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,134 IT Pros & Developers. It's quick & easy.

Using boostbindings with lapack

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.