473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

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
Nov 15 '05 #1
1 2629
phoenix,
I would look at either Array.Copy or System.Buffer.BlockCopy.

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

Hope this helps
Jay

"phoenix" <pa******@skynetWORK.be> wrote in message
news:eF**************@tk2msftngp13.phx.gbl...
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

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nils Wagner | last post by:
Hi all, Has someone written a C binding to transfer matrices from C to Python and vice versa ? Any pointer would be appreciated. Nils
3
by: Craig Nicol | last post by:
Hi, Although I've been using C++ for a while, I've only recently started writing my own template classes so forgive me if this is a silly question. I have a matrix class, mgMatrix, that is...
4
by: Yudan Yi | last post by:
I have a problem to copy (assign) a matrix to another matrix. Curreny, I know copy the number using loops, while it will take some time, I wonder if there have faster method. The following code...
3
by: Prototipo | last post by:
Hi! I need to dynamically create X vectors of matrices (with a known size of 5x5). It's like a three-dimensional matrix with 2 known dimensions and the third unknown. I have something like: ...
1
emaghero
by: emaghero | last post by:
Does anybody know an algorithm for the fast multiplication of three n-x-n symmetric matrices? I have an algorithm, which I'm not too pleased with, that does the job. Does anybody know a faster...
9
by: tomamil | last post by:
imagine that you have different matrices with different names and you want to perform the same action with each of them. is it possible to put their names into some array and to create a loop that...
5
by: td0g03 | last post by:
This program adds two square matrices - Algorithm 1-3, Page 35. Change it to implement the generalized algorithm to add two m x n matrices. Matrices, in general, are not square or n x n...
2
by: debiasri | last post by:
I have to devide a matrix in variable no of matrices with each having variable no of rows. Like I have to devide a matrix with dim.9X19 into say 4 matrices with row nos 1,6,6,6 respectively, and I...
5
by: adinda | last post by:
So what i need is this; (I'm very new at this,, programming in C I mean...) In matlab I had a while loop, and after each loop was done I added my resulting matrix to an object. Seeing the loop...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.