Class BufferUtil
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
Methods
AllocNxM(Int32, Int32)
Declaration
public static double[][] AllocNxM(int N, int M)
Parameters
Returns
CompressZLib(Byte[], Boolean)
Compress a byte buffer using Deflate/ZLib compression.
Declaration
public static byte[] CompressZLib(byte[] buffer, bool bFast)
Parameters
Returns
CountValid<T>(T[], Func<T, Boolean>, Int32)
Count number of elements in array (or up to max_i) that pass FilterF test
Declaration
public static int CountValid<T>(T[] data, Func<T, bool> FilterF, int max_i = -1)
Parameters
Returns
Type Parameters
DecompressZLib(Byte[])
Decompress a byte buffer that has been compressed using Deflate/ZLib compression
Declaration
public static byte[] DecompressZLib(byte[] zBuffer)
Parameters
Type |
Name |
Description |
Byte[] |
zBuffer |
|
Returns
DistanceSquared(Double[], Double[])
Declaration
public static double DistanceSquared(double[] a, double[] b)
Parameters
Returns
Dot(Double[], Double[])
Declaration
public static double Dot(double[] a, double[] b)
Parameters
Returns
Filter<T>(T[], Func<T, Boolean>, Int32)
return a new array containing only elements (or up to max_i) that pass FilterF test
Declaration
public static T[] Filter<T>(T[] data, Func<T, bool> FilterF, int max_i = -1)
Parameters
Returns
Type Parameters
FilterInPlace<T>(T[], Func<T, Boolean>, Int32)
shifts elements of array (or up to max_i) that pass FilterF to front of list,
and returns number that passed
Declaration
public static int FilterInPlace<T>(T[] data, Func<T, bool> FilterF, int max_i = -1)
Parameters
Returns
Type Parameters
InitNxM(Int32, Int32, Double[][])
Declaration
public static double[][] InitNxM(int N, int M, double[][] init)
Parameters
Returns
MultiplyAdd(Double[], Double, Double[])
Declaration
public static void MultiplyAdd(double[] dest, double multiply, double[] add)
Parameters
MultiplyAdd(Double[], Double[], Double[])
Declaration
public static void MultiplyAdd(double[] dest, double[] multiply, double[] add)
Parameters
MultiplyAdd_GetSqrSum(Double[], Double, Double[])
Declaration
public static double MultiplyAdd_GetSqrSum(double[] dest, double multiply, double[] add)
Parameters
Returns
ParallelDot(Double[], Double[][], Double[][])
Declaration
public static void ParallelDot(double[] a, double[][] b, double[][] result)
Parameters
SetTriangle(Int32[], Int32, Int32, Int32, Int32)
Declaration
public static void SetTriangle(int[] v, int i, int a, int b, int c)
Parameters
SetVertex2(Double[], Int32, Double, Double)
Declaration
public static void SetVertex2(double[] v, int i, double x, double y)
Parameters
SetVertex2(Single[], Int32, Single, Single)
Declaration
public static void SetVertex2(float[] v, int i, float x, float y)
Parameters
SetVertex3(Double[], Int32, Double, Double, Double)
Declaration
public static void SetVertex3(double[] v, int i, double x, double y, double z)
Parameters
SetVertex3(Single[], Int32, Single, Single, Single)
Declaration
public static void SetVertex3(float[] v, int i, float x, float y, float z)
Parameters
ToBytes(Double[])
convert double array to bytes
Declaration
public static byte[] ToBytes(double[] array)
Parameters
Type |
Name |
Description |
Double[] |
array |
|
Returns
ToBytes(Int16[])
convert short array to bytes
Declaration
public static byte[] ToBytes(short[] array)
Parameters
Type |
Name |
Description |
Int16[] |
array |
|
Returns
ToBytes(Int32[])
convert int array to bytes
Declaration
public static byte[] ToBytes(int[] array)
Parameters
Type |
Name |
Description |
Int32[] |
array |
|
Returns
ToBytes(Single[])
convert float array to bytes
Declaration
public static byte[] ToBytes(float[] array)
Parameters
Type |
Name |
Description |
Single[] |
array |
|
Returns
ToDouble(Byte[])
convert byte array to double array
Declaration
public static double[] ToDouble(byte[] buffer)
Parameters
Type |
Name |
Description |
Byte[] |
buffer |
|
Returns
ToFloat(Byte[])
convert byte array to float array
Declaration
public static float[] ToFloat(byte[] buffer)
Parameters
Type |
Name |
Description |
Byte[] |
buffer |
|
Returns
ToIndex3i<T>(IEnumerable<T>)
convert input set into Index3i.
Supports packed list of int tuples, list of Vector3i/Index3i
Declaration
public static Index3i[] ToIndex3i<T>(IEnumerable<T> values)
Parameters
Returns
Type Parameters
ToIndexArray4i(Byte[])
convert byte array to IndexArray4i
Declaration
public static IndexArray4i ToIndexArray4i(byte[] buffer)
Parameters
Type |
Name |
Description |
Byte[] |
buffer |
|
Returns
ToInt(Byte[])
convert byte array to int array
Declaration
public static int[] ToInt(byte[] buffer)
Parameters
Type |
Name |
Description |
Byte[] |
buffer |
|
Returns
ToShort(Byte[])
convert byte array to short array
Declaration
public static short[] ToShort(byte[] buffer)
Parameters
Type |
Name |
Description |
Byte[] |
buffer |
|
Returns
ToVector3d<T>(IEnumerable<T>)
convert input set into Vector3d.
Supports packed list of float/double tuples, list of Vector3f/Vector3d
Declaration
public static Vector3d[] ToVector3d<T>(IEnumerable<T> values)
Parameters
Returns
Type Parameters
ToVector3f<T>(IEnumerable<T>)
convert input set into Vector3f.
Supports packed list of float/double tuples, list of Vector3f/Vector3d
Declaration
public static Vector3f[] ToVector3f<T>(IEnumerable<T> values)
Parameters
Returns
Type Parameters
ToVectorArray2f(Byte[])
convert byte array to VectorArray2f
Declaration
public static VectorArray2f ToVectorArray2f(byte[] buffer)
Parameters
Type |
Name |
Description |
Byte[] |
buffer |
|
Returns
ToVectorArray3d(Byte[])
convert byte array to VectorArray3d
Declaration
public static VectorArray3d ToVectorArray3d(byte[] buffer)
Parameters
Type |
Name |
Description |
Byte[] |
buffer |
|
Returns
ToVectorArray3f(Byte[])
convert byte array to VectorArray3f
Declaration
public static VectorArray3f ToVectorArray3f(byte[] buffer)
Parameters
Type |
Name |
Description |
Byte[] |
buffer |
|
Returns
ToVectorArray3i(Byte[])
convert byte array to VectorArray3i
Declaration
public static VectorArray3i ToVectorArray3i(byte[] buffer)
Parameters
Type |
Name |
Description |
Byte[] |
buffer |
|
Returns