mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-10-30 18:33:33 +00:00
Included open-source Accord.net library code natively to the solution given the deprecated state of that project. Accord.net will be supported inside Jube for own needs (such as upgrading to .Net 7+). Accord.net libraries modified to compile to .Net 6. Modified Accord.net libraries to better support Newtonsoft Json.net serialisation. Included annotations in the Accord.net libraries to house important dependency statistics. Serialised json can be used independently of Jube to recall a Neural Network. Removal of Binary Serializer totally as a precursor to the projects support of .Net 7+. Extensive bug fixing in crucial functions of Neural Network training and recall. While this part of the system remains in Alpha, it is substantially more fit for purpose.
23505 lines
768 KiB
C#
23505 lines
768 KiB
C#
// Accord Math Library
|
|
// The Accord.NET Framework
|
|
// http://accord-framework.net
|
|
//
|
|
// Copyright © César Souza, 2009-2017
|
|
// cesarsouza at gmail.com
|
|
//
|
|
// This library is free software; you can redistribute it and/or
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
// License as published by the Free Software Foundation; either
|
|
// version 2.1 of the License, or (at your option) any later version.
|
|
//
|
|
// This library is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
// Lesser General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
// License along with this library; if not, write to the Free Software
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
//
|
|
|
|
// ======================================================================
|
|
// This code has been generated by a tool; do not edit manually. Instead,
|
|
// edit the T4 template Matrix.Elementwise.tt so this file can be regenerated.
|
|
// ======================================================================
|
|
|
|
namespace Accord.Math
|
|
{
|
|
using System;
|
|
using System.CodeDom.Compiler;
|
|
using Accord.Math;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Numerics;
|
|
|
|
// [GeneratedCode("Accord.NET T4 Templates", "3.1")]
|
|
public static partial class Matrix
|
|
{
|
|
/// <summary>
|
|
/// Converts a integer to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this int[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this int[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<int, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this int[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<int, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this int[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<int, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this int[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<int, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this int[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int16)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this int[,] value, short[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this int[,,] value, short[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this int[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int16)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this int[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this int[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int16)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this int[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this int[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this int[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<int, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this int[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<int, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this int[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<int, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this int[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<int, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this int[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Single)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this int[,] value, float[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this int[,,] value, float[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this int[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Single)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this int[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this int[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Single)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this int[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this int[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this int[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<int, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this int[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<int, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this int[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<int, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this int[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<int, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this int[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Double)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this int[,] value, double[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this int[,,] value, double[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this int[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Double)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this int[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this int[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Double)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this int[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a integer to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this int[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this int[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<int, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this int[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<int, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this int[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<int, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this int[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<int, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this int[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int64)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this int[,] value, long[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this int[,,] value, long[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this int[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int64)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this int[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this int[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int64)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this int[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this int[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this int[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<int, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this int[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<int, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this int[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<int, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this int[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<int, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this int[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Byte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this int[,] value, byte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this int[,,] value, byte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this int[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Byte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this int[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this int[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Byte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this int[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this int[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this int[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<int, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this int[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<int, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this int[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<int, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this int[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<int, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this int[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (SByte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this int[,] value, sbyte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this int[,,] value, sbyte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this int[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (SByte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this int[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this int[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (SByte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this int[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this int[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this int[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<int, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this int[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<int, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this int[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<int, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this int[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<int, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this int[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Decimal)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this int[,] value, decimal[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this int[,,] value, decimal[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this int[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this int[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this int[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Decimal)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this int[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this int[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this int[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<int, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this int[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<int, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this int[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<int, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this int[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<int, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this int[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this int[,] value, bool[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this int[,,] value, bool[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this int[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this int[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this int[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this int[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this int[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this int[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<int, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this int[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<int, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this int[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<int, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this int[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<int, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this int[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Object)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this int[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Object)value[i, j];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this int[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Object)value[i, j, k];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this int[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Object)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this int[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this int[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Object)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this int[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this int[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this int[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<int, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this int[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<int, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this int[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<int, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this int[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<int, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this int[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this int[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this int[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this int[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this int[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this int[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this int[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this int[] value)
|
|
{
|
|
return ToComplex(value, new Complex[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this int[,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<int, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this int[,,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<int, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this int[][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<int, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this int[][][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<int, Complex>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a integer array to a 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this int[] value, Complex[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Complex)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this int[,] value, Complex[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this int[,,] value, Complex[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (int* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional integer array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this int[,] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Complex)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this int[][] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this int[][][] value, Complex[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Complex)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged integer array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this int[][] value, Complex[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this short[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this short[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<short, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this short[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<short, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this short[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<short, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this short[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<short, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this short[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int32)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this short[,] value, int[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this short[,,] value, int[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this short[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int32)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this short[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this short[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int32)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this short[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this short[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this short[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<short, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this short[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<short, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this short[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<short, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this short[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<short, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this short[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Single)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this short[,] value, float[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this short[,,] value, float[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this short[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Single)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this short[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this short[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Single)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this short[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this short[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this short[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<short, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this short[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<short, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this short[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<short, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this short[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<short, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this short[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Double)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this short[,] value, double[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this short[,,] value, double[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this short[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Double)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this short[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this short[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Double)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this short[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this short[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this short[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<short, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this short[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<short, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this short[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<short, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this short[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<short, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this short[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int64)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this short[,] value, long[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this short[,,] value, long[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this short[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int64)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this short[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this short[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int64)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this short[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this short[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this short[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<short, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this short[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<short, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this short[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<short, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this short[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<short, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this short[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Byte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this short[,] value, byte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this short[,,] value, byte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this short[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Byte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this short[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this short[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Byte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this short[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this short[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this short[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<short, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this short[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<short, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this short[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<short, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this short[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<short, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this short[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (SByte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this short[,] value, sbyte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this short[,,] value, sbyte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this short[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (SByte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this short[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this short[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (SByte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this short[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this short[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this short[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<short, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this short[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<short, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this short[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<short, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this short[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<short, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this short[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Decimal)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this short[,] value, decimal[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this short[,,] value, decimal[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this short[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this short[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this short[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Decimal)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this short[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this short[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this short[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<short, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this short[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<short, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this short[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<short, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this short[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<short, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this short[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this short[,] value, bool[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this short[,,] value, bool[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this short[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this short[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this short[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this short[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this short[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this short[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<short, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this short[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<short, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this short[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<short, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this short[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<short, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this short[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Object)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this short[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Object)value[i, j];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this short[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Object)value[i, j, k];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this short[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Object)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this short[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this short[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Object)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this short[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this short[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this short[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<short, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this short[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<short, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this short[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<short, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this short[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<short, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this short[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this short[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this short[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this short[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this short[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this short[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this short[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a short integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this short[] value)
|
|
{
|
|
return ToComplex(value, new Complex[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this short[,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<short, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this short[,,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<short, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this short[][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<short, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a short integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this short[][][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<short, Complex>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a short integer array to a 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this short[] value, Complex[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Complex)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this short[,] value, Complex[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this short[,,] value, Complex[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (short* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional short integer array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this short[,] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Complex)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this short[][] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this short[][][] value, Complex[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Complex)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged short integer array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this short[][] value, Complex[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this float[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this float[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<float, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this float[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<float, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this float[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<float, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this float[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<float, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this float[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int32)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this float[,] value, int[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this float[,,] value, int[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this float[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int32)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this float[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this float[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int32)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this float[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this float[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this float[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<float, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this float[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<float, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this float[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<float, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this float[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<float, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this float[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int16)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this float[,] value, short[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this float[,,] value, short[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this float[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int16)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this float[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this float[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int16)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this float[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this float[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this float[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<float, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this float[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<float, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this float[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<float, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this float[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<float, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this float[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Double)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this float[,] value, double[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this float[,,] value, double[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this float[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Double)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this float[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this float[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Double)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this float[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this float[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this float[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<float, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this float[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<float, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this float[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<float, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this float[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<float, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this float[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int64)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this float[,] value, long[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this float[,,] value, long[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this float[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int64)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this float[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this float[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int64)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this float[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this float[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this float[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<float, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this float[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<float, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this float[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<float, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this float[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<float, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this float[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Byte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this float[,] value, byte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this float[,,] value, byte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this float[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Byte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this float[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this float[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Byte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this float[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this float[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this float[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<float, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this float[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<float, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this float[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<float, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this float[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<float, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this float[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (SByte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this float[,] value, sbyte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this float[,,] value, sbyte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this float[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (SByte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this float[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this float[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (SByte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this float[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this float[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this float[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<float, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this float[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<float, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this float[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<float, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this float[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<float, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this float[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Decimal)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this float[,] value, decimal[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this float[,,] value, decimal[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this float[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this float[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this float[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Decimal)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this float[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this float[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this float[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<float, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this float[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<float, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this float[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<float, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this float[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<float, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this float[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this float[,] value, bool[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this float[,,] value, bool[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this float[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this float[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this float[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this float[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this float[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this float[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<float, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this float[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<float, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this float[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<float, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this float[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<float, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this float[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Object)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this float[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Object)value[i, j];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this float[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Object)value[i, j, k];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this float[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Object)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this float[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this float[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Object)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this float[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this float[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this float[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<float, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this float[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<float, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this float[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<float, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this float[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<float, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this float[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this float[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this float[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this float[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this float[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this float[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this float[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this float[] value)
|
|
{
|
|
return ToComplex(value, new Complex[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this float[,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<float, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this float[,,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<float, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this float[][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<float, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this float[][][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<float, Complex>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a single-precision floating point array to a 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this float[] value, Complex[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Complex)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this float[,] value, Complex[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this float[,,] value, Complex[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (float* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional single-precision floating point array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this float[,] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Complex)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this float[][] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this float[][][] value, Complex[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Complex)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged single-precision floating point array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this float[][] value, Complex[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this double[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this double[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<double, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this double[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<double, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this double[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<double, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this double[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<double, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this double[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int32)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this double[,] value, int[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this double[,,] value, int[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this double[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int32)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this double[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this double[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int32)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this double[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this double[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this double[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<double, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this double[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<double, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this double[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<double, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this double[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<double, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this double[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int16)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this double[,] value, short[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this double[,,] value, short[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this double[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int16)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this double[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this double[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int16)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this double[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this double[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this double[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<double, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this double[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<double, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this double[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<double, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this double[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<double, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this double[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Single)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this double[,] value, float[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this double[,,] value, float[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this double[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Single)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this double[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this double[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Single)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this double[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this double[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this double[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<double, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this double[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<double, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this double[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<double, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this double[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<double, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this double[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int64)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this double[,] value, long[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this double[,,] value, long[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this double[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int64)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this double[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this double[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int64)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this double[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this double[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this double[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<double, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this double[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<double, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this double[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<double, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this double[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<double, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this double[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Byte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this double[,] value, byte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this double[,,] value, byte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this double[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Byte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this double[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this double[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Byte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this double[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this double[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this double[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<double, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this double[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<double, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this double[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<double, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this double[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<double, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this double[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (SByte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this double[,] value, sbyte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this double[,,] value, sbyte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this double[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (SByte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this double[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this double[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (SByte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this double[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this double[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this double[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<double, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this double[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<double, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this double[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<double, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this double[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<double, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this double[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Decimal)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this double[,] value, decimal[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this double[,,] value, decimal[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this double[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this double[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this double[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Decimal)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this double[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this double[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this double[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<double, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this double[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<double, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this double[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<double, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this double[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<double, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this double[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this double[,] value, bool[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this double[,,] value, bool[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this double[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this double[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this double[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this double[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this double[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this double[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<double, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this double[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<double, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this double[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<double, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this double[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<double, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this double[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Object)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this double[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Object)value[i, j];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this double[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Object)value[i, j, k];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this double[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Object)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this double[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this double[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Object)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this double[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this double[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this double[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<double, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this double[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<double, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this double[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<double, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this double[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<double, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this double[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this double[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this double[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this double[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this double[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this double[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this double[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this double[] value)
|
|
{
|
|
return ToComplex(value, new Complex[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this double[,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<double, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this double[,,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<double, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this double[][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<double, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this double[][][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<double, Complex>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a double-precision floating point array to a 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this double[] value, Complex[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Complex)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this double[,] value, Complex[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this double[,,] value, Complex[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (double* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional double-precision floating point array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this double[,] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Complex)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this double[][] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this double[][][] value, Complex[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Complex)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged double-precision floating point array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this double[][] value, Complex[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this long[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this long[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<long, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this long[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<long, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this long[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<long, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this long[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<long, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this long[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int32)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this long[,] value, int[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this long[,,] value, int[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this long[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int32)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this long[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this long[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int32)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this long[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this long[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this long[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<long, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this long[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<long, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this long[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<long, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this long[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<long, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this long[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int16)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this long[,] value, short[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this long[,,] value, short[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this long[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int16)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this long[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this long[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int16)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this long[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this long[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this long[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<long, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this long[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<long, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this long[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<long, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this long[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<long, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this long[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Single)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this long[,] value, float[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this long[,,] value, float[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this long[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Single)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this long[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this long[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Single)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this long[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this long[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this long[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<long, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this long[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<long, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this long[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<long, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this long[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<long, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this long[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Double)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this long[,] value, double[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this long[,,] value, double[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this long[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Double)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this long[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this long[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Double)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this long[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this long[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this long[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<long, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this long[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<long, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this long[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<long, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this long[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<long, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this long[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Byte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this long[,] value, byte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this long[,,] value, byte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this long[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Byte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this long[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this long[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Byte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this long[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this long[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this long[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<long, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this long[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<long, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this long[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<long, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this long[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<long, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this long[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (SByte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this long[,] value, sbyte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this long[,,] value, sbyte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this long[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (SByte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this long[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this long[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (SByte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this long[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this long[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this long[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<long, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this long[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<long, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this long[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<long, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this long[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<long, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this long[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Decimal)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this long[,] value, decimal[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this long[,,] value, decimal[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this long[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this long[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this long[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Decimal)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this long[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this long[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this long[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<long, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this long[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<long, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this long[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<long, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this long[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<long, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this long[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this long[,] value, bool[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this long[,,] value, bool[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this long[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this long[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this long[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this long[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this long[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this long[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<long, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this long[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<long, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this long[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<long, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this long[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<long, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this long[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Object)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this long[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Object)value[i, j];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this long[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Object)value[i, j, k];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this long[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Object)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this long[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this long[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Object)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this long[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this long[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this long[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<long, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this long[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<long, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this long[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<long, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this long[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<long, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this long[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this long[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this long[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this long[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this long[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this long[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this long[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a long integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this long[] value)
|
|
{
|
|
return ToComplex(value, new Complex[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this long[,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<long, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this long[,,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<long, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this long[][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<long, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a long integer to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this long[][][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<long, Complex>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a long integer array to a 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this long[] value, Complex[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Complex)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this long[,] value, Complex[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this long[,,] value, Complex[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (long* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional long integer array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this long[,] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Complex)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this long[][] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this long[][][] value, Complex[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Complex)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged long integer array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this long[][] value, Complex[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this byte[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this byte[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<byte, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this byte[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<byte, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this byte[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<byte, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this byte[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<byte, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this byte[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int32)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this byte[,] value, int[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this byte[,,] value, int[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this byte[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int32)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this byte[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this byte[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int32)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this byte[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this byte[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this byte[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<byte, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this byte[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<byte, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this byte[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<byte, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this byte[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<byte, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this byte[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int16)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this byte[,] value, short[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this byte[,,] value, short[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this byte[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int16)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this byte[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this byte[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int16)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this byte[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this byte[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this byte[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<byte, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this byte[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<byte, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this byte[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<byte, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this byte[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<byte, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this byte[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Single)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this byte[,] value, float[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this byte[,,] value, float[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this byte[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Single)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this byte[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this byte[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Single)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this byte[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this byte[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this byte[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<byte, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this byte[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<byte, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this byte[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<byte, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this byte[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<byte, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this byte[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Double)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this byte[,] value, double[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this byte[,,] value, double[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this byte[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Double)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this byte[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this byte[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Double)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this byte[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this byte[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this byte[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<byte, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this byte[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<byte, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this byte[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<byte, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this byte[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<byte, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this byte[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int64)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this byte[,] value, long[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this byte[,,] value, long[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this byte[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int64)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this byte[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this byte[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int64)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this byte[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this byte[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this byte[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<byte, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this byte[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<byte, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this byte[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<byte, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this byte[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<byte, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this byte[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (SByte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this byte[,] value, sbyte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this byte[,,] value, sbyte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this byte[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (SByte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this byte[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this byte[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (SByte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this byte[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this byte[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this byte[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<byte, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this byte[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<byte, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this byte[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<byte, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this byte[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<byte, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this byte[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Decimal)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this byte[,] value, decimal[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this byte[,,] value, decimal[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this byte[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this byte[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this byte[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Decimal)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this byte[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this byte[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this byte[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<byte, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this byte[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<byte, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this byte[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<byte, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this byte[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<byte, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this byte[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this byte[,] value, bool[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this byte[,,] value, bool[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this byte[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this byte[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this byte[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this byte[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this byte[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this byte[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<byte, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this byte[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<byte, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this byte[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<byte, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this byte[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<byte, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this byte[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Object)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this byte[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Object)value[i, j];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this byte[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Object)value[i, j, k];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this byte[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Object)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this byte[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this byte[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Object)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this byte[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this byte[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this byte[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<byte, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this byte[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<byte, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this byte[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<byte, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this byte[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<byte, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this byte[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this byte[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this byte[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this byte[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this byte[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this byte[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this byte[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this byte[] value)
|
|
{
|
|
return ToComplex(value, new Complex[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this byte[,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<byte, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this byte[,,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<byte, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this byte[][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<byte, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this byte[][][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<byte, Complex>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 8-bit byte array to a 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this byte[] value, Complex[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Complex)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this byte[,] value, Complex[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this byte[,,] value, Complex[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 8-bit byte array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this byte[,] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Complex)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this byte[][] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this byte[][][] value, Complex[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Complex)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 8-bit byte array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this byte[][] value, Complex[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this sbyte[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this sbyte[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<sbyte, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this sbyte[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<sbyte, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this sbyte[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<sbyte, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this sbyte[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<sbyte, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this sbyte[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int32)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this sbyte[,] value, int[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this sbyte[,,] value, int[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this sbyte[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int32)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this sbyte[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this sbyte[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int32)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this sbyte[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this sbyte[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this sbyte[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<sbyte, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this sbyte[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<sbyte, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this sbyte[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<sbyte, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this sbyte[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<sbyte, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this sbyte[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int16)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this sbyte[,] value, short[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this sbyte[,,] value, short[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this sbyte[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int16)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this sbyte[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this sbyte[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int16)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this sbyte[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this sbyte[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this sbyte[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<sbyte, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this sbyte[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<sbyte, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this sbyte[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<sbyte, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this sbyte[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<sbyte, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this sbyte[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Single)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this sbyte[,] value, float[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this sbyte[,,] value, float[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this sbyte[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Single)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this sbyte[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this sbyte[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Single)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this sbyte[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this sbyte[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this sbyte[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<sbyte, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this sbyte[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<sbyte, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this sbyte[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<sbyte, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this sbyte[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<sbyte, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this sbyte[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Double)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this sbyte[,] value, double[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this sbyte[,,] value, double[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this sbyte[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Double)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this sbyte[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this sbyte[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Double)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this sbyte[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this sbyte[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this sbyte[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<sbyte, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this sbyte[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<sbyte, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this sbyte[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<sbyte, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this sbyte[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<sbyte, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this sbyte[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int64)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this sbyte[,] value, long[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this sbyte[,,] value, long[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this sbyte[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int64)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this sbyte[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this sbyte[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int64)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this sbyte[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this sbyte[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this sbyte[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<sbyte, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this sbyte[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<sbyte, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this sbyte[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<sbyte, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this sbyte[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<sbyte, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this sbyte[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Byte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this sbyte[,] value, byte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this sbyte[,,] value, byte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this sbyte[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Byte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this sbyte[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this sbyte[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Byte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this sbyte[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this sbyte[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this sbyte[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<sbyte, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this sbyte[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<sbyte, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this sbyte[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<sbyte, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this sbyte[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<sbyte, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this sbyte[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Decimal)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this sbyte[,] value, decimal[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this sbyte[,,] value, decimal[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this sbyte[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this sbyte[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this sbyte[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Decimal)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this sbyte[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Decimal)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this sbyte[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this sbyte[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<sbyte, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this sbyte[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<sbyte, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this sbyte[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<sbyte, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this sbyte[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<sbyte, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this sbyte[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this sbyte[,] value, bool[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this sbyte[,,] value, bool[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this sbyte[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this sbyte[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this sbyte[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this sbyte[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this sbyte[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this sbyte[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<sbyte, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this sbyte[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<sbyte, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this sbyte[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<sbyte, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this sbyte[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<sbyte, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this sbyte[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Object)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this sbyte[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Object)value[i, j];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this sbyte[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Object)value[i, j, k];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this sbyte[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Object)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this sbyte[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this sbyte[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Object)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this sbyte[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this sbyte[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this sbyte[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<sbyte, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this sbyte[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<sbyte, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this sbyte[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<sbyte, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this sbyte[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<sbyte, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this sbyte[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this sbyte[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this sbyte[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this sbyte[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this sbyte[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this sbyte[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this sbyte[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this sbyte[] value)
|
|
{
|
|
return ToComplex(value, new Complex[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this sbyte[,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<sbyte, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this sbyte[,,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<sbyte, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this sbyte[][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<sbyte, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this sbyte[][][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<sbyte, Complex>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a signed 7-bit byte array to a 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this sbyte[] value, Complex[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Complex)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this sbyte[,] value, Complex[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this sbyte[,,] value, Complex[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (sbyte* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional signed 7-bit byte array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this sbyte[,] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Complex)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this sbyte[][] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this sbyte[][][] value, Complex[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Complex)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged signed 7-bit byte array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this sbyte[][] value, Complex[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this decimal[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this decimal[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<decimal, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this decimal[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<decimal, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this decimal[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<decimal, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this decimal[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<decimal, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this decimal[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int32)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this decimal[,] value, int[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this decimal[,,] value, int[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this decimal[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int32)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this decimal[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this decimal[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int32)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this decimal[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int32)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this decimal[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this decimal[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<decimal, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this decimal[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<decimal, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this decimal[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<decimal, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this decimal[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<decimal, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this decimal[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int16)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this decimal[,] value, short[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this decimal[,,] value, short[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this decimal[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int16)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this decimal[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this decimal[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int16)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this decimal[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int16)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this decimal[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this decimal[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<decimal, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this decimal[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<decimal, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this decimal[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<decimal, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this decimal[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<decimal, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this decimal[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Single)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this decimal[,] value, float[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this decimal[,,] value, float[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this decimal[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Single)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this decimal[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this decimal[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Single)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this decimal[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Single)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this decimal[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this decimal[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<decimal, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this decimal[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<decimal, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this decimal[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<decimal, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this decimal[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<decimal, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this decimal[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Double)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this decimal[,] value, double[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this decimal[,,] value, double[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this decimal[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Double)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this decimal[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this decimal[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Double)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this decimal[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Double)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this decimal[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this decimal[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<decimal, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this decimal[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<decimal, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this decimal[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<decimal, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this decimal[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<decimal, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this decimal[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int64)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this decimal[,] value, long[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this decimal[,,] value, long[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this decimal[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int64)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this decimal[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this decimal[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int64)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this decimal[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int64)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this decimal[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this decimal[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<decimal, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this decimal[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<decimal, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this decimal[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<decimal, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this decimal[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<decimal, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this decimal[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Byte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this decimal[,] value, byte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this decimal[,,] value, byte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this decimal[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Byte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this decimal[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this decimal[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Byte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this decimal[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Byte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this decimal[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this decimal[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<decimal, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this decimal[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<decimal, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this decimal[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<decimal, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this decimal[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<decimal, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this decimal[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (SByte)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this decimal[,] value, sbyte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this decimal[,,] value, sbyte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this decimal[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (SByte)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this decimal[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this decimal[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (SByte)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this decimal[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (SByte)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this decimal[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this decimal[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<decimal, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this decimal[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<decimal, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this decimal[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<decimal, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this decimal[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<decimal, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this decimal[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this decimal[,] value, bool[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this decimal[,,] value, bool[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this decimal[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this decimal[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this decimal[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this decimal[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] != 0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this decimal[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this decimal[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<decimal, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this decimal[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<decimal, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this decimal[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<decimal, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this decimal[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<decimal, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this decimal[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Object)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this decimal[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Object)value[i, j];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this decimal[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Object)value[i, j, k];
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this decimal[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Object)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this decimal[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this decimal[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Object)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this decimal[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Object)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this decimal[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this decimal[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<decimal, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this decimal[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<decimal, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this decimal[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<decimal, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this decimal[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<decimal, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this decimal[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this decimal[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this decimal[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this decimal[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this decimal[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this decimal[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this decimal[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this decimal[] value)
|
|
{
|
|
return ToComplex(value, new Complex[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this decimal[,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<decimal, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this decimal[,,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<decimal, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this decimal[][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<decimal, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this decimal[][][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<decimal, Complex>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a decimal fixed-point array to a 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this decimal[] value, Complex[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Complex)value[i];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this decimal[,] value, Complex[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this decimal[,,] value, Complex[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (decimal* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Complex)src[i];
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional decimal fixed-point array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this decimal[,] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Complex)value[i, j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this decimal[][] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this decimal[][][] value, Complex[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Complex)value[i][j][k];
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged decimal fixed-point array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this decimal[][] value, Complex[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Complex)value[i][j];
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this bool[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this bool[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<bool, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this bool[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<bool, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this bool[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<bool, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this bool[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<bool, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this bool[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] ? (Int32)1 : (Int32)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this bool[,] value, int[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Int32)1 : (Int32)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this bool[,,] value, int[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Int32)1 : (Int32)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this bool[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] ? (Int32)1 : (Int32)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this bool[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] ? (Int32)1 : (Int32)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this bool[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] ? (Int32)1 : (Int32)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this bool[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] ? (Int32)1 : (Int32)0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this bool[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this bool[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<bool, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this bool[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<bool, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this bool[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<bool, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this bool[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<bool, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this bool[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] ? (Int16)1 : (Int16)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this bool[,] value, short[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Int16)1 : (Int16)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this bool[,,] value, short[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Int16)1 : (Int16)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this bool[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] ? (Int16)1 : (Int16)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this bool[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] ? (Int16)1 : (Int16)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this bool[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] ? (Int16)1 : (Int16)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this bool[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] ? (Int16)1 : (Int16)0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this bool[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this bool[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<bool, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this bool[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<bool, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this bool[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<bool, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this bool[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<bool, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this bool[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] ? (Single)1 : (Single)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this bool[,] value, float[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Single)1 : (Single)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this bool[,,] value, float[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Single)1 : (Single)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this bool[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] ? (Single)1 : (Single)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this bool[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] ? (Single)1 : (Single)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this bool[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] ? (Single)1 : (Single)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this bool[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] ? (Single)1 : (Single)0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this bool[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this bool[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<bool, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this bool[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<bool, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this bool[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<bool, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this bool[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<bool, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this bool[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] ? (Double)1 : (Double)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this bool[,] value, double[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Double)1 : (Double)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this bool[,,] value, double[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Double)1 : (Double)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this bool[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] ? (Double)1 : (Double)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this bool[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] ? (Double)1 : (Double)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this bool[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] ? (Double)1 : (Double)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this bool[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] ? (Double)1 : (Double)0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this bool[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this bool[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<bool, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this bool[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<bool, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this bool[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<bool, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this bool[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<bool, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this bool[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] ? (Int64)1 : (Int64)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this bool[,] value, long[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Int64)1 : (Int64)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this bool[,,] value, long[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Int64)1 : (Int64)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this bool[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] ? (Int64)1 : (Int64)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this bool[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] ? (Int64)1 : (Int64)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this bool[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] ? (Int64)1 : (Int64)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this bool[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] ? (Int64)1 : (Int64)0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this bool[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this bool[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<bool, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this bool[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<bool, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this bool[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<bool, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this bool[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<bool, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this bool[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] ? (Byte)1 : (Byte)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this bool[,] value, byte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Byte)1 : (Byte)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this bool[,,] value, byte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Byte)1 : (Byte)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this bool[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] ? (Byte)1 : (Byte)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this bool[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] ? (Byte)1 : (Byte)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this bool[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] ? (Byte)1 : (Byte)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this bool[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] ? (Byte)1 : (Byte)0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this bool[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this bool[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<bool, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this bool[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<bool, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this bool[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<bool, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this bool[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<bool, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this bool[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] ? (SByte)1 : (SByte)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this bool[,] value, sbyte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (SByte)1 : (SByte)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this bool[,,] value, sbyte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (SByte)1 : (SByte)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this bool[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] ? (SByte)1 : (SByte)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this bool[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] ? (SByte)1 : (SByte)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this bool[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] ? (SByte)1 : (SByte)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this bool[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] ? (SByte)1 : (SByte)0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this bool[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this bool[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<bool, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this bool[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<bool, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this bool[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<bool, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this bool[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<bool, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this bool[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] ? (Decimal)1 : (Decimal)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this bool[,] value, decimal[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Decimal)1 : (Decimal)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this bool[,,] value, decimal[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Decimal)1 : (Decimal)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this bool[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] ? (Decimal)1 : (Decimal)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this bool[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] ? (Decimal)1 : (Decimal)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this bool[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] ? (Decimal)1 : (Decimal)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this bool[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] ? (Decimal)1 : (Decimal)0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this bool[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this bool[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<bool, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this bool[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<bool, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this bool[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<bool, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this bool[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<bool, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this bool[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] ? (Object)1 : (Object)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this bool[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j] ? (Object)1 : (Object)0;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this bool[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k] ? (Object)1 : (Object)0;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this bool[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] ? (Object)1 : (Object)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this bool[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] ? (Object)1 : (Object)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this bool[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] ? (Object)1 : (Object)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this bool[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] ? (Object)1 : (Object)0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this bool[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this bool[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<bool, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this bool[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<bool, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this bool[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<bool, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this bool[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<bool, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this bool[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this bool[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this bool[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this bool[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this bool[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this bool[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this bool[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a boolean to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this bool[] value)
|
|
{
|
|
return ToComplex(value, new Complex[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this bool[,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<bool, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this bool[,,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<bool, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this bool[][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<bool, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a boolean to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this bool[][][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<bool, Complex>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a boolean array to a 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this bool[] value, Complex[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i] ? (Complex)1 : (Complex)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this bool[,] value, Complex[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Complex)1 : (Complex)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this bool[,,] value, Complex[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (bool* src = value)
|
|
fixed (Complex* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i] ? (Complex)1 : (Complex)0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional boolean array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this bool[,] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j] ? (Complex)1 : (Complex)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this bool[][] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j] ? (Complex)1 : (Complex)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this bool[][][] value, Complex[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k] ? (Complex)1 : (Complex)0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged boolean array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this bool[][] value, Complex[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j] ? (Complex)1 : (Complex)0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this object[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this object[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<object, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this object[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<object, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this object[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<object, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this object[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<object, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this object[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int32)System.Convert.ChangeType(value[i], typeof(Int32));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this object[,] value, int[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Int32)System.Convert.ChangeType(value[i, j], typeof(Int32));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this object[,,] value, int[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Int32)System.Convert.ChangeType(value[i, j, k], typeof(Int32));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this object[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int32)System.Convert.ChangeType(value[i, j], typeof(Int32));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this object[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int32)System.Convert.ChangeType(value[i][j], typeof(Int32));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this object[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int32)System.Convert.ChangeType(value[i][j][k], typeof(Int32));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this object[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int32)System.Convert.ChangeType(value[i][j], typeof(Int32));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this object[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this object[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<object, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this object[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<object, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this object[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<object, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this object[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<object, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this object[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int16)System.Convert.ChangeType(value[i], typeof(Int16));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this object[,] value, short[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Int16)System.Convert.ChangeType(value[i, j], typeof(Int16));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this object[,,] value, short[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Int16)System.Convert.ChangeType(value[i, j, k], typeof(Int16));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this object[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int16)System.Convert.ChangeType(value[i, j], typeof(Int16));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this object[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int16)System.Convert.ChangeType(value[i][j], typeof(Int16));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this object[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int16)System.Convert.ChangeType(value[i][j][k], typeof(Int16));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this object[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int16)System.Convert.ChangeType(value[i][j], typeof(Int16));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this object[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this object[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<object, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this object[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<object, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this object[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<object, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this object[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<object, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this object[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Single)System.Convert.ChangeType(value[i], typeof(Single));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this object[,] value, float[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Single)System.Convert.ChangeType(value[i, j], typeof(Single));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this object[,,] value, float[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Single)System.Convert.ChangeType(value[i, j, k], typeof(Single));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this object[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Single)System.Convert.ChangeType(value[i, j], typeof(Single));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this object[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Single)System.Convert.ChangeType(value[i][j], typeof(Single));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this object[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Single)System.Convert.ChangeType(value[i][j][k], typeof(Single));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this object[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Single)System.Convert.ChangeType(value[i][j], typeof(Single));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this object[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this object[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<object, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this object[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<object, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this object[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<object, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this object[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<object, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this object[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Double)System.Convert.ChangeType(value[i], typeof(Double));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this object[,] value, double[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Double)System.Convert.ChangeType(value[i, j], typeof(Double));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this object[,,] value, double[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Double)System.Convert.ChangeType(value[i, j, k], typeof(Double));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this object[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Double)System.Convert.ChangeType(value[i, j], typeof(Double));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this object[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Double)System.Convert.ChangeType(value[i][j], typeof(Double));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this object[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Double)System.Convert.ChangeType(value[i][j][k], typeof(Double));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this object[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Double)System.Convert.ChangeType(value[i][j], typeof(Double));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this object[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this object[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<object, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this object[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<object, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this object[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<object, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this object[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<object, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this object[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int64)System.Convert.ChangeType(value[i], typeof(Int64));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this object[,] value, long[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Int64)System.Convert.ChangeType(value[i, j], typeof(Int64));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this object[,,] value, long[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Int64)System.Convert.ChangeType(value[i, j, k], typeof(Int64));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this object[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int64)System.Convert.ChangeType(value[i, j], typeof(Int64));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this object[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int64)System.Convert.ChangeType(value[i][j], typeof(Int64));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this object[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int64)System.Convert.ChangeType(value[i][j][k], typeof(Int64));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this object[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int64)System.Convert.ChangeType(value[i][j], typeof(Int64));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this object[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this object[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<object, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this object[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<object, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this object[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<object, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this object[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<object, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this object[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Byte)System.Convert.ChangeType(value[i], typeof(Byte));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this object[,] value, byte[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Byte)System.Convert.ChangeType(value[i, j], typeof(Byte));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this object[,,] value, byte[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Byte)System.Convert.ChangeType(value[i, j, k], typeof(Byte));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this object[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Byte)System.Convert.ChangeType(value[i, j], typeof(Byte));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this object[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Byte)System.Convert.ChangeType(value[i][j], typeof(Byte));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this object[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Byte)System.Convert.ChangeType(value[i][j][k], typeof(Byte));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this object[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Byte)System.Convert.ChangeType(value[i][j], typeof(Byte));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this object[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this object[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<object, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this object[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<object, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this object[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<object, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this object[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<object, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this object[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (SByte)System.Convert.ChangeType(value[i], typeof(SByte));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this object[,] value, sbyte[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (SByte)System.Convert.ChangeType(value[i, j], typeof(SByte));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this object[,,] value, sbyte[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (SByte)System.Convert.ChangeType(value[i, j, k], typeof(SByte));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this object[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (SByte)System.Convert.ChangeType(value[i, j], typeof(SByte));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this object[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (SByte)System.Convert.ChangeType(value[i][j], typeof(SByte));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this object[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (SByte)System.Convert.ChangeType(value[i][j][k], typeof(SByte));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this object[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (SByte)System.Convert.ChangeType(value[i][j], typeof(SByte));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this object[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this object[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<object, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this object[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<object, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this object[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<object, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this object[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<object, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this object[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Decimal)System.Convert.ChangeType(value[i], typeof(Decimal));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this object[,] value, decimal[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Decimal)System.Convert.ChangeType(value[i, j], typeof(Decimal));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this object[,,] value, decimal[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Decimal)System.Convert.ChangeType(value[i, j, k], typeof(Decimal));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this object[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Decimal)System.Convert.ChangeType(value[i, j], typeof(Decimal));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this object[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Decimal)System.Convert.ChangeType(value[i][j], typeof(Decimal));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this object[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Decimal)System.Convert.ChangeType(value[i][j][k], typeof(Decimal));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this object[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Decimal)System.Convert.ChangeType(value[i][j], typeof(Decimal));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this object[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this object[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<object, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this object[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<object, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this object[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<object, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this object[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<object, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this object[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Boolean)System.Convert.ChangeType(value[i], typeof(Boolean));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this object[,] value, bool[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Boolean)System.Convert.ChangeType(value[i, j], typeof(Boolean));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this object[,,] value, bool[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Boolean)System.Convert.ChangeType(value[i, j, k], typeof(Boolean));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this object[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Boolean)System.Convert.ChangeType(value[i, j], typeof(Boolean));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this object[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Boolean)System.Convert.ChangeType(value[i][j], typeof(Boolean));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this object[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Boolean)System.Convert.ChangeType(value[i][j][k], typeof(Boolean));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this object[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Boolean)System.Convert.ChangeType(value[i][j], typeof(Boolean));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this object[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this object[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<object, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this object[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<object, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this object[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<object, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this object[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<object, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this object[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (String)System.Convert.ChangeType(value[i], typeof(String));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this object[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (String)System.Convert.ChangeType(value[i, j], typeof(String));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this object[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (String)System.Convert.ChangeType(value[i, j, k], typeof(String));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this object[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (String)System.Convert.ChangeType(value[i, j], typeof(String));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this object[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (String)System.Convert.ChangeType(value[i][j], typeof(String));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this object[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (String)System.Convert.ChangeType(value[i][j][k], typeof(String));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this object[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (String)System.Convert.ChangeType(value[i][j], typeof(String));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a object to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this object[] value)
|
|
{
|
|
return ToComplex(value, new Complex[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this object[,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<object, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this object[,,] value)
|
|
{
|
|
return ToComplex(value, Matrix.CreateAs<object, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this object[][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<object, Complex>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a object to a 128-bit complex.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this object[][][] value)
|
|
{
|
|
return ToComplex(value, Jagged.CreateAs<object, Complex>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a object array to a 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[] ToComplex(this object[] value, Complex[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Complex)System.Convert.ChangeType(value[i], typeof(Complex));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this object[,] value, Complex[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Complex)System.Convert.ChangeType(value[i, j], typeof(Complex));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,,] ToComplex(this object[,,] value, Complex[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Complex)System.Convert.ChangeType(value[i, j, k], typeof(Complex));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional object array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this object[,] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Complex)System.Convert.ChangeType(value[i, j], typeof(Complex));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][] ToComplex(this object[][] value, Complex[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Complex)System.Convert.ChangeType(value[i][j], typeof(Complex));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a jagged 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[][][] ToComplex(this object[][][] value, Complex[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Complex)System.Convert.ChangeType(value[i][j][k], typeof(Complex));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged object array to a multidimensional 128-bit complex array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static Complex[,] ToComplex(this object[][] value, Complex[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Complex)System.Convert.ChangeType(value[i][j], typeof(Complex));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a string to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this string[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this string[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<string, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this string[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<string, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this string[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<string, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this string[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<string, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a string array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this string[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = Int32.Parse(value[i]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this string[,] value, int[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = Int32.Parse(value[i, j]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this string[,,] value, int[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = Int32.Parse(value[i, j, k]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this string[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = Int32.Parse(value[i, j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this string[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = Int32.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this string[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = Int32.Parse(value[i][j][k]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this string[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = Int32.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a string to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this string[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this string[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<string, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this string[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<string, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this string[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<string, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this string[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<string, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a string array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this string[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = Int16.Parse(value[i]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this string[,] value, short[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = Int16.Parse(value[i, j]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this string[,,] value, short[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = Int16.Parse(value[i, j, k]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this string[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = Int16.Parse(value[i, j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this string[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = Int16.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this string[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = Int16.Parse(value[i][j][k]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this string[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = Int16.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a string to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this string[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this string[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<string, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this string[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<string, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this string[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<string, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this string[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<string, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a string array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this string[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = Single.Parse(value[i]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this string[,] value, float[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = Single.Parse(value[i, j]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this string[,,] value, float[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = Single.Parse(value[i, j, k]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this string[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = Single.Parse(value[i, j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this string[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = Single.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this string[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = Single.Parse(value[i][j][k]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this string[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = Single.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a string to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this string[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this string[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<string, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this string[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<string, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this string[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<string, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this string[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<string, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a string array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this string[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = Double.Parse(value[i]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this string[,] value, double[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = Double.Parse(value[i, j]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this string[,,] value, double[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = Double.Parse(value[i, j, k]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this string[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = Double.Parse(value[i, j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this string[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = Double.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this string[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = Double.Parse(value[i][j][k]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this string[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = Double.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a string to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this string[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this string[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<string, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this string[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<string, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this string[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<string, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this string[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<string, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a string array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this string[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = Int64.Parse(value[i]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this string[,] value, long[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = Int64.Parse(value[i, j]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this string[,,] value, long[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = Int64.Parse(value[i, j, k]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this string[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = Int64.Parse(value[i, j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this string[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = Int64.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this string[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = Int64.Parse(value[i][j][k]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this string[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = Int64.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a string to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this string[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this string[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<string, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this string[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<string, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this string[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<string, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this string[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<string, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a string array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this string[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = Byte.Parse(value[i]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this string[,] value, byte[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = Byte.Parse(value[i, j]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this string[,,] value, byte[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = Byte.Parse(value[i, j, k]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this string[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = Byte.Parse(value[i, j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this string[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = Byte.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this string[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = Byte.Parse(value[i][j][k]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this string[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = Byte.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a string to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this string[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this string[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<string, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this string[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<string, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this string[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<string, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this string[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<string, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a string array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this string[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = SByte.Parse(value[i]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this string[,] value, sbyte[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = SByte.Parse(value[i, j]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this string[,,] value, sbyte[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = SByte.Parse(value[i, j, k]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this string[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = SByte.Parse(value[i, j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this string[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = SByte.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this string[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = SByte.Parse(value[i][j][k]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this string[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = SByte.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a string to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this string[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this string[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<string, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this string[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<string, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this string[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<string, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this string[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<string, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a string array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this string[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = Decimal.Parse(value[i]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this string[,] value, decimal[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = Decimal.Parse(value[i, j]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this string[,,] value, decimal[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = Decimal.Parse(value[i, j, k]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this string[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = Decimal.Parse(value[i, j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this string[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = Decimal.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this string[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = Decimal.Parse(value[i][j][k]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this string[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = Decimal.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a string to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this string[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this string[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<string, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this string[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<string, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this string[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<string, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this string[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<string, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a string array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this string[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = Boolean.Parse(value[i]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this string[,] value, bool[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = Boolean.Parse(value[i, j]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this string[,,] value, bool[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = Boolean.Parse(value[i, j, k]);;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this string[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = Boolean.Parse(value[i, j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this string[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = Boolean.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this string[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = Boolean.Parse(value[i][j][k]);;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this string[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = Boolean.Parse(value[i][j]);;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a string to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this string[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this string[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<string, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this string[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<string, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this string[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<string, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a string to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this string[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<string, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a string array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this string[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Object)System.Convert.ChangeType(value[i], typeof(Object));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this string[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Object)System.Convert.ChangeType(value[i, j], typeof(Object));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this string[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Object)System.Convert.ChangeType(value[i, j, k], typeof(Object));
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional string array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this string[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Object)System.Convert.ChangeType(value[i, j], typeof(Object));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this string[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Object)System.Convert.ChangeType(value[i][j], typeof(Object));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this string[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Object)System.Convert.ChangeType(value[i][j][k], typeof(Object));
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged string array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this string[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Object)System.Convert.ChangeType(value[i][j], typeof(Object));
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this Complex[] value)
|
|
{
|
|
return ToInt32(value, new int[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this Complex[,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<Complex, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this Complex[,,] value)
|
|
{
|
|
return ToInt32(value, Matrix.CreateAs<Complex, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this Complex[][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<Complex, int>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this Complex[][][] value)
|
|
{
|
|
return ToInt32(value, Jagged.CreateAs<Complex, int>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[] ToInt32(this Complex[] value, int[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int32)value[i].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this Complex[,] value, int[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,,] ToInt32(this Complex[,,] value, int[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (int* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int32)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this Complex[,] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int32)value[i, j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][] ToInt32(this Complex[][] value, int[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int32)value[i][j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[][][] ToInt32(this Complex[][][] value, int[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int32)value[i][j][k].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static int[,] ToInt32(this Complex[][] value, int[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int32)value[i][j].Real;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this Complex[] value)
|
|
{
|
|
return ToInt16(value, new short[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this Complex[,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<Complex, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this Complex[,,] value)
|
|
{
|
|
return ToInt16(value, Matrix.CreateAs<Complex, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this Complex[][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<Complex, short>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a short integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this Complex[][][] value)
|
|
{
|
|
return ToInt16(value, Jagged.CreateAs<Complex, short>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[] ToInt16(this Complex[] value, short[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int16)value[i].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this Complex[,] value, short[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,,] ToInt16(this Complex[,,] value, short[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (short* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int16)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this Complex[,] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int16)value[i, j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][] ToInt16(this Complex[][] value, short[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int16)value[i][j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[][][] ToInt16(this Complex[][][] value, short[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int16)value[i][j][k].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional short integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static short[,] ToInt16(this Complex[][] value, short[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int16)value[i][j].Real;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this Complex[] value)
|
|
{
|
|
return ToSingle(value, new float[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this Complex[,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<Complex, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this Complex[,,] value)
|
|
{
|
|
return ToSingle(value, Matrix.CreateAs<Complex, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this Complex[][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<Complex, float>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a single-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this Complex[][][] value)
|
|
{
|
|
return ToSingle(value, Jagged.CreateAs<Complex, float>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[] ToSingle(this Complex[] value, float[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Single)value[i].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this Complex[,] value, float[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,,] ToSingle(this Complex[,,] value, float[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (float* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Single)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this Complex[,] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Single)value[i, j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][] ToSingle(this Complex[][] value, float[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Single)value[i][j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[][][] ToSingle(this Complex[][][] value, float[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Single)value[i][j][k].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional single-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static float[,] ToSingle(this Complex[][] value, float[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Single)value[i][j].Real;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this Complex[] value)
|
|
{
|
|
return ToDouble(value, new double[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this Complex[,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<Complex, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this Complex[,,] value)
|
|
{
|
|
return ToDouble(value, Matrix.CreateAs<Complex, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this Complex[][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<Complex, double>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a double-precision floating point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this Complex[][][] value)
|
|
{
|
|
return ToDouble(value, Jagged.CreateAs<Complex, double>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[] ToDouble(this Complex[] value, double[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Double)value[i].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this Complex[,] value, double[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,,] ToDouble(this Complex[,,] value, double[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (double* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Double)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this Complex[,] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Double)value[i, j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][] ToDouble(this Complex[][] value, double[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Double)value[i][j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[][][] ToDouble(this Complex[][][] value, double[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Double)value[i][j][k].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional double-precision floating point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static double[,] ToDouble(this Complex[][] value, double[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Double)value[i][j].Real;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this Complex[] value)
|
|
{
|
|
return ToInt64(value, new long[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this Complex[,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<Complex, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this Complex[,,] value)
|
|
{
|
|
return ToInt64(value, Matrix.CreateAs<Complex, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this Complex[][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<Complex, long>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a long integer.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this Complex[][][] value)
|
|
{
|
|
return ToInt64(value, Jagged.CreateAs<Complex, long>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[] ToInt64(this Complex[] value, long[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Int64)value[i].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this Complex[,] value, long[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,,] ToInt64(this Complex[,,] value, long[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (long* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Int64)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this Complex[,] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Int64)value[i, j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][] ToInt64(this Complex[][] value, long[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Int64)value[i][j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[][][] ToInt64(this Complex[][][] value, long[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Int64)value[i][j][k].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional long integer array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static long[,] ToInt64(this Complex[][] value, long[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Int64)value[i][j].Real;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this Complex[] value)
|
|
{
|
|
return ToByte(value, new byte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this Complex[,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<Complex, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this Complex[,,] value)
|
|
{
|
|
return ToByte(value, Matrix.CreateAs<Complex, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this Complex[][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<Complex, byte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a 8-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this Complex[][][] value)
|
|
{
|
|
return ToByte(value, Jagged.CreateAs<Complex, byte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[] ToByte(this Complex[] value, byte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Byte)value[i].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this Complex[,] value, byte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,,] ToByte(this Complex[,,] value, byte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (byte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Byte)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this Complex[,] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Byte)value[i, j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][] ToByte(this Complex[][] value, byte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Byte)value[i][j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[][][] ToByte(this Complex[][][] value, byte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Byte)value[i][j][k].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional 8-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static byte[,] ToByte(this Complex[][] value, byte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Byte)value[i][j].Real;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this Complex[] value)
|
|
{
|
|
return ToSByte(value, new sbyte[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this Complex[,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<Complex, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this Complex[,,] value)
|
|
{
|
|
return ToSByte(value, Matrix.CreateAs<Complex, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this Complex[][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<Complex, sbyte>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a signed 7-bit byte.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this Complex[][][] value)
|
|
{
|
|
return ToSByte(value, Jagged.CreateAs<Complex, sbyte>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[] ToSByte(this Complex[] value, sbyte[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (SByte)value[i].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this Complex[,] value, sbyte[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,,] ToSByte(this Complex[,,] value, sbyte[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (sbyte* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (SByte)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this Complex[,] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (SByte)value[i, j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][] ToSByte(this Complex[][] value, sbyte[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (SByte)value[i][j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[][][] ToSByte(this Complex[][][] value, sbyte[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (SByte)value[i][j][k].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional signed 7-bit byte array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static sbyte[,] ToSByte(this Complex[][] value, sbyte[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (SByte)value[i][j].Real;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this Complex[] value)
|
|
{
|
|
return ToDecimal(value, new decimal[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this Complex[,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<Complex, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this Complex[,,] value)
|
|
{
|
|
return ToDecimal(value, Matrix.CreateAs<Complex, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this Complex[][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<Complex, decimal>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a decimal fixed-point.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this Complex[][][] value)
|
|
{
|
|
return ToDecimal(value, Jagged.CreateAs<Complex, decimal>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[] ToDecimal(this Complex[] value, decimal[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Decimal)value[i].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this Complex[,] value, decimal[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,,] ToDecimal(this Complex[,,] value, decimal[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (decimal* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = (Decimal)src[i].Real;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this Complex[,] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i, j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][] ToDecimal(this Complex[][] value, decimal[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Decimal)value[i][j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[][][] ToDecimal(this Complex[][][] value, decimal[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Decimal)value[i][j][k].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional decimal fixed-point array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static decimal[,] ToDecimal(this Complex[][] value, decimal[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Decimal)value[i][j].Real;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this Complex[] value)
|
|
{
|
|
return ToBoolean(value, new bool[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this Complex[,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<Complex, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this Complex[,,] value)
|
|
{
|
|
return ToBoolean(value, Matrix.CreateAs<Complex, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this Complex[][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<Complex, bool>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a boolean.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this Complex[][][] value)
|
|
{
|
|
return ToBoolean(value, Jagged.CreateAs<Complex, bool>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[] ToBoolean(this Complex[] value, bool[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].Real != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this Complex[,] value, bool[,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i].Real != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,,] ToBoolean(this Complex[,,] value, bool[,,] result)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (Complex* src = value)
|
|
fixed (bool* dst = result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
dst[i] = src[i].Real != 0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this Complex[,] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].Real != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][] ToBoolean(this Complex[][] value, bool[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].Real != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[][][] ToBoolean(this Complex[][][] value, bool[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].Real != 0;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional boolean array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static bool[,] ToBoolean(this Complex[][] value, bool[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].Real != 0;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this Complex[] value)
|
|
{
|
|
return ToObject(value, new object[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this Complex[,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<Complex, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this Complex[,,] value)
|
|
{
|
|
return ToObject(value, Matrix.CreateAs<Complex, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this Complex[][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<Complex, object>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a object.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this Complex[][][] value)
|
|
{
|
|
return ToObject(value, Jagged.CreateAs<Complex, object>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[] ToObject(this Complex[] value, object[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = (Object)value[i].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this Complex[,] value, object[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = (Object)value[i, j].Real;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,,] ToObject(this Complex[,,] value, object[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = (Object)value[i, j, k].Real;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this Complex[,] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = (Object)value[i, j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][] ToObject(this Complex[][] value, object[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = (Object)value[i][j].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[][][] ToObject(this Complex[][][] value, object[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = (Object)value[i][j][k].Real;
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional object array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static object[,] ToObject(this Complex[][] value, object[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = (Object)value[i][j].Real;
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this Complex[] value)
|
|
{
|
|
return ToString(value, new string[value.Length]);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this Complex[,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<Complex, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this Complex[,,] value)
|
|
{
|
|
return ToString(value, Matrix.CreateAs<Complex, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this Complex[][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<Complex, string>(value));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex to a string.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this Complex[][][] value)
|
|
{
|
|
return ToString(value, Jagged.CreateAs<Complex, string>(value));
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Converts a 128-bit complex array to a string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[] ToString(this Complex[] value, string[] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
result[i] = value[i].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this Complex[,] value, string[,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
result[i, j] = value[i, j].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,,] ToString(this Complex[,,] value, string[,,] result)
|
|
{
|
|
int r = value.GetLength(0);
|
|
int c = value.GetLength(1);
|
|
int d = value.GetLength(2);
|
|
for (int i = 0; i < r; i++)
|
|
for (int j = 0; j < c; j++)
|
|
for (int k = 0; k < d; k++)
|
|
result[i, j, k] = value[i, j, k].ToString();
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a multidimensional 128-bit complex array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this Complex[,] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < result.Length; i++)
|
|
for (int j = 0; j < result[i].Length; j++)
|
|
result[i][j] = value[i, j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][] ToString(this Complex[][] value, string[][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i][j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a jagged string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[][][] ToString(this Complex[][][] value, string[][][] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
for (int k = 0; k < value[i][j].Length; k++)
|
|
result[i][j][k] = value[i][j][k].ToString();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts a jagged 128-bit complex array to a multidimensional string array.
|
|
/// </summary>
|
|
///
|
|
#if NET45 || NET46 || NET462 || NETSTANDARD2_0
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
#endif
|
|
public static string[,] ToString(this Complex[][] value, string[,] result)
|
|
{
|
|
for (int i = 0; i < value.Length; i++)
|
|
for (int j = 0; j < value[i].Length; j++)
|
|
result[i, j] = value[i][j].ToString();
|
|
return result;
|
|
}
|
|
}
|
|
} |