Sacado Package Browser (Single Doxygen Collection)
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
new_design
Sacado_Fad_Exp_ViewFad.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_FAD_EXP_VIEWFAD_HPP
31
#define SACADO_FAD_EXP_VIEWFAD_HPP
32
33
#include "
Sacado_Fad_Exp_GeneralFad.hpp
"
34
#include "
Sacado_Fad_Exp_ViewStorage.hpp
"
35
36
#if defined(HAVE_SACADO_KOKKOS)
37
#include "Kokkos_Atomic.hpp"
38
#include "impl/Kokkos_Error.hpp"
39
#endif
40
41
namespace
Sacado
{
42
43
namespace
Fad
{
44
namespace
Exp
{
45
46
template
<
typename
T,
unsigned
static_length,
unsigned
static_str
id
e,
typename
U>
47
using
ViewFad
=
GeneralFad< ViewStorage<T,static_length,static_stride,U>
>;
48
49
// Class representing a pointer to ViewFad so that &ViewFad is supported
50
template
<
typename
T,
unsigned
sl,
unsigned
ss,
typename
U>
51
class
ViewFadPtr
:
public
ViewFad
<T,sl,ss,U> {
52
public
:
53
54
// Storage type base class
55
typedef
ViewFad<T,sl,ss,U>
view_fad_type
;
56
57
// Bring in constructors
58
using
view_fad_type::view_fad_type;
59
60
// Add overload of dereference operator
61
SACADO_INLINE_FUNCTION
62
view_fad_type
*
operator->
() {
return
this
; }
63
64
// Add overload of dereference operator
65
SACADO_INLINE_FUNCTION
66
view_fad_type
&
operator*
() {
return
*
this
; }
67
};
68
69
}
// namespace Exp
70
}
// namespace Fad
71
72
template
<
typename
,
unsigned
,
unsigned
>
struct
ViewFadType;
73
75
template
<
class
S,
unsigned
length,
unsigned
str
id
e >
76
struct
ViewFadType
<
Fad
::Exp::GeneralFad<S>, length, stride > {
77
typedef
Fad::Exp::ViewFad< typename S::value_type,length,stride,Fad::Exp::GeneralFad<S>
>
type
;
78
};
79
81
84
template
<
class
S,
unsigned
length,
unsigned
str
id
e >
85
struct
ViewFadType
< const
Fad
::Exp::GeneralFad<S>, length, stride > {
86
typedef
Fad::Exp::ViewFad< const typename S::value_type,length,stride,Fad::Exp::GeneralFad<S>
>
type
;
87
};
88
89
// Specialization of BaseExprType for ViewFad, to use the base fad type
90
template
<
typename
T,
unsigned
static_length,
unsigned
static_str
id
e,
typename
U>
91
struct
BaseExprType
<
Fad
::Exp::GeneralFad< Fad::Exp::ViewStorage<T,static_length,static_stride,U> > > {
92
typedef
U
type
;
93
};
94
96
100
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
101
struct
ScalarType
<
Fad
::Exp::ViewFad<ValueT,Size,Stride,Base> > {
102
typedef
typename
ScalarType<ValueT>::type
type
;
103
};
104
109
template
<
typename
ValueT,
unsigned
Size,
unsigned
Str
id
e,
typename
Base>
110
struct
ValueType
<
Fad
::Exp::ViewFad<ValueT,Size,Stride,Base> > {
111
typedef
ValueT
type
;
112
};
113
114
}
// namespace Sacado
115
116
#endif
// SACADO_FAD_EXP_VIEWFAD_HPP
SACADO_INLINE_FUNCTION
#define SACADO_INLINE_FUNCTION
Definition
Sacado_ConfigDefs.h:110
Sacado_Fad_Exp_GeneralFad.hpp
Sacado_Fad_Exp_ViewStorage.hpp
Sacado::Fad::Exp::GeneralFad
Forward-mode AD class templated on the storage for the derivative array.
Definition
Sacado_Fad_Exp_GeneralFad.hpp:53
Sacado::Fad::Exp::ViewFadPtr
Definition
Sacado_Fad_Exp_ViewFad.hpp:51
Sacado::Fad::Exp::ViewFadPtr::view_fad_type
ViewFad< T, sl, ss, U > view_fad_type
Definition
Sacado_Fad_Exp_ViewFad.hpp:55
Sacado::Fad::Exp::ViewFadPtr::operator->
SACADO_INLINE_FUNCTION view_fad_type * operator->()
Definition
Sacado_Fad_Exp_ViewFad.hpp:62
Sacado::Fad::Exp::ViewFadPtr::operator*
SACADO_INLINE_FUNCTION view_fad_type & operator*()
Definition
Sacado_Fad_Exp_ViewFad.hpp:66
Sacado::Fad::Exp
Definition
Sacado_Fad_Exp_DFad.hpp:39
Sacado::Fad::Exp::ViewFad
GeneralFad< ViewStorage< T, static_length, static_stride, U > > ViewFad
Definition
Sacado_Fad_Exp_ViewFad.hpp:47
Sacado::Fad
Namespace for forward-mode AD classes.
Definition
Sacado_Fad_Exp_DFad.hpp:38
Sacado
Definition
Sacado_mpl_apply.hpp:39
Sacado::BaseExprType< Fad::Exp::GeneralFad< Fad::Exp::ViewStorage< T, static_length, static_stride, U > > >::type
U type
Definition
Sacado_Fad_Exp_ViewFad.hpp:92
Sacado::BaseExprType
Get the base Fad type from a view/expression.
Definition
Sacado_Traits.hpp:89
Sacado::ScalarType< Fad::Exp::ViewFad< ValueT, Size, Stride, Base > >::type
ScalarType< ValueT >::type type
Definition
Sacado_Fad_Exp_ViewFad.hpp:102
Sacado::ScalarType
Base template specification for ScalarType.
Definition
Sacado_Traits.hpp:303
Sacado::ScalarType::type
T type
Definition
Sacado_Traits.hpp:304
Sacado::ValueType< Fad::Exp::ViewFad< ValueT, Size, Stride, Base > >::type
ValueT type
Definition
Sacado_Fad_Exp_ViewFad.hpp:111
Sacado::ValueType
Base template specification for ValueType.
Definition
Sacado_Traits.hpp:320
Sacado::ViewFadType< Fad::Exp::GeneralFad< S >, length, stride >::type
Fad::Exp::ViewFad< typename S::value_type, length, stride, Fad::Exp::GeneralFad< S > > type
Definition
Sacado_Fad_Exp_ViewFad.hpp:77
Sacado::ViewFadType< const Fad::Exp::GeneralFad< S >, length, stride >::type
Fad::Exp::ViewFad< const typename S::value_type, length, stride, Fad::Exp::GeneralFad< S > > type
Definition
Sacado_Fad_Exp_ViewFad.hpp:86
Sacado::ViewFadType
Get view type for any Fad type.
Definition
Sacado_Traits.hpp:94
Generated by
1.17.0