- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear fellow developers.
We are struggling hard to accomplish the integration between some code part
written in Fortran and part written in VB.
Departing from the following definition of "two-dimensional table" in C#:
======================================
A two-dimensional table is an array in which each element object is itself an
array. This is not like in C, where a single block of memory contains all
elements of multidimensional tables. For example, this line of code represents
a table of two rows, but the first row has three elements, while the second
one has only two:
int[][] table1 = {{11, 12, 13}, {21, 22}};
If you define something like this:
int[][] table = new int[2][3];
you have a table with two rows and three columns, with all elements
initialized to zero. When declaring a table, you can leave the last dimension
empty. For example, the following declaration results in a table of two rows,
but the rows are undefined and remain set to null:
int[][] table = new int[2][];
Before being able to assign values to the individual elements of such a
partially defined table, youll have to declare its rows or assign already
declared monodimensional arrays to them:
int[] anArray = {10, 100};
table[0] = anArray;
table[1] = new int[5];
======================================
We wonder whether you could be kind enough to provide us a working example of
a method, written in Visual Basic, that is able to call a library (.dll)
written in Fortran, passing a two-dimensional table as one of its parameters. We have already looked in Fortran reference documents an examples, and it only deals with bidimensional arrays ( not twodim-table arrays - or array of arrays).
Best Regards,
Pedro Campos
We are struggling hard to accomplish the integration between some code part
written in Fortran and part written in VB.
Departing from the following definition of "two-dimensional table" in C#:
======================================
A two-dimensional table is an array in which each element object is itself an
array. This is not like in C, where a single block of memory contains all
elements of multidimensional tables. For example, this line of code represents
a table of two rows, but the first row has three elements, while the second
one has only two:
int[][] table1 = {{11, 12, 13}, {21, 22}};
If you define something like this:
int[][] table = new int[2][3];
you have a table with two rows and three columns, with all elements
initialized to zero. When declaring a table, you can leave the last dimension
empty. For example, the following declaration results in a table of two rows,
but the rows are undefined and remain set to null:
int[][] table = new int[2][];
Before being able to assign values to the individual elements of such a
partially defined table, youll have to declare its rows or assign already
declared monodimensional arrays to them:
int[] anArray = {10, 100};
table[0] = anArray;
table[1] = new int[5];
======================================
We wonder whether you could be kind enough to provide us a working example of
a method, written in Visual Basic, that is able to call a library (.dll)
written in Fortran, passing a two-dimensional table as one of its parameters. We have already looked in Fortran reference documents an examples, and it only deals with bidimensional arrays ( not twodim-table arrays - or array of arrays).
Best Regards,
Pedro Campos
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
AFAIKVBand Fortran do not have direct support for arrays of arrays. As you know, C# does in addition tosupporting jagged arrays (rows or columns of different size).Try googling Kronecker or tensor algebra to see if it can be done easily in Fortran. I've only ever seen it done in C.
Gerry

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page