Boost logo

Ublas :

Subject: [ublas] Possible defect in mapped_vector
From: Benson Margulies (bimargulies_at_[hidden])
Date: 2008-10-17 22:49:03


I am trying to use mapped_vector with map_array, as per doc.

The first thing I do is resize, and it immediately sets of a
consistency check in the map_array which throws.

Both of the iterators are null, as is 'data' in the mapped_vector.

Check failed in file
/usr/local/include/boost-1_36/boost/numeric/ublas/storage_sparse.hpp
at line 413:
begin () <= it1 && it1 < it2 && it2 <= end ()
terminate called after throwing an instance of
'boost::numeric::ublas::bad_index'
  what(): bad index

10 __cxa_throw() 0x92fa7261
9 boost::numeric::ublas::bad_index::raise()
/usr/local/include/boost-1_36/boost/numeric/ublas/exception.hpp:144
0x000135ab
8 boost::numeric::ublas::map_array<unsigned long, prob_and_mi,
std::allocator<std::pair<unsigned long, prob_and_mi> > >::erase()
/usr/local/include/boost-1_36/boost/numeric/ublas/storage_sparse.hpp:413
0x00013e9a
7 boost::numeric::ublas::mapped_vector<prob_and_mi,
boost::numeric::ublas::map_array<unsigned long, prob_and_mi,
std::allocator<std::pair<unsigned long, prob_and_mi> > > >::resize()
/usr/local/include/boost-1_36/boost/numeric/ublas/vector_sparse.hpp:351
0x00013fa8
6 prob_and_mi_sparse_array::resize()
/Users/benson/x/excedrin/cluster/src/class_info.h:165 0x00013fe4