Sacado Package Browser (Single Doxygen Collection)
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Sacado_CacheFad_ViewFadTraits.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_CACHEFAD_VIEWFADTRAITS_HPP
50
#define SACADO_CACHEFAD_VIEWFADTRAITS_HPP
51
52
#include "
Sacado_Traits.hpp
"
53
54
// Forward declarations
55
namespace
Sacado
{
56
namespace
CacheFad
{
57
template
<
typename
T,
unsigned
,
unsigned
,
typename
>
class
ViewFad
;
58
}
59
}
60
61
namespace
Sacado
{
62
64
SACADO_VFAD_PROMOTE_SPEC
(
CacheFad
)
65
66
67
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
68
struct
ScalarType
<
CacheFad
::ViewFad<ValueT,Size,Stride,Base> > {
69
typedef
typename
CacheFad::ViewFad<ValueT,Size,Stride,Base>::ScalarT
type
;
70
};
71
73
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
74
struct
ValueType
<
CacheFad
::ViewFad<ValueT,Size,Stride,Base> > {
75
typedef
ValueT
type
;
76
};
77
79
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
80
struct
IsADType
<
CacheFad
::ViewFad<ValueT,Size,Stride,Base> > {
81
static
const
bool
value
=
true
;
82
};
83
85
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
86
struct
IsScalarType
<
CacheFad
::ViewFad<ValueT,Size,Stride,Base> > {
87
static
const
bool
value
=
false
;
88
};
89
91
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
92
struct
Value
<
CacheFad
::ViewFad<ValueT,Size,Stride,Base> > {
93
typedef
typename
ValueType< CacheFad::ViewFad<ValueT,Size,Stride,Base>
>
::type
value_type
;
94
SACADO_INLINE_FUNCTION
95
static
const
value_type
&
eval
(
const
CacheFad::ViewFad<ValueT,Size,Stride,Base>
& x) {
96
return
x.val(); }
97
};
98
100
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
101
struct
ScalarValue
<
CacheFad
::ViewFad<ValueT,Size,Stride,Base> > {
102
typedef
typename
ValueType< CacheFad::ViewFad<ValueT,Size,Stride,Base>
>
::type
value_type
;
103
typedef
typename
ScalarType< CacheFad::ViewFad<ValueT,Size,Stride,Base>
>
::type
scalar_type
;
104
SACADO_INLINE_FUNCTION
105
static
const
scalar_type
&
eval
(
const
CacheFad::ViewFad<ValueT,Size,Stride,Base>
& x) {
106
return
ScalarValue<value_type>::eval
(x.val()); }
107
};
108
110
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
111
struct
StringName
<
CacheFad
::ViewFad<ValueT,Size,Stride,Base> > {
112
static
std::string
eval
() {
113
return
std::string(
"Sacado::CacheFad::ViewFad< "
) +
114
StringName<ValueT>::eval
() +
" >"
; }
115
};
116
118
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
119
struct
IsEqual
<
CacheFad
::ViewFad<ValueT,Size,Stride,Base> > {
120
SACADO_INLINE_FUNCTION
121
static
bool
eval
(
const
CacheFad::ViewFad<ValueT,Size,Stride,Base>
& x,
122
const
CacheFad::ViewFad<ValueT,Size,Stride,Base>
& y) {
123
return
x.isEqualTo(y);
124
}
125
};
126
128
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
129
struct
IsStaticallySized
<
CacheFad
::ViewFad<ValueT,Size,Stride,Base> > {
130
static
const
bool
value
=
false
;
131
};
132
133
}
// namespace Sacado
134
135
// ViewFad is not a proper scalar type, so we don't define any of the
136
// Teuchos traits classes
137
138
#endif
// SACADO_CACHEFAD_VIEWFADTRAITS_HPP
SACADO_INLINE_FUNCTION
#define SACADO_INLINE_FUNCTION
Definition
Sacado_ConfigDefs.h:110
Sacado_Traits.hpp
SACADO_VFAD_PROMOTE_SPEC
#define SACADO_VFAD_PROMOTE_SPEC(NS)
Definition
Sacado_Traits.hpp:245
Sacado::CacheFad::ViewFad
Definition
Sacado_CacheFad_ViewFadTraits.hpp:57
Sacado::CacheFad
Namespace for forward-mode AD classes w/caching.
Definition
Sacado_CacheFad_DFadTraits.hpp:56
Sacado
Definition
Sacado_mpl_apply.hpp:39
Sacado::IsADType< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::value
static const bool value
Definition
Sacado_CacheFad_ViewFadTraits.hpp:81
Sacado::IsADType
Base template specification for IsADType.
Definition
Sacado_Traits.hpp:337
Sacado::IsEqual< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::eval
static SACADO_INLINE_FUNCTION bool eval(const CacheFad::ViewFad< ValueT, Size, Stride, Base > &x, const CacheFad::ViewFad< ValueT, Size, Stride, Base > &y)
Definition
Sacado_CacheFad_ViewFadTraits.hpp:121
Sacado::IsEqual
Base template specification for testing equivalence.
Definition
Sacado_Traits.hpp:415
Sacado::IsScalarType< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::value
static const bool value
Definition
Sacado_CacheFad_ViewFadTraits.hpp:87
Sacado::IsScalarType
Base template specification for IsScalarType.
Definition
Sacado_Traits.hpp:346
Sacado::IsStaticallySized< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::value
static const bool value
Definition
Sacado_CacheFad_ViewFadTraits.hpp:130
Sacado::IsStaticallySized
Base template specification for testing whether type is statically sized.
Definition
Sacado_Traits.hpp:421
Sacado::type
Sacado::ScalarType< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::type
CacheFad::ViewFad< ValueT, Size, Stride, Base >::ScalarT type
Definition
Sacado_CacheFad_ViewFadTraits.hpp:69
Sacado::ScalarType
Base template specification for ScalarType.
Definition
Sacado_Traits.hpp:303
Sacado::ScalarValue< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::scalar_type
ScalarType< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::type scalar_type
Definition
Sacado_CacheFad_ViewFadTraits.hpp:103
Sacado::ScalarValue< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::eval
static SACADO_INLINE_FUNCTION const scalar_type & eval(const CacheFad::ViewFad< ValueT, Size, Stride, Base > &x)
Definition
Sacado_CacheFad_ViewFadTraits.hpp:105
Sacado::ScalarValue< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::value_type
ValueType< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::type value_type
Definition
Sacado_CacheFad_ViewFadTraits.hpp:102
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< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::eval
static std::string eval()
Definition
Sacado_CacheFad_ViewFadTraits.hpp:112
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< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::type
ValueT type
Definition
Sacado_CacheFad_ViewFadTraits.hpp:75
Sacado::ValueType
Base template specification for ValueType.
Definition
Sacado_Traits.hpp:320
Sacado::Value< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::value_type
ValueType< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::type value_type
Definition
Sacado_CacheFad_ViewFadTraits.hpp:93
Sacado::Value< CacheFad::ViewFad< ValueT, Size, Stride, Base > >::eval
static SACADO_INLINE_FUNCTION const value_type & eval(const CacheFad::ViewFad< ValueT, Size, Stride, Base > &x)
Definition
Sacado_CacheFad_ViewFadTraits.hpp:95
Sacado::Value
Base template specification for Value.
Definition
Sacado_Traits.hpp:363
Generated by
1.17.0