Sacado Package Browser (Single Doxygen Collection)
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Sacado_ScalarFlopCounterTraits.hpp
Go to the documentation of this file.
1
// @HEADER
2
// ***********************************************************************
3
//
4
// Sacado Package
5
// Copyright (2006) Sandia Corporation
6
//
7
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8
// the U.S. Government retains certain rights in this software.
9
//
10
// This library is free software; you can redistribute it and/or modify
11
// it under the terms of the GNU Lesser General Public License as
12
// published by the Free Software Foundation; either version 2.1 of the
13
// License, or (at your option) any later version.
14
//
15
// This library is distributed in the hope that it will be useful, but
16
// WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
// Lesser General Public License for more details.
19
//
20
// You should have received a copy of the GNU Lesser General Public
21
// License along with this library; if not, write to the Free Software
22
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23
// USA
24
// Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
25
// (etphipp@sandia.gov).
26
//
27
// ***********************************************************************
28
//
29
// The forward-mode AD classes in Sacado are a derivative work of the
30
// expression template classes in the Fad package by Nicolas Di Cesare.
31
// The following banner is included in the original Fad source code:
32
//
33
// ************ DO NOT REMOVE THIS BANNER ****************
34
//
35
// Nicolas Di Cesare <Nicolas.Dicesare@ann.jussieu.fr>
36
// http://www.ann.jussieu.fr/~dicesare
37
//
38
// CEMRACS 98 : C++ courses,
39
// templates : new C++ techniques
40
// for scientific computing
41
//
42
//********************************************************
43
//
44
// NumericalTraits class to illustrate TRAITS
45
//
46
//********************************************************
47
// @HEADER
48
49
#ifndef SACADO_SCALARFLOPCOUNTERTRAITS_HPP
50
#define SACADO_SCALARFLOPCOUNTERTRAITS_HPP
51
52
#include "
Sacado_Traits.hpp
"
53
54
// Forward declarations
55
namespace
Sacado
{
56
namespace
FlopCounterPack
{
57
template
<
typename
T>
class
ScalarFlopCounter
;
58
}
59
}
60
61
namespace
Sacado
{
62
64
SACADO_AD_PROMOTE_SPEC
(
FlopCounterPack
, ScalarFlopCounter )
65
66
67
template
<
typename
ScalarT>
68
struct
ScalarType
<
FlopCounterPack
::ScalarFlopCounter<ScalarT> > {
69
typedef
typename
ScalarType<ScalarT>::type
type
;
70
};
71
73
template
<
typename
ScalarT>
74
struct
ValueType
<
FlopCounterPack
::ScalarFlopCounter<ScalarT> > {
75
typedef
ScalarT
type
;
76
};
77
79
template
<
typename
ScalarT>
80
struct
IsADType
<
FlopCounterPack
::ScalarFlopCounter<ScalarT> > {
81
static
const
bool
value
=
true
;
82
};
83
85
template
<
typename
ScalarT>
86
struct
IsScalarType
<
FlopCounterPack
::ScalarFlopCounter<ScalarT> > {
87
static
const
bool
value
=
false
;
88
};
89
91
template
<
typename
ScalarT>
92
struct
Value
<
FlopCounterPack
::ScalarFlopCounter<ScalarT> > {
93
typedef
typename
ValueType< FlopCounterPack::ScalarFlopCounter<ScalarT>
>
::type
value_type
;
94
static
const
value_type
&
eval
(
const
FlopCounterPack::ScalarFlopCounter<ScalarT>
& x) {
95
return
x.
val
(); }
96
};
97
99
template
<
typename
ScalarT>
100
struct
ScalarValue
<
FlopCounterPack
::ScalarFlopCounter<ScalarT> > {
101
typedef
typename
ValueType< FlopCounterPack::ScalarFlopCounter<ScalarT>
>
::type
value_type
;
102
typedef
typename
ScalarType< FlopCounterPack::ScalarFlopCounter<ScalarT>
>
::type
scalar_type
;
103
static
const
scalar_type
&
eval
(
const
FlopCounterPack::ScalarFlopCounter<ScalarT>
& x) {
104
return
ScalarValue<value_type>::eval
(x.
val
()); }
105
};
106
108
template
<
typename
ScalarT>
109
struct
StringName
<
FlopCounterPack
::ScalarFlopCounter<ScalarT> > {
110
static
std::string
eval
() {
111
return
std::string(
"Sacado::FlopCounterPack::ScalarFlopCounter< "
) +
112
StringName<ScalarT>::eval
() +
" >"
; }
113
};
114
115
// Need specialization for IsEqual
116
118
template
<
typename
ScalarT>
119
struct
IsStaticallySized
<
FlopCounterPack
::ScalarFlopCounter<ScalarT> > {
120
static
const
bool
value
=
true
;
121
};
122
123
}
// namespace Sacado
124
125
#endif
// SACADO_SCALARFLOPCOUNTERTRAITS_HPP
Sacado_Traits.hpp
SACADO_AD_PROMOTE_SPEC
#define SACADO_AD_PROMOTE_SPEC(NS, AD)
Definition
Sacado_Traits.hpp:235
Sacado::FlopCounterPack::ScalarFlopCounter
Templated flop counter class.
Definition
Sacado_ScalarFlopCounter.hpp:194
Sacado::FlopCounterPack::ScalarFlopCounter::val
const T & val() const
Return the current value.
Definition
Sacado_ScalarFlopCounter.hpp:246
Sacado::FlopCounterPack
Definition
Sacado_ScalarFlopCounter.hpp:43
Sacado
Definition
Sacado_mpl_apply.hpp:39
Sacado::IsADType< FlopCounterPack::ScalarFlopCounter< ScalarT > >::value
static const bool value
Definition
Sacado_ScalarFlopCounterTraits.hpp:81
Sacado::IsADType
Base template specification for IsADType.
Definition
Sacado_Traits.hpp:337
Sacado::IsScalarType< FlopCounterPack::ScalarFlopCounter< ScalarT > >::value
static const bool value
Definition
Sacado_ScalarFlopCounterTraits.hpp:87
Sacado::IsScalarType
Base template specification for IsScalarType.
Definition
Sacado_Traits.hpp:346
Sacado::IsStaticallySized< FlopCounterPack::ScalarFlopCounter< ScalarT > >::value
static const bool value
Definition
Sacado_ScalarFlopCounterTraits.hpp:120
Sacado::IsStaticallySized
Base template specification for testing whether type is statically sized.
Definition
Sacado_Traits.hpp:421
Sacado::type
Sacado::ScalarType< FlopCounterPack::ScalarFlopCounter< ScalarT > >::type
ScalarType< ScalarT >::type type
Definition
Sacado_ScalarFlopCounterTraits.hpp:69
Sacado::ScalarType
Base template specification for ScalarType.
Definition
Sacado_Traits.hpp:303
Sacado::ScalarType::type
T type
Definition
Sacado_Traits.hpp:304
Sacado::ScalarValue< FlopCounterPack::ScalarFlopCounter< ScalarT > >::scalar_type
ScalarType< FlopCounterPack::ScalarFlopCounter< ScalarT > >::type scalar_type
Definition
Sacado_ScalarFlopCounterTraits.hpp:102
Sacado::ScalarValue< FlopCounterPack::ScalarFlopCounter< ScalarT > >::eval
static const scalar_type & eval(const FlopCounterPack::ScalarFlopCounter< ScalarT > &x)
Definition
Sacado_ScalarFlopCounterTraits.hpp:103
Sacado::ScalarValue< FlopCounterPack::ScalarFlopCounter< ScalarT > >::value_type
ValueType< FlopCounterPack::ScalarFlopCounter< ScalarT > >::type value_type
Definition
Sacado_ScalarFlopCounterTraits.hpp:101
Sacado::ScalarValue
Base template specification for ScalarValue.
Definition
Sacado_Traits.hpp:382
Sacado::ScalarValue::eval
static SACADO_INLINE_FUNCTION const T & eval(const T &x)
Definition
Sacado_Traits.hpp:384
Sacado::StringName< FlopCounterPack::ScalarFlopCounter< ScalarT > >::eval
static std::string eval()
Definition
Sacado_ScalarFlopCounterTraits.hpp:110
Sacado::StringName
Base template specification for string names of types.
Definition
Sacado_Traits.hpp:410
Sacado::StringName::eval
static std::string eval()
Definition
Sacado_Traits.hpp:411
Sacado::ValueType< FlopCounterPack::ScalarFlopCounter< ScalarT > >::type
ScalarT type
Definition
Sacado_ScalarFlopCounterTraits.hpp:75
Sacado::ValueType
Base template specification for ValueType.
Definition
Sacado_Traits.hpp:320
Sacado::Value< FlopCounterPack::ScalarFlopCounter< ScalarT > >::value_type
ValueType< FlopCounterPack::ScalarFlopCounter< ScalarT > >::type value_type
Definition
Sacado_ScalarFlopCounterTraits.hpp:93
Sacado::Value< FlopCounterPack::ScalarFlopCounter< ScalarT > >::eval
static const value_type & eval(const FlopCounterPack::ScalarFlopCounter< ScalarT > &x)
Definition
Sacado_ScalarFlopCounterTraits.hpp:94
Sacado::Value
Base template specification for Value.
Definition
Sacado_Traits.hpp:363
Generated by
1.17.0