Sacado Package Browser (Single Doxygen Collection)
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Sacado_trad2_Traits.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
// @HEADER
29
30
#ifndef SACADO_TRAD2_TRAITS_HPP
31
#define SACADO_TRAD2_TRAITS_HPP
32
33
#include "
Sacado_Traits.hpp
"
34
35
// Forward declarations
36
namespace
Sacado
{
37
namespace
Rad2
{
38
template
<
typename
T>
class
ADvar
;
39
template
<
typename
T>
class
ADvari
;
40
}
41
}
42
43
namespace
Sacado
{
44
46
SACADO_RAD_PROMOTE_SPEC
(
Rad2
)
47
48
49
template
<
typename
T>
50
struct
ScalarType
<
Rad2
::ADvar<T> > {
51
typedef
typename
ScalarType<T>::type
type
;
52
};
53
55
template
<
typename
T>
56
struct
ScalarType
<
Rad2
::ADvari<T> > {
57
typedef
typename
ScalarType<T>::type
type
;
58
};
59
61
template
<
typename
T>
62
struct
ValueType
<
Rad2
::ADvar<T> > {
63
typedef
T
type
;
64
};
65
67
template
<
typename
T>
68
struct
ValueType
<
Rad2
::ADvari<T> > {
69
typedef
T
type
;
70
};
71
73
template
<
typename
T>
74
struct
IsADType
<
Rad2
::ADvar<T> > {
75
static
const
bool
value
=
true
;
76
};
77
79
template
<
typename
T>
80
struct
IsADType
<
Rad2
::ADvari<T> > {
81
static
const
bool
value
=
true
;
82
};
83
85
template
<
typename
T>
86
struct
IsScalarType
<
Rad2
::ADvar<T> > {
87
static
const
bool
value
=
false
;
88
};
89
91
template
<
typename
T>
92
struct
IsScalarType
<
Rad2
::ADvari<T> > {
93
static
const
bool
value
=
false
;
94
};
95
97
template
<
typename
T>
98
struct
Value
<
Rad2
::ADvar<T> > {
99
typedef
typename
ValueType< Rad2::ADvar<T>
>
::type
value_type
;
100
static
value_type
eval
(
const
Rad2::ADvar<T>
& x) {
101
return
x.
val
(); }
102
};
103
105
template
<
typename
T>
106
struct
MarkConstant
<
Rad2
::ADvar<T> > {
107
static
void
eval
(
Rad2::ADvar<T>
& x) { AD_Const(x); }
108
};
109
111
template
<
typename
T>
112
struct
MarkConstant
<
Rad2
::ADvari<T> > {
113
static
void
eval
(
Rad2::ADvari<T>
& x) { AD_Const(x); }
114
};
115
117
template
<
typename
T>
118
struct
ScalarValue
<
Rad2
::ADvar<T> > {
119
typedef
typename
ValueType< Rad2::ADvar<T>
>
::type
value_type
;
120
typedef
typename
ScalarType< Rad2::ADvar<T>
>
::type
scalar_type
;
121
static
scalar_type
eval
(
const
Rad2::ADvar<T>
& x) {
122
return
ScalarValue<value_type>::eval
(x.
val
()); }
123
};
124
126
template
<
typename
T>
127
struct
StringName
<
Rad2
::ADvar<T> > {
128
static
std::string
eval
() {
129
return
std::string(
"Sacado::Rad2::ADvar< "
) +
130
StringName<T>::eval
() +
" >"
; }
131
};
132
133
}
// namespace Sacado
134
135
#endif
// SACADO_TRAD_TRAITS_HPP
Sacado_Traits.hpp
SACADO_RAD_PROMOTE_SPEC
#define SACADO_RAD_PROMOTE_SPEC(NS)
Definition
Sacado_Traits.hpp:247
T
#define T
Definition
Sacado_rad.hpp:573
Sacado::Rad2::ADvar
Definition
Sacado_trad2.hpp:734
Sacado::Rad2::ADvari
Definition
Sacado_trad2.hpp:400
Sacado::Rad2::IndepADvar::val
Double val() const
Definition
Sacado_trad2.hpp:643
Sacado::Rad2
Definition
Sacado_trad2.hpp:71
Sacado
Definition
Sacado_mpl_apply.hpp:39
Sacado::IsADType< Rad2::ADvar< T > >::value
static const bool value
Definition
Sacado_trad2_Traits.hpp:75
Sacado::IsADType< Rad2::ADvari< T > >::value
static const bool value
Definition
Sacado_trad2_Traits.hpp:81
Sacado::IsADType
Base template specification for IsADType.
Definition
Sacado_Traits.hpp:337
Sacado::IsScalarType< Rad2::ADvar< T > >::value
static const bool value
Definition
Sacado_trad2_Traits.hpp:87
Sacado::IsScalarType< Rad2::ADvari< T > >::value
static const bool value
Definition
Sacado_trad2_Traits.hpp:93
Sacado::IsScalarType
Base template specification for IsScalarType.
Definition
Sacado_Traits.hpp:346
Sacado::MarkConstant< Rad2::ADvar< T > >::eval
static void eval(Rad2::ADvar< T > &x)
Definition
Sacado_trad2_Traits.hpp:107
Sacado::MarkConstant< Rad2::ADvari< T > >::eval
static void eval(Rad2::ADvari< T > &x)
Definition
Sacado_trad2_Traits.hpp:113
Sacado::MarkConstant
Base template specification for marking constants.
Definition
Sacado_Traits.hpp:404
Sacado::type
Sacado::ScalarType< Rad2::ADvar< T > >::type
ScalarType< T >::type type
Definition
Sacado_trad2_Traits.hpp:51
Sacado::ScalarType< Rad2::ADvari< T > >::type
ScalarType< T >::type type
Definition
Sacado_trad2_Traits.hpp:57
Sacado::ScalarType
Base template specification for ScalarType.
Definition
Sacado_Traits.hpp:303
Sacado::ScalarType::type
T type
Definition
Sacado_Traits.hpp:304
Sacado::ScalarValue< Rad2::ADvar< T > >::eval
static scalar_type eval(const Rad2::ADvar< T > &x)
Definition
Sacado_trad2_Traits.hpp:121
Sacado::ScalarValue< Rad2::ADvar< T > >::value_type
ValueType< Rad2::ADvar< T > >::type value_type
Definition
Sacado_trad2_Traits.hpp:119
Sacado::ScalarValue< Rad2::ADvar< T > >::scalar_type
ScalarType< Rad2::ADvar< T > >::type scalar_type
Definition
Sacado_trad2_Traits.hpp:120
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< Rad2::ADvar< T > >::eval
static std::string eval()
Definition
Sacado_trad2_Traits.hpp:128
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< Rad2::ADvar< T > >::type
T type
Definition
Sacado_trad2_Traits.hpp:63
Sacado::ValueType< Rad2::ADvari< T > >::type
T type
Definition
Sacado_trad2_Traits.hpp:69
Sacado::ValueType
Base template specification for ValueType.
Definition
Sacado_Traits.hpp:320
Sacado::Value< Rad2::ADvar< T > >::eval
static value_type eval(const Rad2::ADvar< T > &x)
Definition
Sacado_trad2_Traits.hpp:100
Sacado::Value< Rad2::ADvar< T > >::value_type
ValueType< Rad2::ADvar< T > >::type value_type
Definition
Sacado_trad2_Traits.hpp:99
Sacado::Value
Base template specification for Value.
Definition
Sacado_Traits.hpp:363
Generated by
1.17.0