Boost logo

Ublas :

From: Ian McCulloch (ianmcc_at_[hidden])
Date: 2007-03-01 12:24:36


Sourabh wrote:

> Hi,
> Is there any size limit on the matrix I can create in ublas.
> Please see the following program :
> #include <boost/numeric/ublas/matrix.hpp>
> #include <boost/numeric/ublas/triangular.hpp>
> #include <boost/numeric/ublas/io.hpp>
> #include <boost/numeric/ublas/matrix_sparse.hpp>
> #include <boost/numeric/ublas/matrix_proxy.hpp>
> using namespace boost::numeric::ublas;
>
> int main (int argc, char* argv[])
> {
> int n = atoi (argv[1]);
> triangular_matrix<double, lower> m (n,n);
> }
>
> when I give argv[1] >= 100000, the program aborts saying:
>
> Assertion failed in file
> <boost/numeric/ublas/functional.hpp>
> at line 1456:
> size == 0 || size / 2 < (std::numeric_limits<size_type>::max) () / size
> Aborted (core dumped)

What hardware are you using? A 100000x100000 triangular matrix will take
around 40GB of memory to store. Only a 64-bit machine would have a chance
of allocating that much memory, even then it is not so common to have that
much RAM.

Cheers,
Ian