copy matrices

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

    #1

    copy matrices

    Hello,

    could somebody provide some info on what the fastest way is to copy arrays?
    Basically I'm having a Matrix class which internally is represented by a 2D
    array of floats (float[,] data). I'm wondering what the best way is to copy
    all that data in for example a Clone() method. Should i use Array.Copy or
    should I look at unsafe code or are there better ways (maybe an alternative
    for the old memcpy)?

    Y


  • Jay B. Harlow [MVP - Outlook]

    #2
    Re: copy matrices

    phoenix,
    I would look at either Array.Copy or System.Buffer.B lockCopy.

    I would expect both of the above to be safely using unsafe code.

    Hope this helps
    Jay

    "phoenix" <patient0@skyne tWORK.be> wrote in message
    news:eFDYfPcZDH A.2932@tk2msftn gp13.phx.gbl...[color=blue]
    > Hello,
    >
    > could somebody provide some info on what the fastest way is to copy[/color]
    arrays?[color=blue]
    > Basically I'm having a Matrix class which internally is represented by a[/color]
    2D[color=blue]
    > array of floats (float[,] data). I'm wondering what the best way is to[/color]
    copy[color=blue]
    > all that data in for example a Clone() method. Should i use Array.Copy or
    > should I look at unsafe code or are there better ways (maybe an[/color]
    alternative[color=blue]
    > for the old memcpy)?
    >
    > Y
    >
    >[/color]


    Comment

    Working...