Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transforming an ARRAY
Message
De
02/11/1998 09:19:55
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00153394
Message ID:
00153459
Vues:
18
>Hello,
>
>I have an array that is X by Y. For example, DIMENSION MyArray[X,Y].
>
>The problem is, it's being returned from another program and I need it to be Y by X. This array can be very large. Let's say X = 5 and Y = 100,000. If I do:
>
>Dimension MyNewArray[Y,X]
>for I = 1 to X
> for Z = 1 to Y
> MyNewArray[Z,I] = MyArray[I,Z]
> endfor
>endfor
>
>the results take too long. My current routine runs in 26 seconds. With the array transform, the routine takes up to 54 seconds. Way to much of a performance hit.
>
>So, what I'm looking for is a faster way than the above.
>
>Thanks, Scott
Scott,
There is something wrong here. Arrays could hold about 64K elems at max. With that limit, on a 286 or 386 a transformation could take that long maybe, and I don't think you try it with a computer that much slow. So it should be other part of code running slow.
If it couldn't be optimized I would do no conversion and instead refer to mynewarray[Y,X] as myarray[X*Y].
What is the real code and purpose ? Maybe it could be optimized in some other way.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform