Boost logo

Ublas :

From: Preben Hagh Strunge Holm (preben_at_[hidden])
Date: 2007-03-11 05:02:45


> Hm, so it may be a memory management problem. Can you try
>
> dGv = prod<vector<double> >(dG,v);
> This forces the product to be computed in a temporary before calling
the copy constructor.
>
> Can you debug what happens at this line? Maybe there is just a
missing check in vector::resize() or unbounded_array::resize().
>
> If this does not help, send me a package. However it will take a few
days until I can investigate this.

Hi again

Now doing this:
noalias(dGv) = ublas::prod<ublas::vector<double> >(dG,v)

is still producing the same error:

-------------------
Breakpoint 1, rw::dynamics::MechComputer::ConstraintCorrection
(this=0x82f1078, qerror=1.0000000000000001e-15,
     verror=9.9999999999999998e-13, limit=20) at
../../master/src/MechComputer.cpp:614
614 noalias(dGv) = ublas::prod<ublas::vector<double>
>(dG, this->_v);
(gdb) s
boost::numeric::ublas::prod<boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::compressed_matrix<double,
boost::numeric::ublas::basic_row_major<unsigned int, int>, 0u,
boost::numeric::ublas::unbounded_array<unsigned int,
std::allocator<unsigned int> >,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
> > (e1=@0xbfc5c334, e2=@0x82f108c)
     at ../../RobWork/ext/boost/numeric/ublas/matrix_expression.hpp:3619
3619 return V (prod (e1, e2));
(gdb) n
3618 const vector_expression<E2> &e2) {
(gdb) n
3619 return V (prod (e1, e2));
(gdb)
2598 return size1_;
(gdb)
3619 return V (prod (e1, e2));
(gdb)
65 if (size_) {
(gdb)
64 alloc_(a), size_ (size) {
(gdb)
65 if (size_) {
(gdb)
87 if (__builtin_expect(__n > this->max_size(), false))
(gdb)
90 return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
(gdb)
66 data_ = alloc_.allocate (size_);
(gdb)
74 vector_assign<scalar_assign> (*this, ae);
(gdb)
Assertion failed in file
../../RobWork/ext/boost/numeric/ublas/detail/vector_assign.hpp at line 371:
detail::expression_type_check (v, cv)
terminate called after throwing an instance of
'boost::numeric::ublas::external_logic'
   what(): external logic

Program received signal SIGABRT, Aborted.
0xffffe410 in __kernel_vsyscall ()
(gdb)
-------------------------

I'll put up the source at http://www.interrupt.dk/gunter.tar.bz2, and
you should do as follows:

-------------
tar xvjf gunter.tar.bz2
cd gunter/RobWork/ext
make
cd ..
make
cd ../RobWorkStudio/qt
qmake
make
cd plugins/jog
qmake
make
cd ../treeview
qmake
make
cd ../..
./RobWorkStudio ../../master/scene/Scene.wu
-------------

it'll then run the application and "hopefully" produce an error quite soon.

The source of MechComputer is located at gunter/master/src/MechComputer.cpp

I very much appreciate the help...

Best regards,
Preben Holm