forum.alglib.net

ALGLIB forum
It is currently Fri Sep 22, 2023 12:30 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: problem with "setlength"
PostPosted: Wed Jun 22, 2011 4:18 pm 
Offline

Joined: Fri Jun 10, 2011 11:41 am
Posts: 3
edit: problem seems to have been fixed. I was probably trying allocate more memory than I had on accident. This failed for obvious reason.

description below.

the code:

laplaceArray.setlength(mesh_.n_vertices(), mesh_.n_vertices());
alglib::real_2d_array areas;
areas.setlength(mesh_.n_vertices(), mesh_.n_vertices()); //this is the line that causes the error
alglib::real_2d_array weights;
weights.setlength(mesh_.n_vertices(), mesh_.n_vertices());


error Message:


Unhandled Exception: System.Runtime.InteropServices.SEHException: External compo
nent has thrown an exception.
at _CxxThrowException(Void* , _s__ThrowInfo* )
at alglib.ae_matrix_wrapper.setlength(ae_matrix_wrapper* , Int32 rows, Int32
cols) in c:\users\nicholas\geometric modelling\project\exercise2\exercise2\src\c
ourseexamples\02-diffgeom\ap.cpp:line 4670
at HeatKernelMain.buildLaplaceMatrix(HeatKernelMain* ) in c:\users\nicholas\g
eometric modelling\project\exercise2\exercise2\src\courseexamples\02-diffgeom\he
atkernelmain.cpp:line 305
at HeatKernelMain.run_example(HeatKernelMain* ) in c:\users\nicholas\geometri
c modelling\project\exercise2\exercise2\src\courseexamples\02-diffgeom\heatkerne
lmain.cpp:line 128
at HeatKernelMain.open_mesh(HeatKernelMain* , SByte* _filename) in c:\users\n
icholas\geometric modelling\project\exercise2\exercise2\src\courseexamples\02-di
ffgeom\heatkernelmain.cpp:line 152
at main(Int32 argc, SByte** argv) in c:\users\nicholas\geometric modelling\pr
oject\exercise2\exercise2\src\courseexamples\02-diffgeom\differential.cc:line 43

at _mainCRTStartup()



The problem is a bit odd. If I comment out the line "laplaceArray.setlength(mesh_.n_vertices(), mesh_.n_vertices());", it doesn't crash at "areas.setlength(mesh_.n_vertices(), mesh_.n_vertices());" anymore, but at "weights.setlength(mesh_.n_vertices(), mesh_.n_vertices());"

the size of the matrix is currently about 34800*34800 (just checked: is this by any chance 5 gigabytes? that would explain the problem (only have 4 gigabytes of ram -.-)

edit: i'm using microsoft visual studio 2010 express.

edit2: the lines from ap.cpp
if( !ae_matrix_set_length(p_mat, rows, cols, NULL) )
throw alglib::ap_error("ALGLIB: malloc error"); <- error being thrown.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group