Table of Contents

Namespace NumSharp

Classes

AxisOutOfRangeException
DType
IncorrectShapeException
IncorrectSizeException
IncorrectTypeException
Kwargs
MethodImplOptionsConstants

Method implementation option constants for use with MethodImplAttribute.

MultiIterator
NDArray

An array object represents a multidimensional, homogeneous array of fixed-size items.
An associated data-type object describes the format of each element in the array (its byte-order,
how many bytes it occupies in memory, whether it is an integer, a floating point number, or something else, etc.)

NDIteratorExtensions
NDIterator<TOut>
NPTypeCodeExtensions
NpzDictionary
NpzDictionary<T>
NumPyRandom

A class that serves as numpy.random.RandomState in python.

NumSharpException
Randomizer

Represents a pseudo-random number generator, which is a device that produces a sequence of numbers that meet certain statistical requirements for randomness.
Equivalent of Random.

Slice
                                                                                                                                 <br />

NDArray can be indexed using slicing
A slice is constructed by start:stop:step notation

Examples:

a[start:stop] # items start through stop-1
a[start:] # items start through the rest of the array
a[:stop] # items from the beginning through stop-1

The key point to remember is that the :stop value represents the first value that is not
in the selected slice. So, the difference between stop and start is the number of elements
selected (if step is 1, the default).

There is also the step value, which can be used with any of the above:
a[:] # a copy of the whole array
a[start:stop:step] # start through not past stop, by step

The other feature is that start or stop may be a negative number, which means it counts
from the end of the array instead of the beginning. So:
a[-1] # last item in the array
a[-2:] # last two items in the array
a[:-2] # everything except the last two items
Similarly, step may be a negative number:

a[::- 1] # all items in the array, reversed
a[1::- 1] # the first two items, reversed
a[:-3:-1] # the last two items, reversed
a[-3::- 1] # everything except the last two items, reversed

NumSharp is kind to the programmer if there are fewer items than
you ask for. For example, if you ask for a[:-2] and a only contains one element, you get an
empty list instead of an error.Sometimes you would prefer the error, so you have to be aware
that this may happen.

Adapted from Greg Hewgill's answer on Stackoverflow: https://stackoverflow.com/questions/509211/understanding-slice-notation

Note: special IsIndex == true
It will pick only a single value at Start in this dimension effectively reducing the Shape of the sliced matrix by 1 dimension.
It can be used to reduce an N-dimensional array/matrix to a (N-1)-dimensional array/matrix

Example:
a=[[1, 2], [3, 4]]
a[:, 1] returns the second column of that 2x2 matrix as a 1-D vector

TensorEngine
np

API bridge between NumSharp and Python NumPy

np.Broadcast
np.linalg

Structs

NDArray._Unsafe
NDArray._Unsafe._Pinning
NativeRandomState

Represents the stored state of Randomizer.

Shape

Represents a shape of an N-D array. Immutable after construction (NumPy-aligned).

SliceDef

Interfaces

IIndex

Represents a class that can be served as an index, e.g. ndarray[new Slice(...)]

INumSharpException
NDIterator

Enums

ArrayFlags

NumPy-aligned array flags. Cached at shape creation for O(1) access. Matches numpy/core/include/numpy/ndarraytypes.h flag definitions.

BackendType
IteratorType
NPTypeCode

Represents all available types in numpy.

StorageType

Delegates

MoveNextReferencedDelegate<T>