public override Array ToArray() { IntPtr ptr = matrix.mxGetLogicals(this.NativeObject); int row = this.M, col = this.N; int size = this.ElementSize; byte[] buffer = new byte[row * col * size]; Marshal.Copy(ptr, buffer, 0, buffer.Length); return BitConverterExtesions.ToArray(buffer, row, col); }
public override Array ToArray() { IntPtr ptr = matrix.mxGetData(base.NativeObject); int m = this.M, n = this.N, size = this.ElementSize; byte[] buffer = new byte[m * n * size]; Marshal.Copy(ptr, buffer, 0, buffer.Length); return(BitConverterExtesions.ToArray(buffer, m, n, this.NumericType)); }
/// <summary> /// Create a logical array of two dimsensions with bool array. /// </summary> /// <param name="values">The given bool array.</param> public mxLogicalArray(bool[,] values) { if (values == null || values.Length == 0) throw new ArgumentNullException("values", "The values must be not null or empty."); SafeArrayPtr pa = matrix.mxCreateLogicalArray(2, new int[] { values.GetLength(0), values.GetLength(1) }); CreateArray(pa, mxArrayType.Logical); byte[] buf = BitConverterExtesions.GetBytes(values); IntPtr ptr = matrix.mxGetData(this.NativeObject); Marshal.Copy(buf, 0, ptr, buf.Length); }
public mxNumericArray(int[,] realValues, int[,] imgValues) : this(BitConverterExtesions.GetBytes(realValues), BitConverterExtesions.GetBytes(imgValues), realValues.GetLength(0), realValues.GetLength(1), mxNumericType.INT32) { }
public mxNumericArray(double[,] values) : this(BitConverterExtesions.GetBytes(values), values.GetLength(0), values.GetLength(1), mxNumericType.DOUBLE) { }
public mxNumericArray(float[,] values) : this(BitConverterExtesions.GetBytes(values), values.GetLength(0), values.GetLength(1), mxNumericType.SINGLE) { }
public mxNumericArray(ulong[,] values) : this(BitConverterExtesions.GetBytes(values), values.GetLength(0), values.GetLength(1), mxNumericType.UINT64) { }
public mxNumericArray(int[,] values) : this(BitConverterExtesions.GetBytes(values), values.GetLength(0), values.GetLength(1), mxNumericType.INT32) { }
public mxNumericArray(ulong[] values) : this(BitConverterExtesions.GetBytes(values), BitConverterExtesions.ulong_size, mxNumericType.UINT64) { }
public mxNumericArray(double[,] realValues, double[,] imgValues) : this(BitConverterExtesions.GetBytes(realValues), BitConverterExtesions.GetBytes(imgValues), realValues.GetLength(0), realValues.GetLength(1), mxNumericType.DOUBLE) { }
public mxNumericArray(ulong[] realValues, ulong[] imgValues) : this(BitConverterExtesions.GetBytes(realValues), BitConverterExtesions.GetBytes(imgValues), BitConverterExtesions.ulong_size, mxNumericType.UINT64) { }
public mxNumericArray(uint[] realValues, uint[] imgValues) : this(BitConverterExtesions.GetBytes(realValues), BitConverterExtesions.GetBytes(imgValues), BitConverterExtesions.uint_size, mxNumericType.UINT32) { }
public mxNumericArray(short[] realValues, short[] imgValues) : this(BitConverterExtesions.GetBytes(realValues), BitConverterExtesions.GetBytes(imgValues), BitConverterExtesions.short_size, mxNumericType.INT16) { }
public mxNumericArray(sbyte[] realValues, sbyte[] imgValues) : this(BitConverterExtesions.GetBytes(realValues), BitConverterExtesions.GetBytes(imgValues), BitConverterExtesions.byte_size, mxNumericType.INT8) { }
public mxNumericArray(double[] values) : this(BitConverterExtesions.GetBytes(values), BitConverterExtesions.double_size, mxNumericType.DOUBLE) { }
public mxNumericArray(float[] values) : this(BitConverterExtesions.GetBytes(values), BitConverterExtesions.float_size, mxNumericType.SINGLE) { }
public mxNumericArray(ulong[,] realValues, ulong[,] imgValues) : this(BitConverterExtesions.GetBytes(realValues), BitConverterExtesions.GetBytes(imgValues), realValues.GetLength(0), realValues.GetLength(1), mxNumericType.UINT64) { }
public mxNumericArray(float[,] realValues, float[,] imgValues) : this(BitConverterExtesions.GetBytes(realValues), BitConverterExtesions.GetBytes(imgValues), realValues.GetLength(0), realValues.GetLength(1), mxNumericType.SINGLE) { }
public mxNumericArray(ushort[] values) : this(BitConverterExtesions.GetBytes(values), BitConverterExtesions.ushort_size, mxNumericType.UINT16) { }
public mxNumericArray(float[] realValues, float[] imgValues) : this(BitConverterExtesions.GetBytes(realValues), BitConverterExtesions.GetBytes(imgValues), BitConverterExtesions.float_size, mxNumericType.SINGLE) { }
public mxNumericArray(uint[] values) : this(BitConverterExtesions.GetBytes(values), BitConverterExtesions.uint_size, mxNumericType.UINT32) { }
public mxNumericArray(double[] realValues, double[] imgValues) : this(BitConverterExtesions.GetBytes(realValues), BitConverterExtesions.GetBytes(imgValues), BitConverterExtesions.double_size, mxNumericType.DOUBLE) { }
public mxNumericArray(sbyte[] values) : this(BitConverterExtesions.GetBytes(values), BitConverterExtesions.byte_size, mxNumericType.INT8) { }