NumCpp  2.17.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Loading...
Searching...
No Matches
nc::NdArray< dtype, Allocator > Class Template Reference

Holds 1D and 2D arrays, the main work horse of the NumCpp library. More...

#include <NdArrayCore.hpp>

Public Types

using allocator_type = Allocator
using column_iterator = NdArrayColumnIterator<dtype, size_type, pointer, difference_type>
using const_column_iterator = NdArrayConstColumnIterator<dtype, size_type, const_pointer, difference_type>
using const_iterator = NdArrayConstIterator<dtype, const_pointer, difference_type>
using const_pointer = typename AllocTraits::const_pointer
using const_reference = const dtype&
using const_reverse_column_iterator = std::reverse_iterator<const_column_iterator>
using const_reverse_iterator = std::reverse_iterator<const_iterator>
using difference_type = typename AllocTraits::difference_type
using index_type = int32
using iterator = NdArrayIterator<dtype, pointer, difference_type>
using pointer = typename AllocTraits::pointer
using reference = dtype&
using reverse_column_iterator = std::reverse_iterator<column_iterator>
using reverse_iterator = std::reverse_iterator<iterator>
using self_type = NdArray<dtype, Allocator>
using size_type = uint32
using value_type = dtype

Public Member Functions

 NdArray ()=default
 NdArray (const self_type &inOtherArray)
 NdArray (const Shape &inShape)
template<std::enable_if_t< is_valid_dtype_v< dtype >, int > = 0>
 NdArray (const std::deque< dtype > &inDeque)
 NdArray (const std::deque< std::deque< dtype > > &in2dDeque)
 NdArray (const std::initializer_list< std::initializer_list< dtype > > &inList)
 NdArray (const std::list< dtype > &inList)
 NdArray (const std::vector< std::vector< dtype > > &in2dVector)
template<typename UIntType, std::enable_if_t< std::is_integral_v< UIntType > &&!std::is_same_v< UIntType, bool >, int > = 0>
 NdArray (const_pointer inPtr, UIntType size)
template<typename UIntType1, typename UIntType2, std::enable_if_t< std::is_integral_v< UIntType1 > &&!std::is_same_v< UIntType1, bool >, int > = 0, std::enable_if_t< std::is_integral_v< UIntType2 > &&!std::is_same_v< UIntType2, bool >, int > = 0>
 NdArray (const_pointer inPtr, UIntType1 numRows, UIntType2 numCols)
template<typename Iterator, std::enable_if_t< std::is_same_v< typename std::iterator_traits< Iterator >::value_type, dtype >, int > = 0>
 NdArray (Iterator inFirst, Iterator inLast)
template<typename UIntType, std::enable_if_t< std::is_integral_v< UIntType > &&!std::is_same_v< UIntType, bool >, int > = 0>
 NdArray (pointer inPtr, UIntType size, PointerPolicy policy)
template<typename UIntType1, typename UIntType2, std::enable_if_t< std::is_integral_v< UIntType1 > &&!std::is_same_v< UIntType1, bool >, int > = 0, std::enable_if_t< std::is_integral_v< UIntType2 > &&!std::is_same_v< UIntType2, bool >, int > = 0>
 NdArray (pointer inPtr, UIntType1 numRows, UIntType2 numCols, PointerPolicy policy)
 NdArray (self_type &&inOtherArray) noexcept
 NdArray (size_type inNumRows, size_type inNumCols)
 NdArray (size_type inSquareSize)
template<size_t ArraySize, std::enable_if_t< is_valid_dtype_v< dtype >, int > = 0>
 NdArray (std::array< dtype, ArraySize > &inArray, PointerPolicy policy=PointerPolicy::COPY)
template<size_t Dim0Size, size_t Dim1Size>
 NdArray (std::array< std::array< dtype, Dim1Size >, Dim0Size > &in2dArray, PointerPolicy policy=PointerPolicy::COPY)
 NdArray (std::initializer_list< dtype > inList)
template<std::enable_if_t< is_valid_dtype_v< dtype >, int > = 0>
 NdArray (std::vector< dtype > &inVector, PointerPolicy policy=PointerPolicy::COPY)
template<size_t Dim1Size>
 NdArray (std::vector< std::array< dtype, Dim1Size > > &in2dArray, PointerPolicy policy=PointerPolicy::COPY)
 ~NdArray () noexcept
