Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Huge Array / Matrix

Status
Not open for further replies.

ctmfab

Technical User
Jul 9, 2002
6
US
Does any know how to handle very large arrays or matrices in VB6.0. I get a memory error when using arrays that are of several thousand terms. (ie 3000x3000). This is for math calculations for stiffness matrix of steel structures.

I have seen suggestions to use an array of arrays. In other words each row of the matrix would have an array. This seems to be a good idea, but I don't know how to create additional arrays at runtime since the actual size of the matrix is unknown at design time.

Any ideas appreciated.
 
Yeah, 9,000,000 array elements is going to tax the memory, no matter how you slice it. Arrays of arrays might work. Try using the Array() function to create arrays at runtime, although you might have to do some fooling around. Also, you might consider using a recordset instead. You can make an ado recordset that isn't connected to a data source and populate it, which might still use up the memory. If it does, you can always create a temporary table and manipulate it using the recordset.

Bob
 
Thanks for the quick reply.

I am not sure I understand how to create arrays at runtime. Basically I would need to create "n" arrays for the "n" rows of the matrix.

Do you have any idea how this is normally handled in FEA type programs? These deal with large numbers of elements all the time.
 
This has been (recently?) discussed in Tek-Tips, so a search using "Array()" or other 'near' terms may find that discussion.

Briefly, my recollection is that IF you are doing matrix Math on the entire set it isn't going to work. Otherwise there is some hope either in recordsets or SPARSE array manipiulation (but only if your array is in fact "sparse").

Overall, 9 e6 elements is going to be somewhat of a challenge as even using single data types you are dealing with > 28 MBytes.

Basically you will need to get VERY familiar with VB and SOME database before solving the issue -IF it is amenable to soloution whit these "tools".




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top