47 struct C :
public A {};
69 template <
typename ad_type>
76 const bool is_value_ad =
78 const bool is_ad_value =
80 const bool is_scalar_ad =
82 const bool is_ad_scalar =
86 const bool is_int_ad =
95 #ifdef HAVE_SACADO_CXX11
99 typedef decltype(std::declval<ad_type>()*std::declval<ad_type>()) ad_expr_type;
100 typedef decltype(std::declval<value_type>()*std::declval<value_type>()) val_expr_type;
102 const bool is_ad_expr_ad =
104 const bool is_val_expr_ad =
121 typedef typename ad_type::value_type value_type;
125 success = success && test_ad_conversions<ad_type>(out);
126 success = success && test_ad_conversions<ad_ad_type>(out);
131 x.fastAccessDx(i) = 2.0;
132 ad_ad_type y = x + x;
142 ad_ad_type z = (x + x) + y;
169 success = success && test_ad_conversions<ad_type>(out);
170 success = success && test_ad_conversions<ad_ad_type>(out);
185 success = success && test_ad_conversions<ad_type>(out);
186 success = success && test_ad_conversions<fad_ad_type>(out);
197 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions,
Fad_SLFadType )
198 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions,
Fad_SFadType )
199 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions,
Fad_DMFadType )
200 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions,
Fad_DVFadType )
201 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions,
Fad_SimpleFadType )
202 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ViewConversions,
Fad_VFadType )
208 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions, ELRFad_DFadType )
209 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions, ELRFad_SLFadType )
210 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions, ELRFad_SFadType )
211 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ViewConversions, ELRFad_VFadType )
217 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions, CacheFad_DFadType )
218 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions, CacheFad_SLFadType )
219 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions, CacheFad_SFadType )
220 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ViewConversions, CacheFad_VFadType )
226 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions, ELRCacheFad_DFadType )
227 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions, ELRCacheFad_SLFadType )
228 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ADConversions, ELRCacheFad_SFadType )
229 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, ViewConversions, ELRCacheFad_VFadType )
234 typedef Sacado::LFad::LogicalSparse<
double,
bool>
LFadType;
235 typedef Sacado::FlopCounterPack::ScalarFlopCounter<
double>
SFCType;
241 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, OtherConversions, LFadType )
242 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, OtherConversions, SFCType )
243 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, OtherConversions, TaylorType )
244 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, OtherConversions, CacheTaylorType )
245 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, OtherConversions, RadType )
246 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, OtherConversions, Rad2Type )
247 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Conversion, OtherConversions, RadVecType )
254 int main(
int argc,
char* argv[] ) {
MemPool * getMemoryPool(unsigned int dim)
Get memory pool for supplied dimension dim.
Sacado::CacheFad::SLFad< double, 10 > Fad_SLFadType
Sacado::Fad::DMFad< double > Fad_DMFadType
Forward-mode AD class using dynamic memory allocation.
#define TEST_EQUALITY_CONST(v1, v2)
Sacado::CacheFad::DFad< double > Fad_DFadType
GeneralFad< StaticStorage< T, Num > > SLFad
TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL(Conversion, ADConversions, AD)
Forward-mode AD class using dynamic memory allocation but no expression templates.
F::template apply< A1, A2, A3, A4, A5 >::type type
TEUCHOS_UNIT_TEST(Conversion, IsConvertible)
Sacado::Fad::DVFad< double > Fad_DVFadType
const int global_fad_size
Sacado::Fad::ViewFad< double, global_fad_size, 1, Fad_DFadType > Fad_VFadType
static int runUnitTestsFromMain(int argc, char *argv[])
GeneralFad< DynamicStorage< T > > DFad
Determine whether a given type is a view.
Derivative array storage class using dynamic memory allocation.
Sacado::Fad::SimpleFad< double > Fad_SimpleFadType
Forward-mode AD class using dynamic memory allocation and expression templates.
Templated flop counter class.
#define TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT(TEST_GROUP, TEST_NAME, TYPE)
Forward-mode AD class using dynamic memory allocation and expression templates.
#define TEST_EQUALITY(v1, v2)
GeneralFad< ViewStorage< T, static_length, static_stride, U > > ViewFad
bool test_ad_conversions(Teuchos::FancyOStream &out)
GeneralFad< StaticFixedStorage< T, Num > > SFad
Sacado::CacheFad::SFad< double, 5 > Fad_SFadType