NdArray< bool > all (Axis inAxis=Axis::NONE) const
NdArray< bool > any (Axis inAxis=Axis::NONE) const
NdArray< size_type > argmax (Axis inAxis=Axis::NONE) const
NdArray< size_type > argmin (Axis inAxis=Axis::NONE) const
NdArray< size_type > argpartition (size_type inKth, Axis inAxis=Axis::NONE) const
NdArray< size_type > argsort (Axis inAxis=Axis::NONE) const
template<typename dtypeOut, typename dtype_ = dtype, std::enable_if_t< std::is_same_v< dtype_, dtype >, int > = 0, std::enable_if_t< is_complex_v< dtype_ >, int > = 0, std::enable_if_t< std::is_arithmetic_v< dtypeOut >, int > = 0>
NdArray< dtypeOut > astype () const
template<typename dtypeOut, typename dtype_ = dtype, std::enable_if_t< std::is_same_v< dtype_, dtype >, int > = 0, std::enable_if_t< is_complex_v< dtype_ >, int > = 0, std::enable_if_t< is_complex_v< dtypeOut >, int > = 0>
NdArray< dtypeOut > astype () const
template<typename dtypeOut, typename dtype_ = dtype, std::enable_if_t< std::is_same_v< dtype_, dtype >, int > = 0, std::enable_if_t< std::is_arithmetic_v< dtype_ >, int > = 0, std::enable_if_t< is_complex_v< dtypeOut >, int > = 0>
NdArray< dtypeOut > astype () const
template<typename dtypeOut, typename dtype_ = dtype, std::enable_if_t< std::is_same_v< dtype_, dtype >, int > = 0, std::enable_if_t< std::is_arithmetic_v< dtype_ >, int > = 0, std::enable_if_t< std::is_arithmetic_v< dtypeOut >, int > = 0>
NdArray< dtypeOut > astype () const
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type at (const Indices &inIndices) const
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type at (const Indices &rowIndices, index_type colIndex) const
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type at (const Indices &rowIndices, Slice colSlice) const
self_type at (const NdArray< bool > &inMask) const
template<typename RowIndices, typename ColIndices, type_traits::ndarray_int_concept< RowIndices > = 0, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type at (const RowIndices &rowIndices, const ColIndices &colIndices) const
self_type at (const Slice &inRowSlice, const Slice &inColSlice) const
self_type at (const Slice &inRowSlice, index_type inColIndex) const
self_type at (const Slice &inSlice) const
reference at (index_type inIndex)
const_reference at (index_type inIndex) const
self_type at (index_type inRowIndex, const Slice &inColSlice) const
reference at (index_type inRowIndex, index_type inColIndex)
const_reference at (index_type inRowIndex, index_type inColIndex) const
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type at (index_type rowIndex, const Indices &colIndices) const
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type at (Slice rowSlice, const Indices &colIndices) const
const_reference back () const noexcept
reference back () noexcept
reference back (size_type row)
const_reference back (size_type row) const
const_iterator begin () const noexcept
iterator begin () noexcept
iterator begin (size_type inRow)
const_iterator begin (size_type inRow) const
self_type & byteswap () noexcept
const_iterator cbegin () const noexcept
const_iterator cbegin (size_type inRow) const
const_column_iterator ccolbegin () const noexcept
const_column_iterator ccolbegin (size_type inCol) const
const_column_iterator ccolend () const noexcept
const_column_iterator ccolend (size_type inCol) const
const_iterator cend () const noexcept
const_iterator cend (size_type inRow) const
self_type clip (value_type inMin, value_type inMax) const
const_column_iterator colbegin () const noexcept
column_iterator colbegin () noexcept
column_iterator colbegin (size_type inCol)
const_column_iterator colbegin (size_type inCol) const
const_column_iterator colend () const noexcept
column_iterator colend () noexcept
column_iterator colend (size_type inCol)
const_column_iterator colend (size_type inCol) const
self_type column (size_type inColumn) const
self_type columns (const NdArray< size_type > &inCols) const
NdArray< bool > contains (value_type inValue, Axis inAxis=Axis::NONE) const
self_type copy () const
const_reverse_iterator crbegin () const noexcept
const_reverse_iterator crbegin (size_type inRow) const
const_reverse_column_iterator crcolbegin () const noexcept
const_reverse_column_iterator crcolbegin (size_type inCol) const
const_reverse_column_iterator crcolend () const noexcept
const_reverse_column_iterator crcolend (size_type inCol) const
const_reverse_iterator crend () const noexcept
const_reverse_iterator crend (size_type inRow) const
Slice cSlice (index_type inStartIdx=0, size_type inStepSize=1) const
self_type cumprod (Axis inAxis=Axis::NONE) const
self_type cumsum (Axis inAxis=Axis::NONE) const
const_pointer data () const noexcept
pointer data () noexcept
pointer dataRelease () noexcept
self_type diagonal (index_type inOffset=0, Axis inAxis=Axis::ROW) const
size_type dimSize (Axis inAxis) const noexcept
self_type dot (const self_type &inOtherArray) const
void dump (const std::string &inFilename) const
const_iterator end () const noexcept
iterator end () noexcept
iterator end (size_type inRow)
const_iterator end (size_type inRow) const
Endian endianess () const noexcept
self_type & fill (value_type inFillValue) noexcept
NdArray< size_type > flatnonzero () const
self_type flatten () const
const_reference front () const noexcept
reference front () noexcept
reference front (size_type row)
const_reference front (size_type row) const
self_type getByIndices (const NdArray< size_type > &inIndices) const
self_type getByMask (const NdArray< bool > &inMask) const
bool isempty () const noexcept
bool isflat () const noexcept
bool isscalar () const noexcept
NdArray< bool > issorted (Axis inAxis=Axis::NONE) const
bool issquare () const noexcept
value_type item () const
self_type max (Axis inAxis=Axis::NONE) const
self_type median (Axis inAxis=Axis::NONE) const
self_type min (Axis inAxis=Axis::NONE) const
self_type & nans () noexcept
uint64 nbytes () const noexcept
self_type newbyteorder (Endian inEndianess) const
NdArray< bool > none (Axis inAxis=Axis::NONE) const
std::pair< NdArray< size_type >, NdArray< size_type > > nonzero () const
size_type numCols () const noexcept
size_type numRows () const noexcept
self_type & ones () noexcept
 operator bool () const noexcept
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type operator() (const Indices &rowIndices, index_type colIndex) const
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type operator() (const Indices &rowIndices, Slice colSlice) const
template<typename RowIndices, typename ColIndices, type_traits::ndarray_int_concept< RowIndices > = 0, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type operator() (const RowIndices &rowIndices, const ColIndices &colIndices) const
const_reference operator() (index_type inRowIndex, index_type inColIndex) const noexcept
reference operator() (index_type inRowIndex, index_type inColIndex) noexcept
self_type operator() (index_type inRowIndex, Slice inColSlice) const
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type operator() (index_type rowIndex, const Indices &colIndices) const
self_type operator() (Slice inRowSlice, index_type inColIndex) const
self_type operator() (Slice inRowSlice, Slice inColSlice) const
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type operator() (Slice rowSlice, const Indices &colIndices) const
self_type & operator= (const self_type &rhs)
self_type & operator= (self_type &&rhs) noexcept
self_type & operator= (value_type inValue) noexcept
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type operator[] (const Indices &inIndices) const
self_type operator[] (const NdArray< bool > &inMask) const
const_reference operator[] (index_type inIndex) const noexcept
reference operator[] (index_type inIndex) noexcept
self_type operator[] (Slice inSlice) const
bool ownsInternalData () noexcept
self_type & partition (size_type inKth, Axis inAxis=Axis::NONE)
void print () const
self_type prod (Axis inAxis=Axis::NONE) const
self_type ptp (Axis inAxis=Axis::NONE) const
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & put (const Indices &inIndices, const self_type &inValues)
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & put (const Indices &inIndices, const value_type &inValue)
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & put (const Indices &inRowIndices, index_type inColIndex, const self_type &inValues)
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & put (const Indices &inRowIndices, index_type inColIndex, const value_type &inValue)
template<typename RowIndices, typename ColIndices, type_traits::ndarray_int_concept< RowIndices > = 0, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type & put (const RowIndices &inRowIndices, const ColIndices &inColIndices, const self_type &inValues)
template<typename RowIndices, typename ColIndices, type_traits::ndarray_int_concept< RowIndices > = 0, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type & put (const RowIndices &inRowIndices, const ColIndices &inColIndices, const value_type &inValue)
template<typename RowIndices, type_traits::ndarray_int_concept< RowIndices > = 0>
self_type & put (const RowIndices &inRowIndices, const Slice &inColSlice, const value_type &inValue)
template<typename RowIndices, type_traits::ndarray_int_concept< RowIndices > = 0>
self_type & put (const RowIndices &inRowIndices, Slice inColSlice, const self_type &inValues)
template<typename ColIndices, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type & put (const Slice &inRowSlice, const ColIndices &inColIndices, const value_type &inValue)
self_type & put (const Slice &inRowSlice, const Slice &inColSlice, const value_type &inValue)
self_type & put (const Slice &inRowSlice, index_type inColIndex, const self_type &inValues)
self_type & put (const Slice &inRowSlice, index_type inColIndex, const value_type &inValue)
self_type & put (const Slice &inSlice, const self_type &inValues)
self_type & put (const Slice &inSlice, const value_type &inValue)
self_type & put (index_type inIndex, const value_type &inValue)
self_type & put (index_type inRow, index_type inCol, const value_type &inValue)
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & put (index_type inRowIndex, const Indices &inColIndices, const self_type &inValues)
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & put (index_type inRowIndex, const Indices &inColIndices, const value_type &inValue)
self_type & put (index_type inRowIndex, const Slice &inColSlice, const self_type &inValues)
self_type & put (index_type inRowIndex, const Slice &inColSlice, const value_type &inValue)
template<typename ColIndices, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type & put (Slice inRowSlice, const ColIndices &inColIndices, const self_type &inValues)
self_type & put (Slice inRowSlice, Slice inColSlice, const self_type &inValues)
self_type & putMask (const NdArray< bool > &inMask, const self_type &inValues)
self_type & putMask (const NdArray< bool > &inMask, const value_type &inValue)
self_type & ravel ()
const_reverse_iterator rbegin () const noexcept
reverse_iterator rbegin () noexcept
reverse_iterator rbegin (size_type inRow)
const_reverse_iterator rbegin (size_type inRow) const
const_reverse_column_iterator rcolbegin () const noexcept
reverse_column_iterator rcolbegin () noexcept
reverse_column_iterator rcolbegin (size_type inCol)
const_reverse_column_iterator rcolbegin (size_type inCol) const
const_reverse_column_iterator rcolend () const noexcept
reverse_column_iterator rcolend () noexcept
reverse_column_iterator rcolend (size_type inCol)
const_reverse_column_iterator rcolend (size_type inCol) const
const_reverse_iterator rend () const noexcept
reverse_iterator rend () noexcept
reverse_iterator rend (size_type inRow)
const_reverse_iterator rend (size_type inRow) const
self_type repeat (const Shape &inRepeatShape) const
self_type repeat (size_type inNumRows, size_type inNumCols) const
self_type & replace (value_type oldValue, value_type newValue)
self_type & reshape (const Shape &inShape)
self_type & reshape (index_type inNumRows, index_type inNumCols)
self_type & reshape (size_type inSize)
self_type & resizeFast (const Shape &inShape)
self_type & resizeFast (size_type inNumRows, size_type inNumCols)
self_type & resizeSlow (const Shape &inShape)
self_type & resizeSlow (size_type inNumRows, size_type inNumCols)
self_type round (uint8 inNumDecimals=0) const
self_type row (size_type inRow) const
self_type rows (const NdArray< size_type > &inRows) const
Slice rSlice (index_type inStartIdx=0, size_type inStepSize=1) const
const Shape & shape () const noexcept
size_type size () const noexcept
self_type & sort (Axis inAxis=Axis::NONE)
std::string str () const
self_type sum (Axis inAxis=Axis::NONE) const
self_type swapaxes () const
self_type & swapCols (index_type colIdx1, index_type colIdx2) noexcept
self_type & swapRows (index_type rowIdx1, index_type rowIdx2) noexcept
void tofile (const std::string &inFilename) const
void tofile (const std::string &inFilename, const char inSep) const
NdArray< size_type > toIndices (Slice inSlice, Axis inAxis=Axis::NONE) const
std::vector< dtype > toStlVector () const
value_type trace (size_type inOffset=0, Axis inAxis=Axis::ROW) const noexcept
self_type transpose () const
self_type & zeros () noexcept

Detailed Description

template<typename dtype, class Allocator = std::allocator<dtype>>
class nc::NdArray< dtype, Allocator >

Holds 1D and 2D arrays, the main work horse of the NumCpp library.

Examples
GaussNewtonNlls.cpp, InterfaceWithEigen.cpp, InterfaceWithOpenCV.cpp, and ReadMe.cpp.

Member Typedef Documentation

◆ allocator_type

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::allocator_type = Allocator

◆ column_iterator

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::column_iterator = NdArrayColumnIterator<dtype, size_type, pointer, difference_type>

◆ const_column_iterator

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::const_column_iterator = NdArrayConstColumnIterator<dtype, size_type, const_pointer, difference_type>

◆ const_iterator

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::const_iterator = NdArrayConstIterator<dtype, const_pointer, difference_type>

◆ const_pointer

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::const_pointer = typename AllocTraits::const_pointer

