一个MxN数组到M * NxM * N [英] A MxN array to M*NxM*N
本文介绍了一个MxN数组到M * NxM * N的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,我是编程方面的新手,我陷入了一个问题:我有一个大小为[M,N]的二维数组A,我需要制作另一个大小为[M * N,M的数组B * N]具有来自第一个数组的值和具有相同索引的元素(例如B [3,1]和B [1,3])具有相同的值.最快的可编程方法是什么(它必须尽可能快,因为它可以处理成千上万的数字)
Hello, i`m kinda newbie in programming and i`m stuck into a problem:i have a bidimensional array A of size [M,N] and i need to make another array B of size [M*N,M*N] with the values from the first array and the elements with same indices (for example B[3,1] and B[1,3] ) have the same values. What is the fastest programmable way to to this (it must be as faster as it can,because it will work with thousands of numbers)
推荐答案
逐元素克隆,请使用Array.Copy
方法.请参阅:
http://msdn.microsoft.com/zh-我们/library/system.array.copy%28v=vs.100%29.aspx [
To accelerate things and avoid element-by-element cloning, useArray.Copy
methods. Please see:
http://msdn.microsoft.com/en-us/library/system.array.copy%28v=vs.100%29.aspx[^].
—SA
这篇关于一个MxN数组到M * NxM * N的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文