Class NDArray
Inheritance
System.Object
NDArray
Implements
System.ICloneable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: NumSharp.Core.dll
Syntax
public class NDArray : ICloneable
Constructors
|
Improve this Doc
View Source
NDArray()
Default constructor
Create a 1D double array with 1 element
one element is 1
Declaration
|
Improve this Doc
View Source
NDArray(Array)
Constructor which takes .NET array
dtype and shape is determined from array
Declaration
public NDArray(Array values)
Parameters
| Type |
Name |
Description |
| System.Array |
values |
|
|
Improve this Doc
View Source
NDArray(Type)
Constructor for init data type
internal storage is 1D with 1 element
Declaration
public NDArray(Type dtype)
Parameters
| Type |
Name |
Description |
| System.Type |
dtype |
Data type of elements
|
|
Improve this Doc
View Source
NDArray(Type, IShape)
Constructor which initialize elements with 0
type and shape are given.
Declaration
public NDArray(Type dtype, IShape shape)
Parameters
| Type |
Name |
Description |
| System.Type |
dtype |
internal data type
|
| IShape |
shape |
Shape of NDArray
|
|
Improve this Doc
View Source
NDArray(Type, Int32[])
Constructor which initialize elements with 0
type and dimensions are given.
Declaration
public NDArray(Type dtype, params int[] shapes)
Parameters
| Type |
Name |
Description |
| System.Type |
dtype |
internal data type
|
| System.Int32[] |
shapes |
dimensions
|
Properties
|
Improve this Doc
View Source
dtype
Declaration
public Type dtype { get; }
Property Value
| Type |
Description |
| System.Type |
|
|
Improve this Doc
View Source
Item[Int32[]]
Declaration
public object this[params int[] select] { get; set; }
Parameters
| Type |
Name |
Description |
| System.Int32[] |
select |
|
Property Value
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
ndim
Declaration
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
shape
Data length of every dimension
Declaration
public IShape shape { get; }
Property Value
|
Improve this Doc
View Source
size
Declaration
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
Storage
The internal storage for elements of NDArray
Declaration
public NDStorage Storage { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
_ParseNumber(Object, ref Int32, ref Int32)
Declaration
protected string _ParseNumber(object number, ref int noBefore, ref int noAfter)
Parameters
| Type |
Name |
Description |
| System.Object |
number |
|
| System.Int32 |
noBefore |
|
| System.Int32 |
noAfter |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
_ToMatrixString<T>()
Declaration
protected string _ToMatrixString<T>()
Returns
| Type |
Description |
| System.String |
|
Type Parameters
|
Improve this Doc
View Source
_ToVectorString<T>()
Declaration
protected string _ToVectorString<T>()
Returns
| Type |
Description |
| System.String |
|
Type Parameters
|
Improve this Doc
View Source
absolute()
Declaration
public NDArray absolute()
Returns
|
Improve this Doc
View Source
amax(Nullable<Int32>)
Return the maximum of an array or minimum along an axis
Declaration
public NDArray amax(int? axis = default(int? ))
Parameters
| Type |
Name |
Description |
| System.Nullable<System.Int32> |
axis |
|
Returns
|
Improve this Doc
View Source
amin(Nullable<Int32>)
Return the maximum of an array or minimum along an axis
Declaration
public NDArray amin(int? axis = default(int? ))
Parameters
| Type |
Name |
Description |
| System.Nullable<System.Int32> |
axis |
|
Returns
|
Improve this Doc
View Source
arange(Int32, Int32, Int32)
Declaration
public NDArray arange(int stop, int start = 0, int step = 1)
Parameters
| Type |
Name |
Description |
| System.Int32 |
stop |
|
| System.Int32 |
start |
|
| System.Int32 |
step |
|
Returns
|
Improve this Doc
View Source
argmax()
Declaration
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
argmax<T>()
Declaration
Returns
| Type |
Description |
| System.Int32 |
|
Type Parameters
|
Improve this Doc
View Source
CalculateNegativeShape(Int32, IList<Int32>, Int32[])
Declaration
protected static int[] CalculateNegativeShape(int negativeIndex, IList<int> currentShape, params int[] shapeParams)
Parameters
| Type |
Name |
Description |
| System.Int32 |
negativeIndex |
|
| System.Collections.Generic.IList<System.Int32> |
currentShape |
|
| System.Int32[] |
shapeParams |
|
Returns
| Type |
Description |
| System.Int32[] |
|
|
Improve this Doc
View Source
Clone()
Clone the whole NDArray
internal storage is also cloned into 2nd memory area
Declaration
Returns
| Type |
Description |
| System.Object |
Cloned NDArray
|
|
Improve this Doc
View Source
Convolve(NDArray, String)
Declaration
public NDArray Convolve(NDArray numSharpArray2, string mode = "full")
Parameters
| Type |
Name |
Description |
| NDArray |
numSharpArray2 |
|
| System.String |
mode |
|
Returns
|
Improve this Doc
View Source
copy(String)
Declaration
public NDArray copy(string order = null)
Parameters
| Type |
Name |
Description |
| System.String |
order |
|
Returns
|
Improve this Doc
View Source
delete(IEnumerable)
Declaration
public NDArray delete(IEnumerable delete)
Parameters
| Type |
Name |
Description |
| System.Collections.IEnumerable |
delete |
|
Returns
|
Improve this Doc
View Source
dot(NDArray)
Matrix or vector product between given NDArray and 2nd one.
if both NDArrays are 1D, scalar product is returned independend of shape
if both NDArrays are 2D matrix product is returned.
Declaration
public NDArray dot(NDArray nd2)
Parameters
| Type |
Name |
Description |
| NDArray |
nd2 |
2nd NDArray
|
Returns
| Type |
Description |
| NDArray |
Scalarproduct or matrix prod
|
|
Improve this Doc
View Source
Equals(Object)
Determines if NDarray references are the same
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| System.Object |
obj |
NDArray to compare
|
Returns
| Type |
Description |
| System.Boolean |
if reference is same
|
Overrides
System.Object.Equals(System.Object)
|
Improve this Doc
View Source
eye(Int32, Int32)
Declaration
public NDArray eye(int dim, int diagonalIndex = 0)
Parameters
| Type |
Name |
Description |
| System.Int32 |
dim |
|
| System.Int32 |
diagonalIndex |
|
Returns
|
Improve this Doc
View Source
FindNegativeIndex(Int32[])
Declaration
protected static int FindNegativeIndex(params int[] shape)
Parameters
| Type |
Name |
Description |
| System.Int32[] |
shape |
|
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
FromMultiDimArray(Array)
Declaration
public void FromMultiDimArray(Array dotNetArray)
Parameters
| Type |
Name |
Description |
| System.Array |
dotNetArray |
|
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
Overrides
System.Object.GetHashCode()
|
Improve this Doc
View Source
hstack(NDArray[])
Stack arrays in sequence horizontally
Declaration
public NDArray hstack(params NDArray[] nps)
Parameters
| Type |
Name |
Description |
| NDArray[] |
nps |
|
Returns
|
Improve this Doc
View Source
inv()
Declaration
Returns
|
Improve this Doc
View Source
linspace(Double, Double, Int32, Boolean)
Declaration
public NDArray linspace(double start, double stop, int num, bool entdpoint = true)
Parameters
| Type |
Name |
Description |
| System.Double |
start |
|
| System.Double |
stop |
|
| System.Int32 |
num |
|
| System.Boolean |
entdpoint |
|
Returns
|
Improve this Doc
View Source
log()
Declaration
Returns
|
Improve this Doc
View Source
lstqr(NDArray, Double)
Least Square method
Determines NDArray X which reduces least square error of Linear System A * X = B.
This NDArray is equal to A.
Declaration
public NDArray lstqr(NDArray nDArrayB, double rcon = 0.0001)
Parameters
| Type |
Name |
Description |
| NDArray |
nDArrayB |
Result NDArray B
|
| System.Double |
rcon |
|
Returns
|
Improve this Doc
View Source
MakeGeneric<T>()
Declaration
public NDArray<T> MakeGeneric<T>()
where T : struct
Returns
Type Parameters
|
Improve this Doc
View Source
matrix_power(Int32)
Declaration
public NDArray matrix_power(int power)
Parameters
| Type |
Name |
Description |
| System.Int32 |
power |
|
Returns
|
Improve this Doc
View Source
max(Nullable<Int32>)
Declaration
public NDArray max(int? axis = default(int? ))
Parameters
| Type |
Name |
Description |
| System.Nullable<System.Int32> |
axis |
|
Returns
|
Improve this Doc
View Source
min(Nullable<Int32>)
Declaration
public NDArray min(int? axis = default(int? ))
Parameters
| Type |
Name |
Description |
| System.Nullable<System.Int32> |
axis |
|
Returns
|
Improve this Doc
View Source
min<T>(Nullable<Int32>)
Declaration
public NDArray min<T>(int? axis = default(int? ))
Parameters
| Type |
Name |
Description |
| System.Nullable<System.Int32> |
axis |
|
Returns
Type Parameters
|
Improve this Doc
View Source
multi_dot(NDArray[])
Declaration
public NDArray multi_dot(params NDArray[] np2Multi)
Parameters
| Type |
Name |
Description |
| NDArray[] |
np2Multi |
|
Returns
|
Improve this Doc
View Source
normalize()
Declaration
|
Improve this Doc
View Source
ones(Int32[])
Declaration
public NDArray ones(params int[] shapes)
Parameters
| Type |
Name |
Description |
| System.Int32[] |
shapes |
|
Returns
|
Improve this Doc
View Source
ones(Type, Int32[])
Declaration
public NDArray ones(Type dtype = null, params int[] shapes)
Parameters
| Type |
Name |
Description |
| System.Type |
dtype |
|
| System.Int32[] |
shapes |
|
Returns
|
Improve this Doc
View Source
power(ValueType)
Declaration
public NDArray power(ValueType exponent)
Parameters
| Type |
Name |
Description |
| System.ValueType |
exponent |
|
Returns
|
Improve this Doc
View Source
qr()
Declaration
public (NDArray, NDArray)qr()
Returns
|
Improve this Doc
View Source
ravel()
Declaration
Returns
|
Improve this Doc
View Source
reshape(Shape)
Declaration
public NDArray reshape(Shape shape)
Parameters
| Type |
Name |
Description |
| Shape |
shape |
|
Returns
|
Improve this Doc
View Source
reshape(Int32[])
Declaration
public NDArray reshape(params int[] shape)
Parameters
| Type |
Name |
Description |
| System.Int32[] |
shape |
|
Returns
|
Improve this Doc
View Source
sin()
Declaration
Returns
|
Improve this Doc
View Source
sqrt()
Declaration
Returns
|
Improve this Doc
View Source
sum(NDArray)
Declaration
public int sum(NDArray np2)
Parameters
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
svd()
Declaration
public (NDArray, NDArray, NDArray)svd()
Returns
|
Improve this Doc
View Source
ToJaggedArray<T>()
Declaration
public Array ToJaggedArray<T>()
Returns
| Type |
Description |
| System.Array |
|
Type Parameters
|
Improve this Doc
View Source
ToMuliDimArray<T>()
Declaration
public Array ToMuliDimArray<T>()
Returns
| Type |
Description |
| System.Array |
|
Type Parameters
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Overrides
System.Object.ToString()
|
Improve this Doc
View Source
transpose()
Declaration
public NDArray transpose()
Returns
|
Improve this Doc
View Source
unique<T>()
Declaration
public NDArray unique<T>()
Returns
Type Parameters
|
Improve this Doc
View Source
vstack(NDArray[])
Declaration
public NDArray vstack(params NDArray[] nps)
Parameters
| Type |
Name |
Description |
| NDArray[] |
nps |
|
Returns
Operators
|
Improve this Doc
View Source
Addition(NDArray, NDArray)
Declaration
public static NDArray operator +(NDArray np1, NDArray np2)
Parameters
Returns
|
Improve this Doc
View Source
Addition(NDArray, ValueType)
Declaration
public static NDArray operator +(NDArray np1, ValueType scalar)
Parameters
| Type |
Name |
Description |
| NDArray |
np1 |
|
| System.ValueType |
scalar |
|
Returns
|
Improve this Doc
View Source
Addition(Double, NDArray)
Declaration
public static NDArray operator +(double scalar, NDArray np1)
Parameters
| Type |
Name |
Description |
| System.Double |
scalar |
|
| NDArray |
np1 |
|
Returns
|
Improve this Doc
View Source
Division(NDArray, NDArray)
Declaration
public static NDArray operator /(NDArray np1, NDArray np2)
Parameters
Returns
|
Improve this Doc
View Source
Division(NDArray, ValueType)
Declaration
public static NDArray operator /(NDArray np1, ValueType scalar)
Parameters
| Type |
Name |
Description |
| NDArray |
np1 |
|
| System.ValueType |
scalar |
|
Returns
|
Improve this Doc
View Source
Division(Double, NDArray)
Declaration
public static NDArray operator /(double scalar, NDArray np1)
Parameters
| Type |
Name |
Description |
| System.Double |
scalar |
|
| NDArray |
np1 |
|
Returns
|
Improve this Doc
View Source
Equality(NDArray, Object)
Declaration
public static bool operator ==(NDArray np, object obj)
Parameters
| Type |
Name |
Description |
| NDArray |
np |
|
| System.Object |
obj |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Implicit(NDArray to Array)
Declaration
public static implicit operator Array(NDArray nd)
Parameters
Returns
| Type |
Description |
| System.Array |
|
|
Improve this Doc
View Source
Implicit(Array to NDArray)
Declaration
public static implicit operator NDArray(Array d)
Parameters
| Type |
Name |
Description |
| System.Array |
d |
|
Returns
|
Improve this Doc
View Source
Implicit(String to NDArray)
Declaration
public static implicit operator NDArray(string str)
Parameters
| Type |
Name |
Description |
| System.String |
str |
|
Returns
|
Improve this Doc
View Source
Inequality(NDArray, Object)
Declaration
public static bool operator !=(NDArray np, object obj)
Parameters
| Type |
Name |
Description |
| NDArray |
np |
|
| System.Object |
obj |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Multiply(NDArray, NDArray)
Declaration
public static NDArray operator *(NDArray np1, NDArray np2)
Parameters
Returns
|
Improve this Doc
View Source
Multiply(NDArray, ValueType)
Declaration
public static NDArray operator *(NDArray np1, ValueType scalar)
Parameters
| Type |
Name |
Description |
| NDArray |
np1 |
|
| System.ValueType |
scalar |
|
Returns
|
Improve this Doc
View Source
Multiply(ValueType, NDArray)
Declaration
public static NDArray operator *(ValueType scalar, NDArray np1)
Parameters
| Type |
Name |
Description |
| System.ValueType |
scalar |
|
| NDArray |
np1 |
|
Returns
|
Improve this Doc
View Source
Subtraction(NDArray, NDArray)
Declaration
public static NDArray operator -(NDArray np1, NDArray np2)
Parameters
Returns
|
Improve this Doc
View Source
Subtraction(NDArray, ValueType)
Declaration
public static NDArray operator -(NDArray np1, ValueType scalar)
Parameters
| Type |
Name |
Description |
| NDArray |
np1 |
|
| System.ValueType |
scalar |
|
Returns
|
Improve this Doc
View Source
Subtraction(ValueType, NDArray)
Declaration
public static NDArray operator -(ValueType scalar, NDArray np1)
Parameters
| Type |
Name |
Description |
| System.ValueType |
scalar |
|
| NDArray |
np1 |
|
Returns
Implements
System.ICloneable
Extension Methods