◆ const_reference

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::const_reference = const dtype&

◆ const_reverse_column_iterator

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::const_reverse_column_iterator = std::reverse_iterator<const_column_iterator>

◆ const_reverse_iterator

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::const_reverse_iterator = std::reverse_iterator<const_iterator>

◆ difference_type

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::difference_type = typename AllocTraits::difference_type

◆ index_type

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::index_type = int32

◆ iterator

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::iterator = NdArrayIterator<dtype, pointer, difference_type>

◆ pointer

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::pointer = typename AllocTraits::pointer

◆ reference

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::reference = dtype&

◆ reverse_column_iterator

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::reverse_column_iterator = std::reverse_iterator<column_iterator>

◆ reverse_iterator

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::reverse_iterator = std::reverse_iterator<iterator>

◆ self_type

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::self_type = NdArray<dtype, Allocator>

◆ size_type

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::size_type = uint32

◆ value_type

template<typename dtype, class Allocator = std::allocator<dtype>>
using nc::NdArray< dtype, Allocator >::value_type = dtype

Constructor & Destructor Documentation

◆ NdArray() [1/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( )
default

Defualt Constructor, not very usefull...

◆ NdArray() [2/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( size_type inSquareSize)
inlineexplicit

Constructor

Parameters
inSquareSizesquare number of rows and columns

◆ NdArray() [3/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( size_type inNumRows,
size_type inNumCols )
inline

Constructor

Parameters
inNumRows
inNumCols

◆ NdArray() [4/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( const Shape & inShape)
inlineexplicit

Constructor

Parameters
inShape

◆ NdArray() [5/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( std::initializer_list< dtype > inList)
inline

Constructor

Parameters
inList

◆ NdArray() [6/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( const std::initializer_list< std::initializer_list< dtype > > & inList)
inline

Constructor

Parameters
inList2D initializer list

◆ NdArray() [7/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<size_t ArraySize, std::enable_if_t< is_valid_dtype_v< dtype >, int > = 0>
nc::NdArray< dtype, Allocator >::NdArray ( std::array< dtype, ArraySize > & inArray,
PointerPolicy policy = PointerPolicy::COPY )
inline

Constructor

Parameters
inArray
policythe policy to use the pointer, copy or non-owning shell. default copy

◆ NdArray() [8/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<size_t Dim0Size, size_t Dim1Size>
nc::NdArray< dtype, Allocator >::NdArray ( std::array< std::array< dtype, Dim1Size >, Dim0Size > & in2dArray,
PointerPolicy policy = PointerPolicy::COPY )
inline

Constructor

Parameters
in2dArray
policythe policy to use the pointer, copy or non-owning shell. default copy

◆ NdArray() [9/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<std::enable_if_t< is_valid_dtype_v< dtype >, int > = 0>
nc::NdArray< dtype, Allocator >::NdArray ( std::vector< dtype > & inVector,
PointerPolicy policy = PointerPolicy::COPY )
inline

Constructor

Parameters
inVector
policythe policy to use the pointer, copy or non-owning shell. default copy

◆ NdArray() [10/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( const std::vector< std::vector< dtype > > & in2dVector)
inlineexplicit

Constructor

Parameters
in2dVector

◆ NdArray() [11/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<size_t Dim1Size>
nc::NdArray< dtype, Allocator >::NdArray ( std::vector< std::array< dtype, Dim1Size > > & in2dArray,
PointerPolicy policy = PointerPolicy::COPY )
inline

Constructor

Parameters
in2dArray
policythe policy to use the pointer, copy or non-owning shell. default copy

◆ NdArray() [12/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<std::enable_if_t< is_valid_dtype_v< dtype >, int > = 0>
nc::NdArray< dtype, Allocator >::NdArray ( const std::deque< dtype > & inDeque)
inlineexplicit

Constructor

Parameters
inDeque

◆ NdArray() [13/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( const std::deque< std::deque< dtype > > & in2dDeque)
inlineexplicit

Constructor

Parameters
in2dDeque

◆ NdArray() [14/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( const std::list< dtype > & inList)
inlineexplicit

Constructor

Parameters
inList

◆ NdArray() [15/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Iterator, std::enable_if_t< std::is_same_v< typename std::iterator_traits< Iterator >::value_type, dtype >, int > = 0>
nc::NdArray< dtype, Allocator >::NdArray ( Iterator inFirst,
Iterator inLast )
inline

Constructor

Parameters
inFirst
inLast

◆ NdArray() [16/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename UIntType, std::enable_if_t< std::is_integral_v< UIntType > &&!std::is_same_v< UIntType, bool >, int > = 0>
nc::NdArray< dtype, Allocator >::NdArray ( const_pointer inPtr,
UIntType size )
inline

Constructor. Copies the contents of the buffer into the array

Parameters
inPtrpointer to beginning of buffer
sizenumber of elements in buffer

◆ NdArray() [17/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename UIntType1, typename UIntType2, std::enable_if_t< std::is_integral_v< UIntType1 > &&!std::is_same_v< UIntType1, bool >, int > = 0, std::enable_if_t< std::is_integral_v< UIntType2 > &&!std::is_same_v< UIntType2, bool >, int > = 0>
nc::NdArray< dtype, Allocator >::NdArray ( const_pointer inPtr,
UIntType1 numRows,
UIntType2 numCols )
inline

Constructor. Copies the contents of the buffer into the array

Parameters
inPtrpointer to beginning of buffer
numRowsnumber of rows of the buffer
numColsnumber of cols of the buffer

◆ NdArray() [18/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename UIntType, std::enable_if_t< std::is_integral_v< UIntType > &&!std::is_same_v< UIntType, bool >, int > = 0>
nc::NdArray< dtype, Allocator >::NdArray ( pointer inPtr,
UIntType size,
PointerPolicy policy )
inline

Constructor. Copies the contents of the buffer into the array, or acts as a non-owning shell

Parameters
inPtrpointer to beginning of buffer
sizenumber of elements in buffer
policythe policy to use the pointer, copy or non-owning shell. default copy

◆ NdArray() [19/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename UIntType1, typename UIntType2, std::enable_if_t< std::is_integral_v< UIntType1 > &&!std::is_same_v< UIntType1, bool >, int > = 0, std::enable_if_t< std::is_integral_v< UIntType2 > &&!std::is_same_v< UIntType2, bool >, int > = 0>
nc::NdArray< dtype, Allocator >::NdArray ( pointer inPtr,
UIntType1 numRows,
UIntType2 numCols,
PointerPolicy policy )
inline

Constructor. Copies the contents of the buffer into the array, or acts as a non-owning shell

Parameters
inPtrpointer to beginning of buffer
numRowsnumber of rows of the buffer
numColsnumber of cols of the buffer
policythe policy to use the pointer, copy or non-owning shell

◆ NdArray() [20/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( const self_type & inOtherArray)
inline

Copy Constructor

Parameters
inOtherArray

◆ NdArray() [21/21]

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::NdArray ( self_type && inOtherArray)
inlinenoexcept

Move Constructor

Parameters
inOtherArray

◆ ~NdArray()

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::~NdArray ( )
inlinenoexcept

Destructor

Member Function Documentation

◆ all()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< bool > nc::NdArray< dtype, Allocator >::all ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Returns True if all elements evaluate to True or non zero

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.all.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ any()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< bool > nc::NdArray< dtype, Allocator >::any ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Returns True if any elements evaluate to True or non zero

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.any.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ argmax()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< size_type > nc::NdArray< dtype, Allocator >::argmax ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Return indices of the maximum values along the given axis. Only the first index is returned.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.argmax.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ argmin()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< size_type > nc::NdArray< dtype, Allocator >::argmin ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Return indices of the minimum values along the given axis. Only the first index is returned.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.argmin.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ argpartition()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< size_type > nc::NdArray< dtype, Allocator >::argpartition ( size_type inKth,
Axis inAxis = Axis::NONE ) const
inlinenodiscard

Perform an indirect partition along the given axis using the algorithm specified by the kind keyword. It returns an array of indices of the same shape as a that index data along the given axis in partitioned order.

NumPy Reference: https://numpy.org/doc/stable/reference/generated/numpy.argpartition.html

Parameters
inKthkth element
inAxis(Optional, default NONE)
Returns
NdArray

◆ argsort()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< size_type > nc::NdArray< dtype, Allocator >::argsort ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Returns the indices that would sort this array.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.argsort.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ astype() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename dtypeOut, typename dtype_ = dtype, std::enable_if_t< std::is_same_v< dtype_, dtype >, int > = 0, std::enable_if_t< is_complex_v< dtype_ >, int > = 0, std::enable_if_t< std::is_arithmetic_v< dtypeOut >, int > = 0>
NdArray< dtypeOut > nc::NdArray< dtype, Allocator >::astype ( ) const
inlinenodiscard

Returns a copy of the array, cast to a specified type. Complex to Arithmetic

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.astype.html

Returns
NdArray

◆ astype() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename dtypeOut, typename dtype_ = dtype, std::enable_if_t< std::is_same_v< dtype_, dtype >, int > = 0, std::enable_if_t< is_complex_v< dtype_ >, int > = 0, std::enable_if_t< is_complex_v< dtypeOut >, int > = 0>
NdArray< dtypeOut > nc::NdArray< dtype, Allocator >::astype ( ) const
inlinenodiscard

Returns a copy of the array, cast to a specified type. Complex to Complex

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.astype.html

Returns
NdArray

◆ astype() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename dtypeOut, typename dtype_ = dtype, std::enable_if_t< std::is_same_v< dtype_, dtype >, int > = 0, std::enable_if_t< std::is_arithmetic_v< dtype_ >, int > = 0, std::enable_if_t< is_complex_v< dtypeOut >, int > = 0>
NdArray< dtypeOut > nc::NdArray< dtype, Allocator >::astype ( ) const
inlinenodiscard

Returns a copy of the array, cast to a specified type. Arithmetic to Complex

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.astype.html

Returns
NdArray

◆ astype() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename dtypeOut, typename dtype_ = dtype, std::enable_if_t< std::is_same_v< dtype_, dtype >, int > = 0, std::enable_if_t< std::is_arithmetic_v< dtype_ >, int > = 0, std::enable_if_t< std::is_arithmetic_v< dtypeOut >, int > = 0>
NdArray< dtypeOut > nc::NdArray< dtype, Allocator >::astype ( ) const
inlinenodiscard

Returns a copy of the array, cast to a specified type. Arithmetic to Arithmetic

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.astype.html

Returns
NdArray
Examples
ReadMe.cpp.

◆ at() [1/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type nc::NdArray< dtype, Allocator >::at ( const Indices & inIndices) const
inlinenodiscard

const 1D access method with bounds checking

Parameters
inIndices
Returns
Ndarray

◆ at() [2/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type nc::NdArray< dtype, Allocator >::at ( const Indices & rowIndices,
index_type colIndex ) const
inlinenodiscard

const 2D access method with bounds checking

Parameters
rowIndices
colIndex
Returns
Ndarray

◆ at() [3/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type nc::NdArray< dtype, Allocator >::at ( const Indices & rowIndices,
Slice colSlice ) const
inlinenodiscard

const 2D access method with bounds checking

Parameters
rowIndices
colSlice
Returns
Ndarray

◆ at() [4/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::at ( const NdArray< bool > & inMask) const
inlinenodiscard

const 1D access method with bounds checking

Parameters
inMask
Returns
Ndarray

◆ at() [5/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename RowIndices, typename ColIndices, type_traits::ndarray_int_concept< RowIndices > = 0, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type nc::NdArray< dtype, Allocator >::at ( const RowIndices & rowIndices,
const ColIndices & colIndices ) const
inlinenodiscard

const 2D access method with bounds checking

Parameters
rowIndices
colIndices
Returns
Ndarray

◆ at() [6/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::at ( const Slice & inRowSlice,
const Slice & inColSlice ) const
inlinenodiscard

const 2D access method with bounds checking

Parameters
inRowSlice
inColSlice
Returns
Ndarray

◆ at() [7/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::at ( const Slice & inRowSlice,
index_type inColIndex ) const
inlinenodiscard

const 2D access method with bounds checking

Parameters
inRowSlice
inColIndex
Returns
Ndarray

◆ at() [8/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::at ( const Slice & inSlice) const
inlinenodiscard

const 1D access method with bounds checking

Parameters
inSlice
Returns
Ndarray

◆ at() [9/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
reference nc::NdArray< dtype, Allocator >::at ( index_type inIndex)
inline

1D access method with bounds checking

Parameters
inIndex
Returns
value
Examples
GaussNewtonNlls.cpp.

◆ at() [10/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reference nc::NdArray< dtype, Allocator >::at ( index_type inIndex) const
inlinenodiscard

const 1D access method with bounds checking

Parameters
inIndex
Returns
value

◆ at() [11/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::at ( index_type inRowIndex,
const Slice & inColSlice ) const
inlinenodiscard

const 2D access method with bounds checking

Parameters
inRowIndex
inColSlice
Returns
Ndarray

◆ at() [12/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
reference nc::NdArray< dtype, Allocator >::at ( index_type inRowIndex,
index_type inColIndex )
inline

2D access method with bounds checking

Parameters
inRowIndex
inColIndex
Returns
value

◆ at() [13/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reference nc::NdArray< dtype, Allocator >::at ( index_type inRowIndex,
index_type inColIndex ) const
inlinenodiscard

const 2D access method with bounds checking

Parameters
inRowIndex
inColIndex
Returns
value

◆ at() [14/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type nc::NdArray< dtype, Allocator >::at ( index_type rowIndex,
const Indices & colIndices ) const
inlinenodiscard

const 2D access method with bounds checking

Parameters
rowIndex
colIndices
Returns
Ndarray

◆ at() [15/15]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type nc::NdArray< dtype, Allocator >::at ( Slice rowSlice,
const Indices & colIndices ) const
inlinenodiscard

const 2D access method with bounds checking

Parameters
rowSlice
colIndices
Returns
Ndarray

◆ back() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reference nc::NdArray< dtype, Allocator >::back ( ) const
inlinenodiscardnoexcept

Returns a copy of the last element of the flattened array.

Returns
dtype

◆ back() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reference nc::NdArray< dtype, Allocator >::back ( )
inlinenoexcept

Returns a reference the last element of the flattened array.

Returns
dtype

◆ back() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reference nc::NdArray< dtype, Allocator >::back ( size_type row)
inline

Returns a reference the last element of the input row.

Returns
dtype

◆ back() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reference nc::NdArray< dtype, Allocator >::back ( size_type row) const
inlinenodiscard

Returns a copy of the last element of the input row.

Returns
dtype

◆ begin() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_iterator nc::NdArray< dtype, Allocator >::begin ( ) const
inlinenodiscardnoexcept

const iterator to the beginning of the flattened array

Returns
const_iterator

◆ begin() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
iterator nc::NdArray< dtype, Allocator >::begin ( )
inlinenodiscardnoexcept

iterator to the beginning of the flattened array

Returns
iterator

◆ begin() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
iterator nc::NdArray< dtype, Allocator >::begin ( size_type inRow)
inlinenodiscard

iterator to the beginning of the input row

Parameters
inRow
Returns
iterator

◆ begin() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_iterator nc::NdArray< dtype, Allocator >::begin ( size_type inRow) const
inlinenodiscard

const iterator to the beginning of the input row

Parameters
inRow
Returns
const_iterator

◆ byteswap()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::byteswap ( )
inlinenoexcept

Swap the bytes of the array elements in place

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.byteswap.html

Returns
NdArray

◆ cbegin() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_iterator nc::NdArray< dtype, Allocator >::cbegin ( ) const
inlinenodiscardnoexcept

const iterator to the beginning of the flattened array

Returns
const_iterator

◆ cbegin() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_iterator nc::NdArray< dtype, Allocator >::cbegin ( size_type inRow) const
inlinenodiscard

const iterator to the beginning of the input row

Parameters
inRow
Returns
const_iterator

◆ ccolbegin() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_column_iterator nc::NdArray< dtype, Allocator >::ccolbegin ( ) const
inlinenodiscardnoexcept

const_column_iterator to the beginning of the flattened array

Returns
const_column_iterator

◆ ccolbegin() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_column_iterator nc::NdArray< dtype, Allocator >::ccolbegin ( size_type inCol) const
inlinenodiscard

const_column_iterator to the beginning of the input column

Parameters
inCol
Returns
const_column_iterator

◆ ccolend() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_column_iterator nc::NdArray< dtype, Allocator >::ccolend ( ) const
inlinenodiscardnoexcept

const_column_iterator to 1 past the end of the flattened array

Returns
const_column_iterator

◆ ccolend() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_column_iterator nc::NdArray< dtype, Allocator >::ccolend ( size_type inCol) const
inlinenodiscard

const_column_iterator to 1 past the end of the input col

Parameters
inCol
Returns
const_column_iterator

◆ cend() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_iterator nc::NdArray< dtype, Allocator >::cend ( ) const
inlinenodiscardnoexcept

const iterator to 1 past the end of the flattened array

Returns
const_iterator

◆ cend() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_iterator nc::NdArray< dtype, Allocator >::cend ( size_type inRow) const
inlinenodiscard

const iterator to 1 past the end of the input row

Parameters
inRow
Returns
const_iterator

◆ clip()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::clip ( value_type inMin,
value_type inMax ) const
inlinenodiscard

Returns an array whose values are limited to [min, max].

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.clip.html

Parameters
inMinmin value to clip to
inMaxmax value to clip to
Returns
clipped value

◆ colbegin() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_column_iterator nc::NdArray< dtype, Allocator >::colbegin ( ) const
inlinenodiscardnoexcept

const column_iterator to the beginning of the flattened array

Returns
const_column_iterator

◆ colbegin() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
column_iterator nc::NdArray< dtype, Allocator >::colbegin ( )
inlinenodiscardnoexcept

column_iterator to the beginning of the flattened array

Returns
column_iterator

◆ colbegin() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
column_iterator nc::NdArray< dtype, Allocator >::colbegin ( size_type inCol)
inlinenodiscard

column_iterator to the beginning of the input column

Parameters
inCol
Returns
column_iterator

◆ colbegin() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_column_iterator nc::NdArray< dtype, Allocator >::colbegin ( size_type inCol) const
inlinenodiscard

const column_iterator to the beginning of the input column

Parameters
inCol
Returns
const_column_iterator

◆ colend() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_column_iterator nc::NdArray< dtype, Allocator >::colend ( ) const
inlinenodiscardnoexcept

const column_iterator to 1 past the end of the flattened array

Returns
const_column_iterator

◆ colend() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
column_iterator nc::NdArray< dtype, Allocator >::colend ( )
inlinenodiscardnoexcept

column_iterator to 1 past the end of the flattened array

Returns
column_iterator

◆ colend() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
column_iterator nc::NdArray< dtype, Allocator >::colend ( size_type inCol)
inlinenodiscard

column_iterator to the 1 past end of the column

Parameters
inCol
Returns
column_iterator

◆ colend() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_column_iterator nc::NdArray< dtype, Allocator >::colend ( size_type inCol) const
inlinenodiscard

const column_iterator to the 1 past end of the column

Parameters
inCol
Returns
const_column_iterator

◆ column()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::column ( size_type inColumn) const
inlinenodiscard

Returns the full column of the array

Parameters
inColumnthe column index
Returns
self_type

◆ columns()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::columns ( const NdArray< size_type > & inCols) const
inlinenodiscard

Returns the full column of the array

Parameters
inColsthe column indices
Returns
self_type

◆ contains()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< bool > nc::NdArray< dtype, Allocator >::contains ( value_type inValue,
Axis inAxis = Axis::NONE ) const
inlinenodiscard

returns whether or not a value is included the array

Parameters
inValue
inAxis(Optional, default NONE)
Returns
bool

◆ copy()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::copy ( ) const
inlinenodiscard

Return a copy of the array

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.copy.html

Returns
NdArray

◆ crbegin() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_iterator nc::NdArray< dtype, Allocator >::crbegin ( ) const
inlinenodiscardnoexcept

const_reverse_iterator to the beginning of the flattened array

Returns
const_reverse_iterator

◆ crbegin() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_iterator nc::NdArray< dtype, Allocator >::crbegin ( size_type inRow) const
inlinenodiscard

const_reverse_iterator to the beginning of the input row

Parameters
inRow
Returns
const_reverse_iterator

◆ crcolbegin() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_column_iterator nc::NdArray< dtype, Allocator >::crcolbegin ( ) const
inlinenodiscardnoexcept

const_reverse_column_iterator to the beginning of the flattened array

Returns
const_reverse_column_iterator

◆ crcolbegin() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_column_iterator nc::NdArray< dtype, Allocator >::crcolbegin ( size_type inCol) const
inlinenodiscard

const_reverse_column_iterator to the beginning of the input column

Parameters
inCol
Returns
const_reverse_column_iterator

◆ crcolend() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_column_iterator nc::NdArray< dtype, Allocator >::crcolend ( ) const
inlinenodiscardnoexcept

const_reverse_column_iterator to 1 past the end of the flattened array

Returns
const_reverse_column_iterator

◆ crcolend() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_column_iterator nc::NdArray< dtype, Allocator >::crcolend ( size_type inCol) const
inlinenodiscard

const_reverse_column_iterator to 1 past the end of the input col

Parameters
inCol
Returns
const_reverse_column_iterator

◆ crend() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_iterator nc::NdArray< dtype, Allocator >::crend ( ) const
inlinenodiscardnoexcept

const_reverse_iterator to 1 past the end of the flattened array

Returns
const_reverse_iterator

◆ crend() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_iterator nc::NdArray< dtype, Allocator >::crend ( size_type inRow) const
inlinenodiscard

const_reverse_iterator to 1 past the end of the input row

Parameters
inRow
Returns
const_reverse_iterator

◆ cSlice()

template<typename dtype, class Allocator = std::allocator<dtype>>
Slice nc::NdArray< dtype, Allocator >::cSlice ( index_type inStartIdx = 0,
size_type inStepSize = 1 ) const
inlinenodiscard

Returns a Slice object for slicing a row to the end of array.

Parameters
inStartIdx(default 0)
inStepSize(default 1)
Returns
Slice
Examples
GaussNewtonNlls.cpp.

◆ cumprod()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::cumprod ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Return the cumulative product of the elements along the given axis.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.cumprod.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ cumsum()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::cumsum ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Return the cumulative sum of the elements along the given axis.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.cumsum.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ data() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_pointer nc::NdArray< dtype, Allocator >::data ( ) const
inlinenodiscardnoexcept

Returns the raw pointer to the underlying data

Returns
const_pointer

◆ data() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
pointer nc::NdArray< dtype, Allocator >::data ( )
inlinenodiscardnoexcept

Returns the raw pointer to the underlying data

Returns
pointer

◆ dataRelease()

template<typename dtype, class Allocator = std::allocator<dtype>>
pointer nc::NdArray< dtype, Allocator >::dataRelease ( )
inlinenodiscardnoexcept

Releases the internal data pointer so that the destructor will not call delete on it, and returns the raw pointer to the underlying data.

Returns
pointer

◆ diagonal()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::diagonal ( index_type inOffset = 0,
Axis inAxis = Axis::ROW ) const
inlinenodiscard

Return specified diagonals.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.diagonal.html

Parameters
inOffsetOffset of the diagonal from the main diagonal. Can be both positive and negative. Defaults to 0.
inAxis(Optional, default ROW) axis the offset is applied to
Returns
NdArray

◆ dimSize()

template<typename dtype, class Allocator = std::allocator<dtype>>
size_type nc::NdArray< dtype, Allocator >::dimSize ( Axis inAxis) const
inlinenodiscardnoexcept

Return size of the axis dimension

Parameters
inAxisthe array axis
Returns
size of the dimension

◆ dot()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::dot ( const self_type & inOtherArray) const
inlinenodiscard

Dot product of two arrays.

For 2-D arrays it is equivalent to matrix multiplication, and for 1-D arrays to inner product of vectors.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.dot.html

Parameters
inOtherArray
Returns
dot product

◆ dump()

template<typename dtype, class Allocator = std::allocator<dtype>>
void nc::NdArray< dtype, Allocator >::dump ( const std::string & inFilename) const
inline

Dump a binary file of the array to the specified file. The array can be read back with nc::load.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.dump.html

Parameters
inFilename

◆ end() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_iterator nc::NdArray< dtype, Allocator >::end ( ) const
inlinenodiscardnoexcept

const iterator to 1 past the end of the flattened array

Returns
const_iterator

◆ end() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
iterator nc::NdArray< dtype, Allocator >::end ( )
inlinenodiscardnoexcept

iterator to 1 past the end of the flattened array

Returns
iterator

◆ end() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
iterator nc::NdArray< dtype, Allocator >::end ( size_type inRow)
inlinenodiscard

iterator to the 1 past end of the row

Parameters
inRow
Returns
iterator

◆ end() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_iterator nc::NdArray< dtype, Allocator >::end ( size_type inRow) const
inlinenodiscard

const iterator to the 1 past end of the row

Parameters
inRow
Returns
const_iterator

◆ endianess()

template<typename dtype, class Allocator = std::allocator<dtype>>
Endian nc::NdArray< dtype, Allocator >::endianess ( ) const
inlinenodiscardnoexcept

Return the NdArrays endianess

Returns
Endian

◆ fill()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::fill ( value_type inFillValue)
inlinenoexcept

Fill the array with a scalar value.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.fill.html

Parameters
inFillValue
Returns
None

◆ flatnonzero()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< size_type > nc::NdArray< dtype, Allocator >::flatnonzero ( ) const
inlinenodiscard

Return the indices of the flattened array of the elements that are non-zero.

Returns
NdArray

◆ flatten()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::flatten ( ) const
inlinenodiscard

Return a copy of the array collapsed into one dimension.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.flatten.html

Returns
NdArray

◆ front() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reference nc::NdArray< dtype, Allocator >::front ( ) const
inlinenodiscardnoexcept

Returns a copy of the first element of the flattened array.

Returns
dtype

◆ front() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reference nc::NdArray< dtype, Allocator >::front ( )
inlinenoexcept

Returns a reference to the first element of the flattened array.

Returns
dtype

◆ front() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reference nc::NdArray< dtype, Allocator >::front ( size_type row)
inline

Returns a reference to the first element of the input row.

Returns
dtype

◆ front() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reference nc::NdArray< dtype, Allocator >::front ( size_type row) const
inlinenodiscard

Returns a copy of the first element of the input row.

Returns
dtype

◆ getByIndices()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::getByIndices ( const NdArray< size_type > & inIndices) const
inlinenodiscard

Returns a new flat array with the givin flat input indices.

Parameters
inIndices
Returns
values

◆ getByMask()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::getByMask ( const NdArray< bool > & inMask) const
inlinenodiscard

Takes in a boolean mask the same size as the array and returns a flattened array with the values cooresponding to the input mask.

Parameters
inMask
Returns
values

◆ isempty()

template<typename dtype, class Allocator = std::allocator<dtype>>
bool nc::NdArray< dtype, Allocator >::isempty ( ) const
inlinenoexcept

Return if the NdArray is empty. ie the default constructor was used.

Returns
boolean

◆ isflat()

template<typename dtype, class Allocator = std::allocator<dtype>>
bool nc::NdArray< dtype, Allocator >::isflat ( ) const
inlinenoexcept

Return if the NdArray is flat. ie the number of columns or rows is equal to one.

Returns
boolean

◆ isscalar()

template<typename dtype, class Allocator = std::allocator<dtype>>
bool nc::NdArray< dtype, Allocator >::isscalar ( ) const
inlinenoexcept

Return if the NdArray is scalar

Returns
boolean

◆ issorted()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< bool > nc::NdArray< dtype, Allocator >::issorted ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Return if the NdArray is sorted.

Parameters
inAxis
Returns
boolean

◆ issquare()

template<typename dtype, class Allocator = std::allocator<dtype>>
bool nc::NdArray< dtype, Allocator >::issquare ( ) const
inlinenoexcept

Return if the NdArray is square.

Returns
boolean

◆ item()

template<typename dtype, class Allocator = std::allocator<dtype>>
value_type nc::NdArray< dtype, Allocator >::item ( ) const
inlinenodiscard

Copy an element of an array to a standard C++ scalar and return it.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.item.html

Returns
array element

◆ max()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::max ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Return the maximum along a given axis.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.max.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ median()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::median ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Return the median along a given axis. If the dtype is floating point then the middle elements will be averaged for arrays of even number of elements. If the dtype is integral then the middle elements will be intager averaged (rounded down to integer) for arrays of even number of elements.

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ min()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::min ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Return the minimum along a given axis.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.min.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ nans()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::nans ( )
inlinenoexcept

Fills the array with nans.

◆ nbytes()

template<typename dtype, class Allocator = std::allocator<dtype>>
uint64 nc::NdArray< dtype, Allocator >::nbytes ( ) const
inlinenodiscardnoexcept

Returns the number of bytes held by the array

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.nbytes.html

Returns
number of bytes

◆ newbyteorder()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::newbyteorder ( Endian inEndianess) const
inlinenodiscard

Return the array with the same data viewed with a different byte order. only works for integer types.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.newbyteorder.html

Parameters
inEndianess
Returns
NdArray

◆ none()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< bool > nc::NdArray< dtype, Allocator >::none ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Returns True if none elements evaluate to True or non zero

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.any.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ nonzero()

template<typename dtype, class Alloc_>
std::pair< NdArray< uint32 >, NdArray< uint32 > > nc::NdArray< dtype, Alloc_ >::nonzero ( ) const
nodiscard

Return the row/col indices of the array of the elements that are non-zero.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.nonzero.html

Returns
std::pair<NdArray, NdArray> where first is the row indices and second is the column indices

◆ numCols()

template<typename dtype, class Allocator = std::allocator<dtype>>
size_type nc::NdArray< dtype, Allocator >::numCols ( ) const
inlinenodiscardnoexcept

Returns the number of columns in the array

Returns
size_type

◆ numRows()

template<typename dtype, class Allocator = std::allocator<dtype>>
size_type nc::NdArray< dtype, Allocator >::numRows ( ) const
inlinenodiscardnoexcept

Returns the number of rows in the array

Returns
size_type

◆ ones()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::ones ( )
inlinenoexcept

Fills the array with ones

◆ operator bool()

template<typename dtype, class Allocator = std::allocator<dtype>>
nc::NdArray< dtype, Allocator >::operator bool ( ) const
inlineexplicitnoexcept

Cast to bool operator

Returns
bool false if empty, otherwise true

◆ operator()() [1/10]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type nc::NdArray< dtype, Allocator >::operator() ( const Indices & rowIndices,
index_type colIndex ) const
inlinenodiscard

2D index access operator with no bounds checking returned array is of the range.

Parameters
rowIndices
colIndex
Returns
NdArray

◆ operator()() [2/10]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type nc::NdArray< dtype, Allocator >::operator() ( const Indices & rowIndices,
Slice colSlice ) const
inlinenodiscard

2D index access operator with no bounds checking returned array is of the range.

Parameters
rowIndices
colSlice
Returns
NdArray

◆ operator()() [3/10]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename RowIndices, typename ColIndices, type_traits::ndarray_int_concept< RowIndices > = 0, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type nc::NdArray< dtype, Allocator >::operator() ( const RowIndices & rowIndices,
const ColIndices & colIndices ) const
inlinenodiscard

2D index access operator with no bounds checking returned array is of the range.

Parameters
rowIndices
colIndices
Returns
NdArray

◆ operator()() [4/10]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reference nc::NdArray< dtype, Allocator >::operator() ( index_type inRowIndex,
index_type inColIndex ) const
inlinenodiscardnoexcept

const 2D access operator with no bounds checking

Parameters
inRowIndex
inColIndex
Returns
value

◆ operator()() [5/10]

template<typename dtype, class Allocator = std::allocator<dtype>>
reference nc::NdArray< dtype, Allocator >::operator() ( index_type inRowIndex,
index_type inColIndex )
inlinenoexcept

2D access operator with no bounds checking

Parameters
inRowIndex
inColIndex
Returns
value

◆ operator()() [6/10]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::operator() ( index_type inRowIndex,
Slice inColSlice ) const
inlinenodiscard

2D Slicing access operator with no bounds checking returned array is of the range [start, stop).

Parameters
inRowIndex
inColSlice
Returns
NdArray

◆ operator()() [7/10]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type nc::NdArray< dtype, Allocator >::operator() ( index_type rowIndex,
const Indices & colIndices ) const
inlinenodiscard

2D index access operator with no bounds checking returned array is of the range.

Parameters
rowIndex
colIndices
Returns
NdArray

◆ operator()() [8/10]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::operator() ( Slice inRowSlice,
index_type inColIndex ) const
inlinenodiscard

2D Slicing access operator with no bounds checking returned array is of the range [start, stop).

Parameters
inRowSlice
inColIndex
Returns
NdArray

◆ operator()() [9/10]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::operator() ( Slice inRowSlice,
Slice inColSlice ) const
inlinenodiscard

2D Slicing access operator with no bounds checking returned array is of the range [start, stop).

Parameters
inRowSlice
inColSlice
Returns
NdArray

◆ operator()() [10/10]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type nc::NdArray< dtype, Allocator >::operator() ( Slice rowSlice,
const Indices & colIndices ) const
inlinenodiscard

2D index access operator with no bounds checking returned array is of the range.

Parameters
rowSlice
colIndices
Returns
NdArray

◆ operator=() [1/3]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::operator= ( const self_type & rhs)
inline

Assignment operator, performs a deep copy

Parameters
rhs
Returns
NdArray<dtype>

◆ operator=() [2/3]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::operator= ( self_type && rhs)
inlinenoexcept

Move operator, performs a deep move

Parameters
rhs
Returns
NdArray<dtype>

◆ operator=() [3/3]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::operator= ( value_type inValue)
inlinenoexcept

Assignment operator, sets the entire array to a single scalar value.

Parameters
inValue
Returns
NdArray<dtype>

◆ operator[]() [1/5]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type nc::NdArray< dtype, Allocator >::operator[] ( const Indices & inIndices) const
inlinenodiscard

Returns the values from the input indices with no bounds checking

Parameters
inIndices
Returns
NdArray

◆ operator[]() [2/5]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::operator[] ( const NdArray< bool > & inMask) const
inlinenodiscard

Returns the values from the input mask with no bounds checking

Parameters
inMask
Returns
NdArray

◆ operator[]() [3/5]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reference nc::NdArray< dtype, Allocator >::operator[] ( index_type inIndex) const
inlinenodiscardnoexcept

const 1D access operator with no bounds checking

Parameters
inIndex
Returns
value

◆ operator[]() [4/5]

template<typename dtype, class Allocator = std::allocator<dtype>>
reference nc::NdArray< dtype, Allocator >::operator[] ( index_type inIndex)
inlinenoexcept

1D access operator with no bounds checking

Parameters
inIndex
Returns
value

◆ operator[]() [5/5]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::operator[] ( Slice inSlice) const
inlinenodiscard

1D Slicing access operator with no bounds checking returned array is of the range [start, stop).

Parameters
inSlice
Returns
NdArray

◆ ownsInternalData()

template<typename dtype, class Allocator = std::allocator<dtype>>
bool nc::NdArray< dtype, Allocator >::ownsInternalData ( )
inlinenoexcept

Returns whether or not the array object owns the underlying data

Returns
bool

◆ partition()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::partition ( size_type inKth,
Axis inAxis = Axis::NONE )
inline

Rearranges the elements in the array in such a way that value of the element in kth position is in the position it would be in a sorted array. All elements smaller than the kth element are moved before this element and all equal or greater are moved behind it. The ordering of the elements in the two partitions is undefined.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.partition.html

Parameters
inKthkth element
inAxis(Optional, default NONE)
Returns
None

◆ print()

template<typename dtype, class Allocator = std::allocator<dtype>>
void nc::NdArray< dtype, Allocator >::print ( ) const
inline

Prints the array to the console.

◆ prod()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::prod ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Return the product of the array elements over the given axis

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.prod.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ ptp()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::ptp ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Peak to peak (maximum - minimum) value along a given axis.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.ptp.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ put() [1/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( const Indices & inIndices,
const self_type & inValues )
inline

Set a.flat[n] = values[n] for all n in indices.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inIndices
inValues
Returns
reference to self

◆ put() [2/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( const Indices & inIndices,
const value_type & inValue )
inline

Set a.flat[n] = values for all n in indices.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inIndices
inValue
Returns
reference to self

◆ put() [3/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( const Indices & inRowIndices,
index_type inColIndex,
const self_type & inValues )
inline

Set the slice indices to the input values.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowIndices
inColIndex
inValues
Returns
reference to self

◆ put() [4/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( const Indices & inRowIndices,
index_type inColIndex,
const value_type & inValue )
inline

Set the slice indices to the input value.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowIndices
inColIndex
inValue
Returns
reference to self

◆ put() [5/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename RowIndices, typename ColIndices, type_traits::ndarray_int_concept< RowIndices > = 0, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( const RowIndices & inRowIndices,
const ColIndices & inColIndices,
const self_type & inValues )
inline

Set the slice indices to the input values.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowIndices
inColIndices
inValues
Returns
reference to self

◆ put() [6/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename RowIndices, typename ColIndices, type_traits::ndarray_int_concept< RowIndices > = 0, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( const RowIndices & inRowIndices,
const ColIndices & inColIndices,
const value_type & inValue )
inline

Set the slice indices to the input value.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowIndices
inColIndices
inValue
Returns
reference to self

◆ put() [7/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename RowIndices, type_traits::ndarray_int_concept< RowIndices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( const RowIndices & inRowIndices,
const Slice & inColSlice,
const value_type & inValue )
inline

Set the slice indices to the input value.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowIndices
inColSlice
inValue
Returns
reference to self

◆ put() [8/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename RowIndices, type_traits::ndarray_int_concept< RowIndices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( const RowIndices & inRowIndices,
Slice inColSlice,
const self_type & inValues )
inline

Set the slice indices to the input values.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowIndices
inColSlice
inValues
Returns
reference to self

◆ put() [9/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename ColIndices, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( const Slice & inRowSlice,
const ColIndices & inColIndices,
const value_type & inValue )
inline

Set the slice indices to the input value.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowSlice
inColIndices
inValue
Returns
reference to self

◆ put() [10/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::put ( const Slice & inRowSlice,
const Slice & inColSlice,
const value_type & inValue )
inline

Set the slice indices to the input value.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowSlice
inColSlice
inValue
Returns
reference to self

◆ put() [11/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::put ( const Slice & inRowSlice,
index_type inColIndex,
const self_type & inValues )
inline

Set the slice indices to the input values.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowSlice
inColIndex
inValues
Returns
reference to self

◆ put() [12/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::put ( const Slice & inRowSlice,
index_type inColIndex,
const value_type & inValue )
inline

Set the slice indices to the input value.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowSlice
inColIndex
inValue
Returns
reference to self

◆ put() [13/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::put ( const Slice & inSlice,
const self_type & inValues )
inline

Set the slice indices to the input values.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inSlice
inValues
Returns
reference to self

◆ put() [14/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::put ( const Slice & inSlice,
const value_type & inValue )
inline

Set the slice indices to the input value.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inSlice
inValue
Returns
reference to self

◆ put() [15/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::put ( index_type inIndex,
const value_type & inValue )
inline

set the flat index element to the value

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inIndex
inValue

◆ put() [16/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::put ( index_type inRow,
index_type inCol,
const value_type & inValue )
inline

set the 2D row/col index element to the value

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRow
inCol
inValue

◆ put() [17/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( index_type inRowIndex,
const Indices & inColIndices,
const self_type & inValues )
inline

Set the slice indices to the input values.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowIndex
inColIndices
inValues
Returns
reference to self

◆ put() [18/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename Indices, type_traits::ndarray_int_concept< Indices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( index_type inRowIndex,
const Indices & inColIndices,
const value_type & inValue )
inline

Set the slice indices to the input value.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowIndex
inColIndices
inValue
Returns
reference to self

◆ put() [19/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::put ( index_type inRowIndex,
const Slice & inColSlice,
const self_type & inValues )
inline

Set the slice indices to the input values.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowIndex
inColSlice
inValues
Returns
reference to self

◆ put() [20/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::put ( index_type inRowIndex,
const Slice & inColSlice,
const value_type & inValue )
inline

Set the slice indices to the input value.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowIndex
inColSlice
inValue
Returns
reference to self

◆ put() [21/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
template<typename ColIndices, type_traits::ndarray_int_concept< ColIndices > = 0>
self_type & nc::NdArray< dtype, Allocator >::put ( Slice inRowSlice,
const ColIndices & inColIndices,
const self_type & inValues )
inline

Set the slice indices to the input values.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowSlice
inColIndices
inValues
Returns
reference to self

◆ put() [22/22]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::put ( Slice inRowSlice,
Slice inColSlice,
const self_type & inValues )
inline

Set the slice indices to the input values.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.put.html

Parameters
inRowSlice
inColSlice
inValues
Returns
reference to self

◆ putMask() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::putMask ( const NdArray< bool > & inMask,
const self_type & inValues )
inline

Set the mask indices to the input values.

Parameters
inMask
inValues

◆ putMask() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::putMask ( const NdArray< bool > & inMask,
const value_type & inValue )
inline

Set the mask indices to the input value.

Parameters
inMask
inValue

◆ ravel()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::ravel ( )
inline

Flattens the array but does not make a copy.

Numpy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.ravel.html

Returns
NdArray

◆ rbegin() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_iterator nc::NdArray< dtype, Allocator >::rbegin ( ) const
inlinenodiscardnoexcept

const iterator to the beginning of the flattened array

Returns
const_iterator

◆ rbegin() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reverse_iterator nc::NdArray< dtype, Allocator >::rbegin ( )
inlinenodiscardnoexcept

reverse_iterator to the beginning of the flattened array

Returns
reverse_iterator

◆ rbegin() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reverse_iterator nc::NdArray< dtype, Allocator >::rbegin ( size_type inRow)
inlinenodiscard

reverse_iterator to the beginning of the input row

Parameters
inRow
Returns
reverse_iterator

◆ rbegin() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_iterator nc::NdArray< dtype, Allocator >::rbegin ( size_type inRow) const
inlinenodiscard

const iterator to the beginning of the input row

Parameters
inRow
Returns
const_iterator

◆ rcolbegin() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_column_iterator nc::NdArray< dtype, Allocator >::rcolbegin ( ) const
inlinenodiscardnoexcept

const iterator to the beginning of the flattened array

Returns
const_iterator

◆ rcolbegin() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reverse_column_iterator nc::NdArray< dtype, Allocator >::rcolbegin ( )
inlinenodiscardnoexcept

reverse_column_iterator to the beginning of the flattened array

Returns
reverse_column_iterator

◆ rcolbegin() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reverse_column_iterator nc::NdArray< dtype, Allocator >::rcolbegin ( size_type inCol)
inlinenodiscard

reverse_column_iterator to the beginning of the input column

Parameters
inCol
Returns
reverse_column_iterator

◆ rcolbegin() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_column_iterator nc::NdArray< dtype, Allocator >::rcolbegin ( size_type inCol) const
inlinenodiscard

const iterator to the beginning of the input column

Parameters
inCol
Returns
const_iterator

◆ rcolend() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_column_iterator nc::NdArray< dtype, Allocator >::rcolend ( ) const
inlinenodiscardnoexcept

const_reverse_column_iterator to 1 past the end of the flattened array

Returns
const_reverse_column_iterator

◆ rcolend() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reverse_column_iterator nc::NdArray< dtype, Allocator >::rcolend ( )
inlinenodiscardnoexcept

reverse_column_iterator to 1 past the end of the flattened array

Returns
reverse_column_iterator

◆ rcolend() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reverse_column_iterator nc::NdArray< dtype, Allocator >::rcolend ( size_type inCol)
inlinenodiscard

reverse_column_iterator to the 1 past end of the column

Parameters
inCol
Returns
reverse_column_iterator

◆ rcolend() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_column_iterator nc::NdArray< dtype, Allocator >::rcolend ( size_type inCol) const
inlinenodiscard

const_reverse_column_iterator to the 1 past end of the column

Parameters
inCol
Returns
const_reverse_column_iterator

◆ rend() [1/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_iterator nc::NdArray< dtype, Allocator >::rend ( ) const
inlinenodiscardnoexcept

const_reverse_iterator to 1 past the end of the flattened array

Returns
const_reverse_iterator

◆ rend() [2/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reverse_iterator nc::NdArray< dtype, Allocator >::rend ( )
inlinenodiscardnoexcept

reverse_iterator to 1 past the end of the flattened array

Returns
reverse_iterator

◆ rend() [3/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
reverse_iterator nc::NdArray< dtype, Allocator >::rend ( size_type inRow)
inlinenodiscard

reverse_iterator to the 1 past end of the row

Parameters
inRow
Returns
reverse_iterator

◆ rend() [4/4]

template<typename dtype, class Allocator = std::allocator<dtype>>
const_reverse_iterator nc::NdArray< dtype, Allocator >::rend ( size_type inRow) const
inlinenodiscard

const_reverse_iterator to the 1 past end of the row

Parameters
inRow
Returns
const_reverse_iterator

◆ repeat() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::repeat ( const Shape & inRepeatShape) const
inlinenodiscard

Repeat elements of an array.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.repeat.html

Parameters
inRepeatShape
Returns
NdArray

◆ repeat() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::repeat ( size_type inNumRows,
size_type inNumCols ) const
inlinenodiscard

Repeat elements of an array.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.repeat.html

Parameters
inNumRows
inNumCols
Returns
NdArray

◆ replace()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::replace ( value_type oldValue,
value_type newValue )
inline

Replaces a value of the array with another value

Parameters
oldValuethe value to replace
newValuethe value to replace with

◆ reshape() [1/3]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::reshape ( const Shape & inShape)
inline

The new shape should be compatible with the original shape. If an single integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.

NOTE: array shape is modified. If a copy is desired then the user should call the copy method: auto aNew = a.reshape(newShape).copy()

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.reshape.html

Parameters
inShape
Returns
reference to self

◆ reshape() [2/3]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::reshape ( index_type inNumRows,
index_type inNumCols )
inline

The new shape should be compatible with the original shape. If an single integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.

NOTE: array shape is modified. If a copy is desired then the user should call the copy method: auto aNew = a.reshape(newRows, newCols).copy()

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.reshape.html

Parameters
inNumRows
inNumCols
Returns
reference to self

◆ reshape() [3/3]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::reshape ( size_type inSize)
inline

The new shape should be compatible with the original shape. If an single integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.

NOTE: array shape is modified. If a copy is desired then the user should call the copy method: auto aNew = a.reshape(newSize).copy()

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.reshape.html

Parameters
inSize
Returns
reference to self
Examples
ReadMe.cpp.

◆ resizeFast() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::resizeFast ( const Shape & inShape)
inline

Change shape and size of array in-place. All previous data of the array is lost.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.resize.html

Parameters
inShape

◆ resizeFast() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::resizeFast ( size_type inNumRows,
size_type inNumCols )
inline

Change shape and size of array in-place. All previous data of the array is lost.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.resize.html

Parameters
inNumRows
inNumCols

◆ resizeSlow() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::resizeSlow ( const Shape & inShape)
inline

Return a new array with the specified shape. If new shape is larger than old shape then array will be padded with zeros. If new shape is smaller than the old shape then the data will be discarded.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.resize.html

Parameters
inShape

◆ resizeSlow() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::resizeSlow ( size_type inNumRows,
size_type inNumCols )
inline

Return a new array with the specified shape. If new shape is larger than old shape then array will be padded with zeros. If new shape is smaller than the old shape then the data will be discarded.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.resize.html

Parameters
inNumRows
inNumCols

◆ round()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::round ( uint8 inNumDecimals = 0) const
inlinenodiscard

Return a with each element rounded to the given number of decimals.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.round.html

Parameters
inNumDecimals(default 0)
Returns
NdArray

◆ row()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::row ( size_type inRow) const
inlinenodiscard

Returns the full row of the array

Parameters
inRowthe row index
Returns
self_type

◆ rows()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::rows ( const NdArray< size_type > & inRows) const
inlinenodiscard

Returns the full row of the array

Parameters
inRowsthe row indices
Returns
self_type

◆ rSlice()

template<typename dtype, class Allocator = std::allocator<dtype>>
Slice nc::NdArray< dtype, Allocator >::rSlice ( index_type inStartIdx = 0,
size_type inStepSize = 1 ) const
inlinenodiscard

Returns a Slice object for slicing a column to the end of the array.

Parameters
inStartIdx(default 0)
inStepSize(default 1)
Returns
Slice

◆ shape()

template<typename dtype, class Allocator = std::allocator<dtype>>
const Shape & nc::NdArray< dtype, Allocator >::shape ( ) const
inlinenodiscardnoexcept

Return the shape of the array

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.shape.html

Returns
Shape
Examples
GaussNewtonNlls.cpp.

◆ size()

template<typename dtype, class Allocator = std::allocator<dtype>>
size_type nc::NdArray< dtype, Allocator >::size ( ) const
inlinenodiscardnoexcept

Return the size of the array

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.size.html

Returns
size

◆ sort()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::sort ( Axis inAxis = Axis::NONE)
inline

Sort an array, in-place.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.sort.html

Parameters
inAxis(Optional, default NONE)
Returns
size

◆ str()

template<typename dtype, class Allocator = std::allocator<dtype>>
std::string nc::NdArray< dtype, Allocator >::str ( ) const
inlinenodiscard

returns the NdArray as a string representation

Returns
string

◆ sum()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::sum ( Axis inAxis = Axis::NONE) const
inlinenodiscard

Return the sum of the array elements over the given axis.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.sum.html

Parameters
inAxis(Optional, default NONE)
Returns
NdArray

◆ swapaxes()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::swapaxes ( ) const
inlinenodiscard

Interchange two axes of an array. Equivalent to transpose...

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.swapaxes.html

Returns
NdArray

◆ swapCols()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::swapCols ( index_type colIdx1,
index_type colIdx2 )
inlinenoexcept

Swaps rows of the array

Parameters
colIdx1
colIdx2
Returns
reference to self

◆ swapRows()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::swapRows ( index_type rowIdx1,
index_type rowIdx2 )
inlinenoexcept

Swaps rows of the array

Parameters
rowIdx1
rowIdx2
Returns
reference to self

◆ tofile() [1/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
void nc::NdArray< dtype, Allocator >::tofile ( const std::string & inFilename) const
inline

Write array to a file as binary. The data produced by this method can be recovered using the function fromfile().

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.tofile.html

Parameters
inFilename

◆ tofile() [2/2]

template<typename dtype, class Allocator = std::allocator<dtype>>
void nc::NdArray< dtype, Allocator >::tofile ( const std::string & inFilename,
const char inSep ) const
inline

Write array to a file as text. The data produced by this method can be recovered using the function fromfile().

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.tofile.html

Parameters
inFilename
inSepSeparator between array items for text output.

◆ toIndices()

template<typename dtype, class Allocator = std::allocator<dtype>>
NdArray< size_type > nc::NdArray< dtype, Allocator >::toIndices ( Slice inSlice,
Axis inAxis = Axis::NONE ) const
inlinenodiscard

Converts the slice object to an NdArray of indices for this array

Parameters
inSlicethe slice object
inAxisthe array axis
Returns
NdArray<index_type>

◆ toStlVector()

template<typename dtype, class Allocator = std::allocator<dtype>>
std::vector< dtype > nc::NdArray< dtype, Allocator >::toStlVector ( ) const
inlinenodiscard

Write flattened array to an STL vector

Returns
std::vector

◆ trace()

template<typename dtype, class Allocator = std::allocator<dtype>>
value_type nc::NdArray< dtype, Allocator >::trace ( size_type inOffset = 0,
Axis inAxis = Axis::ROW ) const
inlinenodiscardnoexcept

Return the sum along diagonals of the array.

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.trace.html

Parameters
inOffsetOffset of the diagonal from the main diagonal. Can be both positive and negative. Defaults to 0.
inAxis(Optional, default ROW) Axis to offset from
Returns
value

◆ transpose()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type nc::NdArray< dtype, Allocator >::transpose ( ) const
inlinenodiscard

Tranpose the rows and columns of an array

Numpy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.ndarray.transpose.html

Returns
NdArray
Examples
GaussNewtonNlls.cpp.

◆ zeros()

template<typename dtype, class Allocator = std::allocator<dtype>>
self_type & nc::NdArray< dtype, Allocator >::zeros ( )
inlinenoexcept

Fills the array with zeros


The documentation for this class was generated from the following files: