NumCpp  2.14.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
find.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <limits>
31
32#include "NumCpp/Core/Types.hpp"
33#include "NumCpp/NdArray.hpp"
34
35namespace nc
36{
37 //============================================================================
38 // Method Description:
46 inline NdArray<uint32> find(const NdArray<bool>& mask, uint32 n = std::numeric_limits<uint32>::max())
47 {
49
50 if (indices.size() <= n)
51 {
52 return indices;
53 }
54
55 return indices[Slice(0, n)];
56 }
57} // namespace nc
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
NdArray< size_type > flatnonzero() const
Definition NdArrayCore.hpp:2897
A Class for slicing into NdArrays.
Definition Slice.hpp:45
Definition Cartesian.hpp:40
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
NdArray< uint32 > find(const NdArray< bool > &mask, uint32 n=std::numeric_limits< uint32 >::max())
Definition find.hpp:46
std::uint32_t uint32
Definition Types.hpp:40