From: Ian S. <sc...@im...> - 2011-01-18 10:30:45
|
There is a bug in the code causing this problem vnl_c_vector_alloc() takes int types, so we are getting overflow. (On my 64-bit windows box anyway) 111322800*7=1.45 * 2^29 elements 1.45 * 2^29 * sizeof(double) > 2^31 This looks like it the first hard requirement for large vnl_matricies. I'll have a look into fixing vnl_c_vector_alloc, but it looks like this should really be fixed as part of a larger int->vcl_size_t fix for all vnl and vil. Followups to vxl-maintainers only please. Ian. On 11/01/2011 20:18, Martin Reuter wrote: > Hi, > > I reported a bug about the matrix alloc (a year or more ago). Just > looked at the svn dev version and it still seems not to be fixed. > > The problem is: > I try to alloc a large matrix, say: > > vnl_matrix<double> A( 111322800,7 ); > > very likely the constructor will not get this much memory, but does not > complain. > Now I expect at least: > A.assert_size(111322800,7); > to fail, but it does not. > > (It would be nice to have a better way of checking if the alloc went OK > w/o exiting, maybe there is??) > > now if I do: > A[111322799][6] = 3.0; > vcl_cout<< " success 111322799-6\n"; > > I get a segfault. > > This should be fixed by: > 1. having assert_size work as expected and not give OK, if the matrix > could not allocate the mem > 2. have a way of checking if allocation worked w/o exiting > > And if you are at it, > it would be great if we had a : > > set_diagonal( const vnl_vector< T> &) > > and > > vnl_vector< T> get_diagonal() > > I need that quite often. > > Cheers, Martin > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Vxl-users mailing list > Vxl...@li... > https://lists.sourceforge.net/lists/listinfo/vxl-users > > |