52 template<
typename dtype>
59 std::vector<typename NdArray<dtype>::size_type>
temp(
size);
60 std::iota(
temp.begin(),
temp.end(), 0);
67 [&
func](
const auto idx) { return func(idx); });
84 template<
typename dtype>
90 const auto rows = [&
shape]
92 std::vector<typename NdArray<dtype>::size_type>
temp(
shape.
rows);
93 std::iota(
temp.begin(),
temp.end(), 0);
96 const auto cols = [&
shape]
98 std::vector<typename NdArray<dtype>::size_type>
temp(
shape.
cols);
99 std::iota(
temp.begin(),
temp.end(), 0);
107 stl_algorithms::transform(cols.begin(),
110 [&func, row](const auto col) { return func(row, col); });
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
uint32 size_type
Definition NdArrayCore.hpp:156
A Shape Class for NdArrays.
Definition Core/shape.hpp:41
uint32 rows
Definition Core/shape.hpp:44
uint32 cols
Definition Core/shape.hpp:45
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition StlAlgorithms.hpp:775
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition StlAlgorithms.hpp:225
Definition Cartesian.hpp:40
uint32 size(const NdArray< dtype > &inArray) noexcept
Definition size.hpp:43
NdArray< dtype > fromfunction(const std::function< dtype(typename NdArray< dtype >::size_type)> func, typename NdArray< dtype >::size_type size)
Definition fromfunction.hpp:53
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
Shape shape(const NdArray< dtype > &inArray) noexcept
Definition Functions/shape.hpp:42