I ran degugger in C++ and the followings are the message I got:
Program received signal SIGABRT, Aborted.
0x002a57a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) info s
#0 0x002a57a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x002e97f5 in raise () from /lib/tls/libc.so.6
#2 0x002eb199 in abort () from /lib/tls/libc.so.6
#3 0x0031d4ea in __libc_message () from /lib/tls/libc.so.6
#4 0x0032464c in _int_malloc () from /lib/tls/libc.so.6
#5 0x003260b1 in malloc () from /lib/tls/libc.so.6
#6 0x007964c7 in operator new () from /usr/lib/libstdc++.so.6
#7 0x007965d9 in operator new[] () from /usr/lib/libstdc++.so.6
#8 0x0804b0c5 in matvec::Matrix<double>::resize (this=0xbff67710, m=1, n=50, val=@0xbff676f0)
at ../MABLUPEx/matrix.h:286
#9 0x0804bbd9 in main () at gvstatP5.cpp:69
I am not sure where the problem is. I would guess it's from matrix.h, so I attached that part of the program.
template<class T> inline Matrix<T>& Matrix<T>::resize(const size_type m,const size_type n,const T& val)
{
if (m == 0 || n == 0) {
clear();
} else {
int i,j;
if (m != nrow || n != ncol) {
clear();
nrow = m;
ncol = n;
me = new T* [nrow];
assert( me != 0 );
for (i=0; i<nrow; ++i) {
me [i]= new T [ncol]; // line 286
assert( me [i]!= 0 );
}
}
for (i=0; i<nrow; ++i) for (j=0; j<ncol; ++j) me[i][j] = val;
}
return *this;
}
Could somebody educate me what the problem is?
Thank you so much.