NumCpp  2.1.0
A C++ implementation of the Python Numpy library
logical_not.hpp
Go to the documentation of this file.
1 #pragma once
30 
33 #include "NumCpp/NdArray.hpp"
34 
35 namespace nc
36 {
37  //============================================================================
38  // Method Description:
49  template<typename dtype>
51  {
53 
54  NdArray<bool> returnArray(inArray.shape());
55  stl_algorithms::transform(inArray.cbegin(), inArray.cend(), returnArray.begin(),
56  [](dtype inValue) -> bool
57  {
58  return inValue == dtype{ 0 };
59  });
60 
61  return returnArray;
62  }
63 } // namespace nc
StaticAsserts.hpp
nc::NdArray::shape
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4312
STATIC_ASSERT_ARITHMETIC_OR_COMPLEX
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition: StaticAsserts.hpp:51
nc::NdArray< bool >
nc::stl_algorithms::transform
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:703
NdArray.hpp
nc::NdArray::cend
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1491
nc
Definition: Coordinate.hpp:45
nc::NdArray::cbegin
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1147
StlAlgorithms.hpp
nc::logical_not
NdArray< bool > logical_not(const NdArray< dtype > &inArray)
Definition: logical_not.hpp:50
nc::NdArray::begin
iterator begin() noexcept
Definition: NdArrayCore.hpp:1091