Visual Basic.net Passing arrays in procedures

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael

    #1

    Visual Basic.net Passing arrays in procedures

    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]

    #2
    Re: Visual Basic.net Passing arrays in procedures

    "Michael" <mconnolly4@hou ston.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/>

    Comment

    • _AnonCoward

      #3
      Re: Visual Basic.net Passing arrays in procedures

      "Michael" <mconnolly4@hou ston.rr.com> wrote in message
      news:c3xie.8349 0$AE6.46818@tor nado.texas.rr.c om...
      :
      : 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



      Comment

      Working...