Connecting Tech Pros Worldwide Forums | Help | Site Map

Visual Basic.net Passing arrays in procedures

Michael
Guest
 
Posts: n/a
#1: Nov 21 '05
Is there a way to pass only a sub-matrix (part of a larger) matrix in a
procedure by identifying the leading row/column element similar to what is
done in Fortran

I am trying to convert several linear algebra fortran routines over to VB
net and this is a problem area. I realize that i can copy the required
elements into a new array , pass it thru the routine and on return copy the
new elements back but this seems very inefficient.

Is ther a better way to do this in net. Have looked everywher but can't
find anything

Thanks



Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#2: Nov 21 '05

re: Visual Basic.net Passing arrays in procedures


"Michael" <mconnolly4@houston.rr.com> schrieb:[color=blue]
> Is there a way to pass only a sub-matrix (part of a larger) matrix in a
> procedure by identifying the leading row/column element similar to what is
> done in Fortran[/color]

You can pass additional start/end indices to the procedure.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

_AnonCoward
Guest
 
Posts: n/a
#3: Nov 21 '05

re: Visual Basic.net Passing arrays in procedures


"Michael" <mconnolly4@houston.rr.com> wrote in message
news:c3xie.83490$AE6.46818@tornado.texas.rr.com...
:
: Is there a way to pass only a sub-matrix (part of a larger) matrix in
: a procedure by identifying the leading row/column element similar to
: what is done in Fortran
:
: I am trying to convert several linear algebra fortran routines over to
: VB net and this is a problem area. I realize that i can copy the
: required elements into a new array, pass it thru the routine and on
: return copy the new elements back but this seems very inefficient.
:
: Is ther a better way to do this in net. Have looked everywher but
: can't find anything
:
: Thanks


I'm not aware of anyway you could pass a partial array in a function
call. Your only two options are to manually create the smaller array as
you've suggested above (which is terribly inefficient as you've noted)
or take Herfried's suggestion and pass in start and finish indices.


Ralf



Closed Thread