- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Isearch VB.NET-Intel Fortran example with multidimensional arrays.
If I understand (?):
VB6 store arrays in column order
VB.NET store arrays in row order
Fortran store arrays in column order
also VB6+Fortran: memory is exact mapping
but VB.NET+Fortran: no exact mapping
Example: If I have matrix M
147
258
369
VB6 store 1 2 3 4 5 6 7 8 9
i.e. dim M(2,2) aslong
M(0,0) = 1
M(1,0) = 2
M(2,0) = 3
M(0,1) = 4
...
Fortran 1 2 3 4 5 6 7 8 9
i.e. INTEGER M(3,3)
M(1,0) = 1
M(2,0) = 2
M(3,0) = 3
M(1,1) = 4
...
VB.NET 1 4 7 2 5 8 3 6 9
i.e. dim M(2,2) as integer
M(0,0) = 1
M(1,0) = 2
M(2,0) = 3
M(0,1) = 4
...
Also, with VB.NET: dim M(k,l) as Integer
match Fortran INTEGER M(l,*)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I tried sending multidimensional numeric array to fortran from C#. Even the size of array being passed and one that is receiving at Fortran is same, the elements are being positioned differently.
For eg,
I sent
1 2 3 4
5 6 7 8
The fortran side receives
135 7
24 6 8
What should I do to receive the array in same order at Fortran side.
Please let me know.
Thanks You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many Thanks Steve. I understoodbetter now.I already have written acode with lot of arrays at Fortran side based on their desired rows and columns. On the other hand I have only few arrays to pass from C# side. So I interchanged the array row & columns at senders side (c#). For e.g. if Fortran already has array(x,y); I am passing array(y,x) from C#.
Regards,
Pradeep
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page