예제 #1
0
파일: TempBuffer.cs 프로젝트: xyuan/BoSSS
        /// <summary>
        /// Only use this if you know what you are doing: you're about to theave tha save .NET-world.
        /// </summary>
        public static MultidimensionalArray GetTempMultidimensionalarray(out int iBuf, params int[] Lengths)
        {
            int size = 1;

            for (int i = Lengths.Length - 1; i >= 0; i--)
            {
                size *= Lengths[i];
            }

            double[] buffer = GetTempBuffer(out iBuf, size);

            var R = MultidimensionalArray.CreateWrapper(buffer, Lengths);

            R.Clear();
            return(R);
        }