Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sparse matrices - vfp8
Message
De
01/10/2011 16:09:30
 
 
À
01/10/2011 05:56:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01525329
Message ID:
01525359
Vues:
61
>>Hello - Unfortunately vfp software doesn't let me create a square sparse matrix (as is doing - for example Matlab software); because I need to overcome the limit of 65,000 memory variables (even double ...) , I'm looking for a solution - anyone has a idea - it is welcome. Thanks in advance for your help, bye, Sorin
>
>
>(1) Use Collections - the key would be the string of the index
>For mulitdimension you'll need to add other collecttions
>
>This becomes a bit messy
>
>(2) If all elements are the same type, use SafeArray
>SafeArrays are allocated by windows
>
>http://msdn.microsoft.com/en-us/library/ms221145(v=VS.85).aspx
>
>- SaveArrayCreate() or SafeArrayCreateEx() for structures
>You can specify the number of dimensions and the lower/upperbounds for each dimension
>
>- SafeArrayCreateVector() for one dimensional arrays
>
>- SafeArrayDestroy() when you no longer need it
>
>
>- SafeArrayPutElement () to assign a value to an element
>- SafeArrayGetElement() to get the contents fo an element
>
>
>
>(3) a Cursor may be the simplest way

I like the cursor idea:
PrimaryKey   XSubscript   YSubscript   (ZSubscript...)   Value

   1             1             1            ...            42
  ...
Completely sparse "array" with up to about 250 "dimensions", if you want. Easy to insert/remove elements as needed.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform