NumCpp  2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
subtract.hpp
Go to the documentation of this file.
1 #pragma once
29 
30 #include "NumCpp/NdArray.hpp"
31 
32 #include <complex>
33 
34 namespace nc
35 {
36  //============================================================================
37  // Method Description:
47  template<typename dtype>
48  NdArray<dtype> subtract(const NdArray<dtype>& inArray1, const NdArray<dtype>& inArray2)
49  {
50  return inArray1 - inArray2;
51  }
52 
53  //============================================================================
54  // Method Description:
64  template<typename dtype>
65  NdArray<dtype> subtract(const NdArray<dtype>& inArray, dtype value)
66  {
67  return inArray - value;
68  }
69 
70  //============================================================================
71  // Method Description:
81  template<typename dtype>
82  NdArray<dtype> subtract(dtype value, const NdArray<dtype>& inArray)
83  {
84  return value - inArray;
85  }
86 
87  //============================================================================
88  // Method Description:
98  template<typename dtype>
99  NdArray<std::complex<dtype>> subtract(const NdArray<dtype>& inArray1, const NdArray<std::complex<dtype>>& inArray2)
100  {
101  return inArray1 - inArray2;
102  }
103 
104  //============================================================================
105  // Method Description:
115  template<typename dtype>
116  NdArray<std::complex<dtype>> subtract(const NdArray<std::complex<dtype>>& inArray1, const NdArray<dtype>& inArray2)
117  {
118  return inArray1 - inArray2;
119  }
120 
121  //============================================================================
122  // Method Description:
132  template<typename dtype>
133  NdArray<std::complex<dtype>> subtract(const NdArray<dtype>& inArray, const std::complex<dtype>& value)
134  {
135  return inArray - value;
136  }
137 
138  //============================================================================
139  // Method Description:
149  template<typename dtype>
150  NdArray<std::complex<dtype>> subtract(const std::complex<dtype>& value, const NdArray<dtype>& inArray)
151  {
152  return value - inArray;
153  }
154 
155  //============================================================================
156  // Method Description:
166  template<typename dtype>
167  NdArray<std::complex<dtype>> subtract(const NdArray<std::complex<dtype>>& inArray, dtype value)
168  {
169  return inArray - value;
170  }
171 
172  //============================================================================
173  // Method Description:
183  template<typename dtype>
184  NdArray<std::complex<dtype>> subtract(dtype value, const NdArray<std::complex<dtype>>& inArray)
185  {
186  return value - inArray;
187  }
188 } // namespace nc
nc::subtract
NdArray< dtype > subtract(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: subtract.hpp:48
nc::NdArray< dtype >
NdArray.hpp
nc
Definition: Coordinate.hpp:44