NumCpp  1.0
A C++ implementation of the Python Numpy library
ceil.hpp
Go to the documentation of this file.
1 #pragma once
30 
31 #include "NumCpp/NdArray.hpp"
34 
35 #include <cmath>
36 
37 namespace nc
38 {
39  //============================================================================
40  // Method Description:
48  template<typename dtype>
49  dtype ceil(dtype inValue) noexcept
50  {
52 
53  return std::ceil(inValue);
54  }
55 
56  //============================================================================
57  // Method Description:
65  template<typename dtype>
67  {
68  NdArray<dtype> returnArray(inArray.shape());
69  stl_algorithms::transform(inArray.cbegin(), inArray.cend(), returnArray.begin(),
70  [](dtype inValue) noexcept -> dtype
71  {
72  return ceil(inValue);
73  });
74 
75  return returnArray;
76  }
77 }
StaticAsserts.hpp
nc::NdArray::shape
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4296
STATIC_ASSERT_ARITHMETIC
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:38
nc::NdArray< dtype >
NdArray.hpp
nc::NdArray::cend
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1491
nc
Definition: Coordinate.hpp:45
nc::ceil
NdArray< dtype > ceil(const NdArray< dtype > &inArray)
Definition: ceil.hpp:66
nc::stl_algorithms::transform
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction) noexcept
Definition: StlAlgorithms.hpp:703
nc::NdArray::cbegin
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1147
StlAlgorithms.hpp
nc::NdArray::begin
iterator begin() noexcept
Definition: NdArrayCore.hpp:1091
nc::ceil
dtype ceil(dtype inValue) noexcept
Definition: ceil.hpp:49