NumCpp
2.14.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Variables
a
c
d
e
g
h
i
j
m
n
o
p
s
t
v
Typedefs
Enumerations
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
c
d
e
i
l
m
n
p
r
s
t
v
x
y
z
Typedefs
a
c
d
i
p
r
s
t
v
Enumerations
Related Symbols
Files
File List
Globals
All
Macros
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
minimum.hpp
Go to the documentation of this file.
1
28
#pragma once
29
30
#include <cmath>
31
#include <complex>
32
#include <string>
33
34
#include "
NumCpp/Core/Internal/Error.hpp
"
35
#include "
NumCpp/Core/Internal/StaticAsserts.hpp
"
36
#include "
NumCpp/Core/Internal/StlAlgorithms.hpp
"
37
#include "
NumCpp/NdArray.hpp
"
38
#include "
NumCpp/NdArray/NdArrayBroadcast.hpp
"
39
40
namespace
nc
41
{
42
//============================================================================
43
// Method Description:
54
template
<
typename
dtype>
55
NdArray<dtype>
minimum
(
const
NdArray<dtype>
&
inArray1
,
const
NdArray<dtype>
&
inArray2
)
56
{
57
STATIC_ASSERT_ARITHMETIC_OR_COMPLEX
(
dtype
);
58
59
const
auto
comparitor
= [](
const
dtype
&
lhs
,
const
dtype
&
rhs
)
noexcept
->
bool
{
return
lhs
<
rhs
; };
60
return
broadcast::broadcaster<dtype>(
inArray1
,
61
inArray2
,
62
[&
comparitor
](
const
dtype
&
value1
,
const
dtype
&
value2
)
63
{
return
std::min(
value1
,
value2
,
comparitor
); });
64
}
55
NdArray<dtype>
minimum
(
const
NdArray<dtype>
&
inArray1
,
const
NdArray<dtype>
&
inArray2
) {
…
}
65
66
//============================================================================
67
// Method Description:
78
template
<
typename
dtype>
79
NdArray<dtype>
minimum
(
const
NdArray<dtype>
&
inArray
,
const
dtype
&
inScalar
)
80
{
81
const
NdArray<dtype>
inArray2
= {
inScalar
};
82
return
minimum
(
inArray
,
inArray2
);
83
}
79
NdArray<dtype>
minimum
(
const
NdArray<dtype>
&
inArray
,
const
dtype
&
inScalar
) {
…
}
84
85
//============================================================================
86
// Method Description:
97
template
<
typename
dtype>
98
NdArray<dtype>
minimum
(
const
dtype
&
inScalar
,
const
NdArray<dtype>
&
inArray
)
99
{
100
return
minimum
(
inArray
,
inScalar
);
101
}
98
NdArray<dtype>
minimum
(
const
dtype
&
inScalar
,
const
NdArray<dtype>
&
inArray
) {
…
}
102
}
// namespace nc
Error.hpp
NdArray.hpp
NdArrayBroadcast.hpp
StaticAsserts.hpp
STATIC_ASSERT_ARITHMETIC_OR_COMPLEX
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition
StaticAsserts.hpp:56
StlAlgorithms.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::minimum
NdArray< dtype > minimum(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition
minimum.hpp:55
nc::arange
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition
arange.hpp:59
include
NumCpp
Functions
minimum.hpp
Generated by
1.9.8