Show / Hide Table of Contents

Class NDStorage

Inheritance
System.Object
NDStorage
Implements
IStorage
System.ICloneable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NumSharp.Core
Assembly: NumSharp.Core.dll
Syntax
public class NDStorage : IStorage, ICloneable

Constructors

| Improve this Doc View Source

NDStorage()

Declaration
public NDStorage()
| Improve this Doc View Source

NDStorage(Double[])

Declaration
public NDStorage(double[] values)
Parameters
Type Name Description
System.Double[] values
| Improve this Doc View Source

NDStorage(Object[])

Declaration
public NDStorage(object[] values)
Parameters
Type Name Description
System.Object[] values
| Improve this Doc View Source

NDStorage(Type)

Declaration
public NDStorage(Type dtype)
Parameters
Type Name Description
System.Type dtype

Fields

| Improve this Doc View Source

_DType

Declaration
protected Type _DType
Field Value
Type Description
System.Type
| Improve this Doc View Source

_Shape

Declaration
protected IShape _Shape
Field Value
Type Description
IShape
| Improve this Doc View Source

_TensorLayout

Declaration
protected int _TensorLayout
Field Value
Type Description
System.Int32
| Improve this Doc View Source

_values

Declaration
protected Array _values
Field Value
Type Description
System.Array

Properties

| Improve this Doc View Source

DType

Data Type of stored elements

Declaration
public Type DType { get; }
Property Value
Type Description
System.Type

numpys equal dtype

| Improve this Doc View Source

Shape

storage shape for outside representation

Declaration
public IShape Shape { get; }
Property Value
Type Description
IShape

numpys equal shape

| Improve this Doc View Source

TensorLayout

column wise or row wise order

Declaration
public int TensorLayout { get; }
Property Value
Type Description
System.Int32

0 row wise, 1 column wise

Methods

| Improve this Doc View Source

_ChangeColumnToRowLayout()

Declaration
protected void _ChangeColumnToRowLayout()
| Improve this Doc View Source

_ChangeRowToColumnLayout()

Declaration
protected void _ChangeRowToColumnLayout()
| Improve this Doc View Source

_ChangeTypeOfArray(Array, Type)

Declaration
protected Array _ChangeTypeOfArray(Array arrayVar, Type dtype)
Parameters
Type Name Description
System.Array arrayVar
System.Type dtype
Returns
Type Description
System.Array
| Improve this Doc View Source

Allocate(Array, Int32)

Allocate memory by Array and tensororder and deduce shape and dtype (default column wise)

Declaration
public void Allocate(Array values, int tensorOrder = 1)
Parameters
Type Name Description
System.Array values

elements to store

System.Int32 tensorOrder

row or column wise

| Improve this Doc View Source

Allocate(Type, IShape, Int32)

Allocate memory by dtype, shape, tensororder (default column wise)

Declaration
public void Allocate(Type dtype, IShape shape, int tensorOrder = 1)
Parameters
Type Name Description
System.Type dtype

storage data type

IShape shape

storage data shape

System.Int32 tensorOrder

row or column wise

| Improve this Doc View Source

ChangeDataType(Type)

Change dtype of elements

Declaration
public void ChangeDataType(Type dtype)
Parameters
Type Name Description
System.Type dtype

new storage data type

| Improve this Doc View Source

ChangeTensorLayout(Int32)

Cange layout to 0 row wise or 1 colum wise

Declaration
public void ChangeTensorLayout(int layout)
Parameters
Type Name Description
System.Int32 layout
| Improve this Doc View Source

Clone()

Declaration
public object Clone()
Returns
Type Description
System.Object
| Improve this Doc View Source

CloneData()

Clone internal storage and get reference to it

Declaration
public Array CloneData()
Returns
Type Description
System.Array

reference to cloned storage as System.Array

| Improve this Doc View Source

CloneData(Type)

Clone internal storage and cast elements to new dtype

Declaration
public Array CloneData(Type dtype)
Parameters
Type Name Description
System.Type dtype

cloned storage data type

Returns
Type Description
System.Array

reference to cloned storage as System.Array

| Improve this Doc View Source

CloneData<T>()

Get all elements from cloned storage as T[] and cast dtype

Declaration
public T[] CloneData<T>()
Returns
Type Description
T[]

reference to cloned storage as T[]

Type Parameters
Name Description
T

cloned storgae dtype

| Improve this Doc View Source

GetColumWiseStorage()

Get Back Storage with Columnwise tensor Layout By this method the layout is changed if layout is not columnwise

Declaration
public IStorage GetColumWiseStorage()
Returns
Type Description
IStorage

reference to storage (transformed or not)

| Improve this Doc View Source

GetData()

Get reference to internal data storage

Declaration
public Array GetData()
Returns
Type Description
System.Array

reference to internal storage as System.Array

| Improve this Doc View Source

GetData(Int32[])

Get single value from internal storage and do not cast dtype

Declaration
public object GetData(params int[] indexes)
Parameters
Type Name Description
System.Int32[] indexes

indexes

Returns
Type Description
System.Object

element from internal storage

| Improve this Doc View Source

GetData(Type)

Get reference to internal data storage and cast elements to new dtype

Declaration
public Array GetData(Type dtype)
Parameters
Type Name Description
System.Type dtype

new storage data type

Returns
Type Description
System.Array

reference to internal (casted) storage as System.Array

| Improve this Doc View Source

GetData<T>()

Get reference to internal data storage and cast elements to new dtype

Declaration
public T[] GetData<T>()
Returns
Type Description
T[]

reference to internal (casted) storage as T[]

Type Parameters
Name Description
T

new storage data type

| Improve this Doc View Source

GetData<T>(Int32[])

Get single value from internal storage as type T and cast dtype to T

Declaration
public T GetData<T>(params int[] indexes)
Parameters
Type Name Description
System.Int32[] indexes

indexes

Returns
Type Description
T

element from internal storage

Type Parameters
Name Description
T

new storage data type

| Improve this Doc View Source

GetRowWiseStorage()

Get Back Storage with row wise tensor Layout By this method the layout is changed if layout is not row wise

Declaration
public IStorage GetRowWiseStorage()
Returns
Type Description
IStorage

reference to storage (transformed or not)

| Improve this Doc View Source

Reshape(Int32[])

Declaration
public void Reshape(params int[] dimensions)
Parameters
Type Name Description
System.Int32[] dimensions
| Improve this Doc View Source

SetData(Array)

Set an array to internal storage and keep dtype

Declaration
public void SetData(Array values)
Parameters
Type Name Description
System.Array values
| Improve this Doc View Source

SetData(Array, Type)

Set an Array to internal storage, cast it to new dtype and change dtype

Declaration
public void SetData(Array values, Type dtype)
Parameters
Type Name Description
System.Array values
System.Type dtype
| Improve this Doc View Source

SetData(Object, Int32[])

Set 1 single value to internal storage and keep dtype

Declaration
public void SetData(object value, params int[] indexes)
Parameters
Type Name Description
System.Object value
System.Int32[] indexes
| Improve this Doc View Source

SetData<T>(Array)

Set a 1D Array of type T to internal storage and cast dtype

Declaration
public void SetData<T>(Array values)
Parameters
Type Name Description
System.Array values
Type Parameters
Name Description
T

Implements

IStorage
System.ICloneable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX