NumCpp  2.1.0
A C++ implementation of the Python Numpy library
add.hpp
Go to the documentation of this file.
1 #pragma once
30 
31 #include "NumCpp/NdArray.hpp"
32 
33 #include <complex>
34 
35 namespace nc
36 {
37  //============================================================================
38  // Method Description:
48  template<typename dtype>
49  NdArray<dtype> add(const NdArray<dtype>& inArray1, const NdArray<dtype>& inArray2)
50  {
51  return inArray1 + inArray2;
52  }
53 
54  //============================================================================
55  // Method Description:
65  template<typename dtype>
66  NdArray<dtype> add(const NdArray<dtype>& inArray, dtype value)
67  {
68  return inArray + value;
69  }
70 
71  //============================================================================
72  // Method Description:
82  template<typename dtype>
83  NdArray<dtype> add(dtype value, const NdArray<dtype>& inArray)
84  {
85  return value + inArray;
86  }
87 
88  //============================================================================
89  // Method Description:
99  template<typename dtype>
100  NdArray<std::complex<dtype>> add(const NdArray<dtype>& inArray1, const NdArray<std::complex<dtype>>& inArray2)
101  {
102  return inArray1 + inArray2;
103  }
104 
105  //============================================================================
106  // Method Description:
116  template<typename dtype>
117  NdArray<std::complex<dtype>> add(const NdArray<std::complex<dtype>>& inArray1, const NdArray<dtype>& inArray2)
118  {
119  return inArray1 + inArray2;
120  }
121 
122  //============================================================================
123  // Method Description:
133  template<typename dtype>
134  NdArray<std::complex<dtype>> add(const NdArray<dtype>& inArray, const std::complex<dtype>& value)
135  {
136  return inArray + value;
137  }
138 
139  //============================================================================
140  // Method Description:
150  template<typename dtype>
151  NdArray<std::complex<dtype>> add(const std::complex<dtype>& value, const NdArray<dtype>& inArray)
152  {
153  return value + inArray;
154  }
155 
156  //============================================================================
157  // Method Description:
167  template<typename dtype>
168  NdArray<std::complex<dtype>> add(const NdArray<std::complex<dtype>>& inArray, dtype value)
169  {
170  return inArray + value;
171  }
172 
173  //============================================================================
174  // Method Description:
184  template<typename dtype>
185  NdArray<std::complex<dtype>> add(dtype value, const NdArray<std::complex<dtype>>& inArray)
186  {
187  return value + inArray;
188  }
189 } // namespace nc
nc::NdArray< dtype >
NdArray.hpp
nc::add
NdArray< dtype > add(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: add.hpp:49
nc
Definition: Coordinate.hpp:45