Changeset 23244
- Timestamp:
- 09/10/18 21:23:01 (7 years ago)
- Location:
- issm/trunk-jpl/src/c/shared/Numerics
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/shared/Numerics/extrema.cpp
r15037 r23244 11 11 #include "./types.h" 12 12 13 #ifndef _HAVE_CODIPACK_// already defined in codipack headers 13 14 IssmDouble min(IssmDouble a,IssmDouble b){ 14 15 if (a<b)return a; 15 16 else return b; 16 17 } 18 #endif 17 19 int min(int a,int b){ 18 20 if (a<b)return a; 19 21 else return b; 20 22 } 23 #ifndef _HAVE_CODIPACK_// already defined in codipack headers 21 24 IssmDouble max(IssmDouble a,IssmDouble b){ 22 25 if (a>b)return a; 23 26 else return b; 24 27 } 28 #endif 25 29 int max(int a,int b){ 26 30 if (a>b)return a; … … 28 32 } 29 33 30 #ifdef _HAVE_AD OLC_34 #ifdef _HAVE_AD_ 31 35 IssmPDouble min(IssmPDouble a,IssmPDouble b){ 32 36 if (a<b)return a; -
issm/trunk-jpl/src/c/shared/Numerics/isnan.cpp
r20842 r23244 13 13 return std::isnan(X.getValue()); 14 14 } 15 #endif16 17 #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)18 15 template <> int xIsInf<adouble> (const adouble& X){ 19 16 return std::isinf(X.getValue()); 20 17 } 21 18 #endif 19 20 #if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_) 21 template <> int xIsNan<IssmDouble> (const IssmDouble& X){ 22 return std::isnan(X.getValue()); 23 } 24 template <> int xIsInf<IssmDouble> (const IssmDouble& X){ 25 return std::isinf(X.getValue()); 26 } 27 #endif -
issm/trunk-jpl/src/c/shared/Numerics/isnan.h
r20669 r23244 33 33 #endif 34 34 35 #if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_) 36 #include "./types.h" 37 template <> int xIsNan<IssmDouble> (const IssmDouble& X); 38 template <> int xIsInf<IssmDouble> (const IssmDouble& X); 35 39 #endif 40 41 #endif -
issm/trunk-jpl/src/c/shared/Numerics/numerics.h
r20021 r23244 20 20 #include "./OptPars.h" 21 21 22 #if !defined(_HAVE_CODIPACK_) 23 // already defined in codipack headers 22 24 IssmDouble min(IssmDouble a,IssmDouble b); 23 25 IssmDouble max(IssmDouble a,IssmDouble b); 26 #endif 24 27 25 #ifdef _HAVE_AD OLC_28 #ifdef _HAVE_AD_ 26 29 IssmPDouble min(IssmPDouble a,IssmPDouble b); 27 30 IssmPDouble max(IssmPDouble a,IssmPDouble b); -
issm/trunk-jpl/src/c/shared/Numerics/recast.h
r18521 r23244 15 15 #endif 16 16 17 #if !defined(_HAVE_AD OLC_) || defined(_WRAPPERS_)17 #if !defined(_HAVE_AD_) || defined(_WRAPPERS_) 18 18 19 19 template<class To, class From> To reCast(const From& from) { … … 34 34 * partial specialization 35 35 */ 36 #ifdef _HAVE_ADOLC_ 36 37 template<class To> struct ForPartialSpecialization<To,adouble> { 37 38 static To reCast(const adouble& from ) { return (To) (from.getValue());} 38 39 }; 40 #endif 41 #ifdef _HAVE_CODIPACK_ 42 template<class To> struct ForPartialSpecialization<To,IssmDouble> { 43 static To reCast(const IssmDouble& from ) { return (To) (from.getValue());} 44 }; 45 #endif 39 46 40 47 #endif -
issm/trunk-jpl/src/c/shared/Numerics/types.h
r15838 r23244 22 22 23 23 #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_) 24 /*ADOLC typedefs*/ 24 25 #include "adolc/adolc.h" 25 // for active variables 26 typedef adouble IssmDouble; 27 // for passive variables 26 typedef adouble IssmDouble; /*for active variables*/ 27 typedef double IssmPDouble; /*for passive variables*/ 28 29 #elif defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_) 30 /*CoDiPack typedefs*/ 31 #include <codi.hpp> 32 typedef codi::RealReverse IssmDouble; 28 33 typedef double IssmPDouble; 34 35 /*Non-AD typedefs*/ 29 36 #else 30 // see above31 37 typedef double IssmDouble; 32 // see above33 38 typedef IssmDouble IssmPDouble; 34 39 #endif
Note:
See TracChangeset
for help on using the changeset viewer.