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
fmax.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
39
namespace
nc
40
{
41
//============================================================================
42
// Method Description:
54
template
<
typename
dtype>
55
dtype
fmax
(
dtype
inValue1
,
dtype
inValue2
)
noexcept
56
{
57
STATIC_ASSERT_ARITHMETIC_OR_COMPLEX
(
dtype
);
58
59
return
std::max(
inValue1
,
60
inValue2
,
61
[](
const
dtype
value1
,
const
dtype
value2
)
noexcept
->
bool
{
return
value1
<
value2
; });
62
}
55
dtype
fmax
(
dtype
inValue1
,
dtype
inValue2
)
noexcept
{
…
}
63
64
//============================================================================
65
// Method Description:
77
template
<
typename
dtype>
78
NdArray<dtype>
fmax
(
const
NdArray<dtype>
&
inArray1
,
const
NdArray<dtype>
&
inArray2
)
79
{
80
return
broadcast::broadcaster<dtype>(
inArray1
,
81
inArray2
,
82
[](
dtype
inValue1
,
dtype
inValue2
)
noexcept
->
dtype
83
{
return
fmax
(
inValue1
,
inValue2
); });
84
}
78
NdArray<dtype>
fmax
(
const
NdArray<dtype>
&
inArray1
,
const
NdArray<dtype>
&
inArray2
) {
…
}
85
86
//============================================================================
87
// Method Description:
100
template
<
typename
dtype>
101
NdArray<dtype>
fmax
(
const
NdArray<dtype>
&
inArray
,
const
dtype
&
inScalar
)
102
{
103
const
NdArray<dtype>
inArray2
= {
inScalar
};
104
return
fmax
(
inArray
,
inArray2
);
105
}
101
NdArray<dtype>
fmax
(
const
NdArray<dtype>
&
inArray
,
const
dtype
&
inScalar
) {
…
}
106
107
//============================================================================
108
// Method Description:
121
template
<
typename
dtype>
122
NdArray<dtype>
fmax
(
const
dtype
&
inScalar
,
const
NdArray<dtype>
&
inArray
)
123
{
124
return
fmax
(
inArray
,
inScalar
);
125
}
122
NdArray<dtype>
fmax
(
const
dtype
&
inScalar
,
const
NdArray<dtype>
&
inArray
) {
…
}
126
}
// namespace nc
Error.hpp
NdArray.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::arange
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition
arange.hpp:59
nc::fmax
dtype fmax(dtype inValue1, dtype inValue2) noexcept
Definition
fmax.hpp:55
include
NumCpp
Functions
fmax.hpp
Generated by
1.9.8