NumCpp
2.13.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Loading...
Searching...
No Matches
add.hpp
Go to the documentation of this file.
1
28
#pragma once
29
30
#include <complex>
31
32
#include "
NumCpp/NdArray.hpp
"
33
34
namespace
nc
35
{
36
//============================================================================
37
// Method Description:
46
template
<
typename
dtype>
47
NdArray<dtype>
add
(
const
NdArray<dtype>
&
inArray1
,
const
NdArray<dtype>
&
inArray2
)
48
{
49
return
inArray1
+
inArray2
;
50
}
51
52
//============================================================================
53
// Method Description:
62
template
<
typename
dtype>
63
NdArray<dtype>
add
(
const
NdArray<dtype>
&
inArray
,
dtype
value)
64
{
65
return
inArray
+ value;
66
}
67
68
//============================================================================
69
// Method Description:
78
template
<
typename
dtype>
79
NdArray<dtype>
add
(
dtype
value,
const
NdArray<dtype>
&
inArray
)
80
{
81
return
value +
inArray
;
82
}
83
84
//============================================================================
85
// Method Description:
94
template
<
typename
dtype>
95
NdArray<std::complex<dtype>
>
add
(
const
NdArray<dtype>
&
inArray1
,
const
NdArray
<std::complex<dtype>>&
inArray2
)
96
{
97
return
inArray1
+
inArray2
;
98
}
99
100
//============================================================================
101
// Method Description:
110
template
<
typename
dtype>
111
NdArray<std::complex<dtype>
>
add
(
const
NdArray
<std::complex<dtype>>&
inArray1
,
const
NdArray<dtype>
&
inArray2
)
112
{
113
return
inArray1
+
inArray2
;
114
}
115
116
//============================================================================
117
// Method Description:
126
template
<
typename
dtype>
127
NdArray<std::complex<dtype>
>
add
(
const
NdArray<dtype>
&
inArray
,
const
std::complex<dtype>& value)
128
{
129
return
inArray
+ value;
130
}
131
132
//============================================================================
133
// Method Description:
142
template
<
typename
dtype>
143
NdArray<std::complex<dtype>
>
add
(
const
std::complex<dtype>& value,
const
NdArray<dtype>
&
inArray
)
144
{
145
return
value +
inArray
;
146
}
147
148
//============================================================================
149
// Method Description:
158
template
<
typename
dtype>
159
NdArray<std::complex<dtype>
>
add
(
const
NdArray
<std::complex<dtype>>&
inArray
,
dtype
value)
160
{
161
return
inArray
+ value;
162
}
163
164
//============================================================================
165
// Method Description:
174
template
<
typename
dtype>
175
NdArray<std::complex<dtype>
>
add
(
dtype
value,
const
NdArray
<std::complex<dtype>>&
inArray
)
176
{
177
return
value +
inArray
;
178
}
179
}
// namespace nc
NdArray.hpp
nc::NdArray
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition
NdArrayCore.hpp:139
nc
Definition
Cartesian.hpp:40
nc::arange
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition
arange.hpp:59
nc::add
NdArray< dtype > add(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition
add.hpp:47
include
NumCpp
Functions
add.hpp
Generated by
1.9.8