NumCpp  2.6.2
A Templatized Header Only C++ Implementation of the Python NumPy Library
divide.hpp
Go to the documentation of this file.
1 
28 #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> divide(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> divide(const NdArray<dtype>& inArray, dtype value)
66  {
67  return inArray / value;
68  }
69 
70  //============================================================================
71  // Method Description:
81  template<typename dtype>
82  NdArray<dtype> divide(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>> divide(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>> divide(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>> divide(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>> divide(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>> divide(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>> divide(dtype value, const NdArray<std::complex<dtype>>& inArray)
185  {
186  return value / inArray;
187  }
188 } // namespace nc
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
Definition: Coordinate.hpp:45
NdArray< dtype > divide(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: divide.hpp:48