MTL
Pauline Mak <[email protected]>
| Newsgroups | gmane.comp.lib.mtl.devel |
|---|---|
| Message-ID | <Pine.LNX.4.44.0209230943310.12859-100000@ids> |
Hello, I've been using the Matrix Template Library for a pattern recognition program. I basically use the template library for matrix inversion, using the LU inverse algorithm. I sometimes get an error when using this, and I'm not entirely sure why it works sometimes but not all the time. I get a seg fault when I apply an LU inverse to a dense 2D matrix (of type double). The problem seems to stem from deallocation of a vector. The following trace was from gdb. ------------------------------------------------------------------------- Program received signal SIGSEGV, Segmentation fault. 0x4207ac9e in chunk_free () from /lib/i686/libc.so.6 (gdb) up #1 0x4207ac24 in free () from /lib/i686/libc.so.6 (gdb) up #2 0x0804ce05 in __malloc_alloc_template<0>::deallocate () (gdb) up #3 0x0804cbfb in __default_alloc_template<true, 0>::deallocate () (gdb) up #4 0x0806206c in simple_alloc<double, __default_alloc_template<true, 0> >::deal (gdb) up #5 0x0805fd45 in _Vector_alloc_base<double, allocator<double>, true>::_M_deallo (gdb) up #6 0x0805ca1d in _Vector_base<double, allocator<double> >::~_Vector_base () (gdb) up #7 0x0805fdb9 in vector<double, allocator<double> >::~vector () (gdb) up #8 0x0805cab5 in mtl::refcnt_ptr<vector<double, allocator<double> > >::dec () (gdb) up #9 0x0805abb5 in mtl::refcnt_ptr<vector<double, allocator<double> > >::~refcnt_ (gdb) up #10 0x08059353 in mtl::dense1D<double, 0>::~dense1D () (gdb) up #11 0x080584e2 in void mtl lu_inverse<mtl::row_matrix<mtl::gen_dense2D<double, m ix<mtl::gen_dense2D<double, mtl::gen_rect_offset<0, 0>, 0, 0>, mtl::gen_rect_ind (gdb) up #12 0x08056531 in Path_Class::calc_weights () (gdb) up #13 0x0806586b in Path_Classifier::calc_common_covariance () (gdb) up #14 0x0804dde8 in main () (gdb) up #15 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6 ----------------------------------------------------------------------- Is this a common problem? I'm using g++ 2.96 on a Redhat 7.3 box. Any help would be muchly appreciated!! Thanks, -Pauline _______________________________________________ This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/