30 #include "Teuchos_UnitTestHarness.hpp" 31 #include "Teuchos_UnitTestRepository.hpp" 32 #include "Teuchos_GlobalMPISession.hpp" 33 #include "Teuchos_TestingHelpers.hpp" 44 typedef typename ad_type::value_type value_type;
50 x.fastAccessDx(i) = 2.0;
52 ad_type y = x > 0 ? -x : x;
54 TEST_EQUALITY_CONST( y.val(), -1.5 );
56 TEST_EQUALITY_CONST( y.dx(i), -2.0 );
62 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Ternary, Ternary,
Fad_DFadType )
63 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Ternary, Ternary,
Fad_SLFadType )
64 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Ternary, Ternary,
Fad_SFadType )
69 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Ternary, Ternary,
ELRFad_DFadType )
71 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Ternary, Ternary,
ELRFad_SFadType )
87 #if defined(SACADO_ENABLE_NEW_DESIGN) && !defined(SACADO_NEW_FAD_DESIGN_IS_DEFAULT) 91 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Ternary, Ternary, ExpFad_DFadType )
92 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Ternary, Ternary, ExpFad_SLFadType )
93 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( Ternary, Ternary, ExpFad_SFadType )
96 int main(
int argc,
char* argv[] ) {
97 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
98 return Teuchos::UnitTestRepository::runUnitTestsFromMain(argc, argv);
GeneralFad< StaticStorage< T, Num > > SLFad
Sacado::Fad::SFad< double, global_fad_size > Fad_SFadType
Sacado::Fad::SLFad< double, global_fad_size > Fad_SLFadType
GeneralFad< DynamicStorage< T > > DFad
Forward-mode AD class templated on the storage for the derivative array.
const int global_fad_size
Sacado::Fad::DFad< double > Fad_DFadType
int main(int argc, char *argv[])
TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL(Ternary, Ternary, AD)
GeneralFad< StaticFixedStorage< T, Num > > SFad