/// <summary> /// Gets a rectangular array representation in the CLR, equivalent of a matrix in R. /// </summary> /// <returns>Rectangular array with values representing the content of the R matrix. Beware NA codes</returns> protected override double[,] GetArrayFast() { var values = new double[this.ItemCount]; Marshal.Copy(DataPointer, values, 0, values.Length); return(ArrayConverter.ArrayConvertAllTwoDim(values, this.RowCount, this.ColumnCount)); }
/// <summary> /// Gets a rectangular array representation in the CLR, equivalent of a matrix in R. /// </summary> /// <returns>Rectangular array with values representing the content of the R matrix. Beware NA codes</returns> protected override Complex[,] GetArrayFast() { int n = this.ItemCount; var data = new double[2 * n]; Marshal.Copy(DataPointer, data, 0, 2 * n); var oneDim = RTypesUtil.DeserializeComplexFromDouble(data); return(ArrayConverter.ArrayConvertAllTwoDim(oneDim, this.RowCount, this.ColumnCount)); }
/// <summary> /// Gets a rectangular array representation in the CLR, equivalent of a matrix in R. /// </summary> /// <returns>Rectangular array with values representing the content of the R matrix. Beware NA codes</returns> protected override bool[,] GetArrayFast() { int[] intValues = new int[this.ItemCount]; Marshal.Copy(DataPointer, intValues, 0, intValues.Length); return(ArrayConverter.ArrayConvertAllTwoDim(intValues, Convert.ToBoolean, this.RowCount, this.ColumnCount)); }