diff --git a/ADOL-C/c_interface/ADOLC_TB_interface.cpp b/ADOL-C/c_interface/ADOLC_TB_interface.cpp index 2d96209c..1e7036d4 100644 --- a/ADOL-C/c_interface/ADOLC_TB_interface.cpp +++ b/ADOL-C/c_interface/ADOLC_TB_interface.cpp @@ -6,8 +6,7 @@ Constructor & Destructor for class tape-based adouble */ extern "C" { - // Constructor - TBAdoubleHandle create_tb_adouble(double x) + TBAdoubleHandle create_tb_adouble(const double x) { return new adouble(x); } @@ -16,7 +15,6 @@ extern "C" return new adouble(); } - // Destructor void free_tb_adouble(TBAdoubleHandle a) { return delete static_cast(a); @@ -43,11 +41,11 @@ extern "C" { return new adouble(*static_cast(a) + *static_cast(b)); } - TBAdoubleHandle add_double_tb_adouble(double x, TBAdoubleHandle b) + TBAdoubleHandle add_double_tb_adouble(const double x, TBAdoubleHandle b) { return new adouble(x + *static_cast(b)); } - TBAdoubleHandle add_tb_adouble_double(TBAdoubleHandle a, double x) + TBAdoubleHandle add_tb_adouble_double(TBAdoubleHandle a, const double x) { return new adouble(*static_cast(a) + x); } @@ -55,11 +53,11 @@ extern "C" { return new adouble(*static_cast(a) * *static_cast(b)); } - TBAdoubleHandle mult_double_tb_adouble(double x, TBAdoubleHandle b) + TBAdoubleHandle mult_double_tb_adouble(const double x, TBAdoubleHandle b) { return new adouble(x * *static_cast(b)); } - TBAdoubleHandle mult_tb_adouble_double(TBAdoubleHandle a, double x) + TBAdoubleHandle mult_tb_adouble_double(TBAdoubleHandle a, const double x) { return new adouble(*static_cast(a) * x); } @@ -67,11 +65,11 @@ extern "C" { return new adouble(*static_cast(a) - *static_cast(b)); } - TBAdoubleHandle subtr_double_tb_adouble(double x, TBAdoubleHandle b) + TBAdoubleHandle subtr_double_tb_adouble(const double x, TBAdoubleHandle b) { return new adouble(x - *static_cast(b)); } - TBAdoubleHandle subtr_tb_adouble_double(TBAdoubleHandle a, double x) + TBAdoubleHandle subtr_tb_adouble_double(TBAdoubleHandle a, const double x) { return new adouble(*static_cast(a) - x); } @@ -79,11 +77,11 @@ extern "C" { return new adouble(*static_cast(a) / *static_cast(b)); } - TBAdoubleHandle div_double_tb_adouble(double x, TBAdoubleHandle b) + TBAdoubleHandle div_double_tb_adouble(const double x, TBAdoubleHandle b) { return new adouble(x / *static_cast(b)); } - TBAdoubleHandle div_tb_adouble_double(TBAdoubleHandle a, double x) + TBAdoubleHandle div_tb_adouble_double(TBAdoubleHandle a, const double x) { return new adouble(*static_cast(a) / x); } @@ -91,11 +89,11 @@ extern "C" { return new adouble(fmax(*static_cast(a), *static_cast(b))); } - TBAdoubleHandle max_double_tb_adouble(double x, TBAdoubleHandle b) + TBAdoubleHandle max_double_tb_adouble(const double x, TBAdoubleHandle b) { return new adouble(fmax(x, *static_cast(b))); } - TBAdoubleHandle max_tb_adouble_double(TBAdoubleHandle a, double x) + TBAdoubleHandle max_tb_adouble_double(TBAdoubleHandle a, const double x) { return new adouble(fmax(*static_cast(a), x)); } @@ -103,11 +101,11 @@ extern "C" { return new adouble(fmin(*static_cast(a), *static_cast(b))); } - TBAdoubleHandle min_double_tb_adouble(double x, TBAdoubleHandle b) + TBAdoubleHandle min_double_tb_adouble(const double x, TBAdoubleHandle b) { return new adouble(fmin(x, *static_cast(b))); } - TBAdoubleHandle min_tb_adouble_double(TBAdoubleHandle a, double x) + TBAdoubleHandle min_tb_adouble_double(TBAdoubleHandle a, const double x) { return new adouble(fmin(*static_cast(a), x)); } @@ -115,7 +113,7 @@ extern "C" { return new adouble(pow(*static_cast(a), *static_cast(b))); } - TBAdoubleHandle pow_tb_adouble_double(TBAdoubleHandle a, double x) + TBAdoubleHandle pow_tb_adouble_double(TBAdoubleHandle a, const double x) { return new adouble(pow(*static_cast(a), x)); } @@ -123,11 +121,11 @@ extern "C" { return *static_cast(a) >= *static_cast(b); } - bool ge_double_tb_adouble(double x, TBAdoubleHandle b) + bool ge_double_tb_adouble(const double x, TBAdoubleHandle b) { return x >= *static_cast(b); } - bool ge_tb_adouble_double(TBAdoubleHandle a, double x) + bool ge_tb_adouble_double(TBAdoubleHandle a, const double x) { return *static_cast(a) >= x; } @@ -135,11 +133,11 @@ extern "C" { return *static_cast(a) > *static_cast(b); } - bool g_double_tb_adouble(double x, TBAdoubleHandle b) + bool g_double_tb_adouble(const double x, TBAdoubleHandle b) { return x > *static_cast(b); } - bool g_tb_adouble_double(TBAdoubleHandle a, double x) + bool g_tb_adouble_double(TBAdoubleHandle a, const double x) { return *static_cast(a) > x; } @@ -147,11 +145,11 @@ extern "C" { return *static_cast(a) <= *static_cast(b); } - bool le_double_tb_adouble(double x, TBAdoubleHandle b) + bool le_double_tb_adouble(const double x, TBAdoubleHandle b) { return x <= *static_cast(b); } - bool le_tb_adouble_double(TBAdoubleHandle a, double x) + bool le_tb_adouble_double(TBAdoubleHandle a, const double x) { return *static_cast(a) <= x; } @@ -159,11 +157,11 @@ extern "C" { return *static_cast(a) < *static_cast(b); } - bool l_double_tb_adouble(double x, TBAdoubleHandle b) + bool l_double_tb_adouble(const double x, TBAdoubleHandle b) { return x < *static_cast(b); } - bool l_tb_adouble_double(TBAdoubleHandle a, double x) + bool l_tb_adouble_double(TBAdoubleHandle a, const double x) { return *static_cast(a) < x; } @@ -171,11 +169,11 @@ extern "C" { return *static_cast(a) == *static_cast(b); } - bool eq_double_tb_adouble(double x, TBAdoubleHandle b) + bool eq_double_tb_adouble(const double x, TBAdoubleHandle b) { return x == *static_cast(b); } - bool eq_tb_adouble_double(TBAdoubleHandle a, double x) + bool eq_tb_adouble_double(TBAdoubleHandle a, const double x) { return *static_cast(a) == x; } @@ -255,7 +253,7 @@ extern "C" { return new adouble(floor(*static_cast(a))); } - TBAdoubleHandle tb_ldexp(TBAdoubleHandle a, int n) + TBAdoubleHandle tb_ldexp(TBAdoubleHandle a, const int n) { return new adouble(ldexp(*static_cast(a), n)); } @@ -278,7 +276,7 @@ extern "C" { return trace_off(flag); } - void create_independent(TBAdoubleHandle a, double x) + void create_independent(TBAdoubleHandle a, const double x) { *static_cast(a) <<= x; } diff --git a/ADOL-C/c_interface/ADOLC_TB_interface.h b/ADOL-C/c_interface/ADOLC_TB_interface.h index df889959..438d42e4 100644 --- a/ADOL-C/c_interface/ADOLC_TB_interface.h +++ b/ADOL-C/c_interface/ADOLC_TB_interface.h @@ -19,7 +19,7 @@ extern "C" { #endif // Constructor - TBAdoubleHandle create_tb_adouble(double x); + TBAdoubleHandle create_tb_adouble(const double x); TBAdoubleHandle create_tb_adouble_empty(); // Destructor @@ -48,51 +48,51 @@ extern "C" { #endif TBAdoubleHandle add_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - TBAdoubleHandle add_double_tb_adouble(double x, TBAdoubleHandle b); - TBAdoubleHandle add_tb_adouble_double(TBAdoubleHandle a, double x); + TBAdoubleHandle add_double_tb_adouble(const double x, TBAdoubleHandle b); + TBAdoubleHandle add_tb_adouble_double(TBAdoubleHandle a, const double x); TBAdoubleHandle mult_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - TBAdoubleHandle mult_double_tb_adouble(double x, TBAdoubleHandle b); - TBAdoubleHandle mult_tb_adouble_double(TBAdoubleHandle a, double x); + TBAdoubleHandle mult_double_tb_adouble(const double x, TBAdoubleHandle b); + TBAdoubleHandle mult_tb_adouble_double(TBAdoubleHandle a, const double x); TBAdoubleHandle subtr_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - TBAdoubleHandle subtr_double_tb_adouble(double x, TBAdoubleHandle b); - TBAdoubleHandle subtr_tb_adouble_double(TBAdoubleHandle a, double x); + TBAdoubleHandle subtr_double_tb_adouble(const double x, TBAdoubleHandle b); + TBAdoubleHandle subtr_tb_adouble_double(TBAdoubleHandle a, const double x); TBAdoubleHandle div_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - TBAdoubleHandle div_double_tb_adouble(double x, TBAdoubleHandle b); - TBAdoubleHandle div_tb_adouble_double(TBAdoubleHandle a, double x); + TBAdoubleHandle div_double_tb_adouble(const double x, TBAdoubleHandle b); + TBAdoubleHandle div_tb_adouble_double(TBAdoubleHandle a, const double x); TBAdoubleHandle max_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - TBAdoubleHandle max_double_tb_adouble(double x, TBAdoubleHandle b); - TBAdoubleHandle max_tb_adouble_double(TBAdoubleHandle a, double x); + TBAdoubleHandle max_double_tb_adouble(const double x, TBAdoubleHandle b); + TBAdoubleHandle max_tb_adouble_double(TBAdoubleHandle a, const double x); TBAdoubleHandle min_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - TBAdoubleHandle min_double_tb_adouble(double x, TBAdoubleHandle b); - TBAdoubleHandle min_tb_adouble_double(TBAdoubleHandle a, double x); + TBAdoubleHandle min_double_tb_adouble(const double x, TBAdoubleHandle b); + TBAdoubleHandle min_tb_adouble_double(TBAdoubleHandle a, const double x); TBAdoubleHandle pow_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - TBAdoubleHandle pow_tb_adouble_double(TBAdoubleHandle a, double x); + TBAdoubleHandle pow_tb_adouble_double(TBAdoubleHandle a, const double x); bool ge_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - bool ge_double_tb_adouble(double x, TBAdoubleHandle b); - bool ge_tb_adouble_double(TBAdoubleHandle a, double x); + bool ge_double_tb_adouble(const double x, TBAdoubleHandle b); + bool ge_tb_adouble_double(TBAdoubleHandle a, const double x); bool g_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - bool g_double_tb_adouble(double x, TBAdoubleHandle b); - bool g_tb_adouble_double(TBAdoubleHandle a, double x); + bool g_double_tb_adouble(const double x, TBAdoubleHandle b); + bool g_tb_adouble_double(TBAdoubleHandle a, const double x); bool le_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - bool le_double_tb_adouble(double x, TBAdoubleHandle b); - bool le_tb_adouble_double(TBAdoubleHandle a, double x); + bool le_double_tb_adouble(const double x, TBAdoubleHandle b); + bool le_tb_adouble_double(TBAdoubleHandle a, const double x); bool l_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - bool l_double_tb_adouble(double x, TBAdoubleHandle b); - bool l_tb_adouble_double(TBAdoubleHandle a, double x); + bool l_double_tb_adouble(const double x, TBAdoubleHandle b); + bool l_tb_adouble_double(TBAdoubleHandle a, const double x); bool eq_tb_adouble(TBAdoubleHandle a, TBAdoubleHandle b); - bool eq_double_tb_adouble(double x, TBAdoubleHandle b); - bool eq_tb_adouble_double(TBAdoubleHandle a, double x); + bool eq_double_tb_adouble(const double x, TBAdoubleHandle b); + bool eq_tb_adouble_double(TBAdoubleHandle a, const double x); TBAdoubleHandle tb_abs(TBAdoubleHandle a); TBAdoubleHandle tb_sqrt(TBAdoubleHandle a); @@ -128,7 +128,7 @@ extern "C" #endif int c_trace_on(short int tag, int keep = 0); void c_trace_off(int flag = 0); - void create_independent(TBAdoubleHandle a, double x); + void create_independent(TBAdoubleHandle a, const double x); void create_dependent(TBAdoubleHandle a, double *y); size_t num_independent(short tape_id); size_t num_dependent(short tape_id); diff --git a/ADOL-C/c_interface/ADOLC_TL_interface.cpp b/ADOL-C/c_interface/ADOLC_TL_interface.cpp index 7a08d62a..de85c659 100644 --- a/ADOL-C/c_interface/ADOLC_TL_interface.cpp +++ b/ADOL-C/c_interface/ADOLC_TL_interface.cpp @@ -6,7 +6,6 @@ Constructor & Destructor for class tape-less adouble */ extern "C" { - // Constructor TLAdoubleHandle create_tl_adouble(const double x) { return new adtl::adouble(x); @@ -19,7 +18,6 @@ extern "C" { return new adtl::adouble(val, ad_val); } - // Destructor void free_tl_adouble(TLAdoubleHandle a) { return delete static_cast(a); @@ -46,20 +44,20 @@ extern "C" return static_cast(a)->setADValue(val); } - void set_tl_ad_value_idx(TLAdoubleHandle a, size_t pos, const double val) + void set_tl_ad_value_idx(TLAdoubleHandle a, const size_t pos, const double val) { return static_cast(a)->setADValue(pos, val); } - double get_tl_value(TLAdoubleHandle a) + double get_tl_value(const TLAdoubleHandle a) { return static_cast(a)->getValue(); } - const double *get_tl_ad_values(TLAdoubleHandle a) + const double *get_tl_ad_values(const TLAdoubleHandle a) { return (static_cast(a))->getADValue(); } - double get_tl_ad_value_idx(TLAdoubleHandle a, const size_t pos) + double get_tl_ad_value_idx(const TLAdoubleHandle a, const size_t pos) { return static_cast(a)->getADValue(pos); } @@ -70,15 +68,15 @@ Arithmetics for class adouble */ extern "C" { - TLAdoubleHandle add_tl_adouble(const TLAdoubleHandle a, const TLAdoubleHandle b) + TLAdoubleHandle add_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b) { return new adtl::adouble(*static_cast(a) + *static_cast(b)); } - TLAdoubleHandle add_double_tl_adouble(double x, TLAdoubleHandle b) + TLAdoubleHandle add_double_tl_adouble(const double x, TLAdoubleHandle b) { return new adtl::adouble(x + *static_cast(b)); } - TLAdoubleHandle add_tl_adouble_double(TLAdoubleHandle a, double x) + TLAdoubleHandle add_tl_adouble_double(TLAdoubleHandle a, const double x) { return new adtl::adouble(*static_cast(a) + x); } @@ -86,11 +84,11 @@ extern "C" { return new adtl::adouble(*static_cast(a) * *static_cast(b)); } - TLAdoubleHandle mult_double_tl_adouble(double x, TLAdoubleHandle b) + TLAdoubleHandle mult_double_tl_adouble(const double x, TLAdoubleHandle b) { return new adtl::adouble(x * *static_cast(b)); } - TLAdoubleHandle mult_tl_adouble_double(TLAdoubleHandle a, double x) + TLAdoubleHandle mult_tl_adouble_double(TLAdoubleHandle a, const double x) { return new adtl::adouble(*static_cast(a) * x); } @@ -98,11 +96,11 @@ extern "C" { return new adtl::adouble(*static_cast(a) - *static_cast(b)); } - TLAdoubleHandle subtr_double_tl_adouble(double x, TLAdoubleHandle b) + TLAdoubleHandle subtr_double_tl_adouble(const double x, TLAdoubleHandle b) { return new adtl::adouble(x - *static_cast(b)); } - TLAdoubleHandle subtr_tl_adouble_double(TLAdoubleHandle a, double x) + TLAdoubleHandle subtr_tl_adouble_double(TLAdoubleHandle a, const double x) { return new adtl::adouble(*static_cast(a) - x); } @@ -110,11 +108,11 @@ extern "C" { return new adtl::adouble(*static_cast(a) / *static_cast(b)); } - TLAdoubleHandle div_double_tl_adouble(double x, TLAdoubleHandle b) + TLAdoubleHandle div_double_tl_adouble(const double x, TLAdoubleHandle b) { return new adtl::adouble(x / *static_cast(b)); } - TLAdoubleHandle div_tl_adouble_double(TLAdoubleHandle a, double x) + TLAdoubleHandle div_tl_adouble_double(TLAdoubleHandle a, const double x) { return new adtl::adouble(*static_cast(a) / x); } @@ -122,11 +120,11 @@ extern "C" { return new adtl::adouble(fmax(*static_cast(a), *static_cast(b))); } - TLAdoubleHandle max_double_tl_adouble(double x, TLAdoubleHandle b) + TLAdoubleHandle max_double_tl_adouble(const double x, TLAdoubleHandle b) { return new adtl::adouble(fmax(x, *static_cast(b))); } - TLAdoubleHandle max_tl_adouble_double(TLAdoubleHandle a, double x) + TLAdoubleHandle max_tl_adouble_double(TLAdoubleHandle a, const double x) { return new adtl::adouble(fmax(*static_cast(a), x)); } @@ -134,11 +132,11 @@ extern "C" { return new adtl::adouble(fmin(*static_cast(a), *static_cast(b))); } - TLAdoubleHandle min_double_tl_adouble(double x, TLAdoubleHandle b) + TLAdoubleHandle min_double_tl_adouble(const double x, TLAdoubleHandle b) { return new adtl::adouble(fmin(x, *static_cast(b))); } - TLAdoubleHandle min_tl_adouble_double(TLAdoubleHandle a, double x) + TLAdoubleHandle min_tl_adouble_double(TLAdoubleHandle a, const double x) { return new adtl::adouble(fmin(*static_cast(a), x)); } @@ -146,7 +144,7 @@ extern "C" { return new adtl::adouble(pow(*static_cast(a), *static_cast(b))); } - TLAdoubleHandle pow_tl_adouble_double(TLAdoubleHandle a, double x) + TLAdoubleHandle pow_tl_adouble_double(TLAdoubleHandle a, const double x) { return new adtl::adouble(pow(*static_cast(a), x)); } @@ -154,11 +152,11 @@ extern "C" { return *static_cast(a) >= *static_cast(b); } - bool ge_double_tl_adouble(double x, TLAdoubleHandle b) + bool ge_double_tl_adouble(const double x, TLAdoubleHandle b) { return x >= *static_cast(b); } - bool ge_tl_adouble_double(TLAdoubleHandle a, double x) + bool ge_tl_adouble_double(TLAdoubleHandle a, const double x) { return *static_cast(a) >= x; } @@ -166,11 +164,11 @@ extern "C" { return *static_cast(a) > *static_cast(b); } - bool g_double_tl_adouble(double x, TLAdoubleHandle b) + bool g_double_tl_adouble(const double x, TLAdoubleHandle b) { return x > *static_cast(b); } - bool g_tl_adouble_double(TLAdoubleHandle a, double x) + bool g_tl_adouble_double(TLAdoubleHandle a, const double x) { return *static_cast(a) > x; } @@ -178,11 +176,11 @@ extern "C" { return *static_cast(a) <= *static_cast(b); } - bool le_double_tl_adouble(double x, TLAdoubleHandle b) + bool le_double_tl_adouble(const double x, TLAdoubleHandle b) { return x <= *static_cast(b); } - bool le_tl_adouble_double(TLAdoubleHandle a, double x) + bool le_tl_adouble_double(TLAdoubleHandle a, const double x) { return *static_cast(a) <= x; } @@ -190,11 +188,11 @@ extern "C" { return *static_cast(a) < *static_cast(b); } - bool l_double_tl_adouble(double x, TLAdoubleHandle b) + bool l_double_tl_adouble(const double x, TLAdoubleHandle b) { return x < *static_cast(b); } - bool l_tl_adouble_double(TLAdoubleHandle a, double x) + bool l_tl_adouble_double(TLAdoubleHandle a, const double x) { return *static_cast(a) < x; } @@ -202,11 +200,11 @@ extern "C" { return *static_cast(a) == *static_cast(b); } - bool eq_double_tl_adouble(double x, TLAdoubleHandle b) + bool eq_double_tl_adouble(const double x, TLAdoubleHandle b) { return x == *static_cast(b); } - bool eq_tl_adouble_double(TLAdoubleHandle a, double x) + bool eq_tl_adouble_double(TLAdoubleHandle a, const double x) { return *static_cast(a) == x; } @@ -286,7 +284,7 @@ extern "C" { return new adtl::adouble(floor(*static_cast(a))); } - TLAdoubleHandle tl_ldexp(TLAdoubleHandle a, int n) + TLAdoubleHandle tl_ldexp(TLAdoubleHandle a, const int n) { return new adtl::adouble(ldexp(*static_cast(a), n)); } diff --git a/ADOL-C/c_interface/ADOLC_TL_interface.h b/ADOL-C/c_interface/ADOLC_TL_interface.h index 386cc62a..5558463e 100644 --- a/ADOL-C/c_interface/ADOLC_TL_interface.h +++ b/ADOL-C/c_interface/ADOLC_TL_interface.h @@ -5,7 +5,7 @@ extern "C" { #endif - // Used to handle Tape-based adouble as void* + // Used to handle Tape-Less adouble as void* typedef void *TLAdoubleHandle; #ifdef __cplusplus } @@ -19,7 +19,7 @@ extern "C" { #endif // Constructor - TLAdoubleHandle create_tl_adouble(double x); + TLAdoubleHandle create_tl_adouble(const double x); TLAdoubleHandle create_tl_adouble_with_ad(const double val, const double *ad_val); TLAdoubleHandle create_tl_adouble_empty(); @@ -30,7 +30,7 @@ extern "C" #endif /* -Utilities for adouble +Utilities for tape-less adouble */ #ifdef __cplusplus extern "C" @@ -48,58 +48,58 @@ extern "C" #endif /* -Arithmetics for class tl adouble +Arithmetics for class tape-less adouble */ #ifdef __cplusplus extern "C" { #endif TLAdoubleHandle add_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - TLAdoubleHandle add_double_tl_adouble(double x, TLAdoubleHandle b); - TLAdoubleHandle add_tl_adouble_double(TLAdoubleHandle a, double x); + TLAdoubleHandle add_double_tl_adouble(const double x, TLAdoubleHandle b); + TLAdoubleHandle add_tl_adouble_double(TLAdoubleHandle a, const double x); TLAdoubleHandle mult_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - TLAdoubleHandle mult_double_tl_adouble(double x, TLAdoubleHandle b); - TLAdoubleHandle mult_tl_adouble_double(TLAdoubleHandle a, double x); + TLAdoubleHandle mult_double_tl_adouble(const double x, TLAdoubleHandle b); + TLAdoubleHandle mult_tl_adouble_double(TLAdoubleHandle a, const double x); TLAdoubleHandle subtr_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - TLAdoubleHandle subtr_double_tl_adouble(double x, TLAdoubleHandle b); - TLAdoubleHandle subtr_tl_adouble_double(TLAdoubleHandle a, double x); + TLAdoubleHandle subtr_double_tl_adouble(const double x, TLAdoubleHandle b); + TLAdoubleHandle subtr_tl_adouble_double(TLAdoubleHandle a, const double x); TLAdoubleHandle div_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - TLAdoubleHandle div_double_tl_adouble(double x, TLAdoubleHandle b); - TLAdoubleHandle div_tl_adouble_double(TLAdoubleHandle a, double x); + TLAdoubleHandle div_double_tl_adouble(const double x, TLAdoubleHandle b); + TLAdoubleHandle div_tl_adouble_double(TLAdoubleHandle a, const double x); TLAdoubleHandle max_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - TLAdoubleHandle max_double_tl_adouble(double x, TLAdoubleHandle b); - TLAdoubleHandle max_tl_adouble_double(TLAdoubleHandle a, double x); + TLAdoubleHandle max_double_tl_adouble(const double x, TLAdoubleHandle b); + TLAdoubleHandle max_tl_adouble_double(TLAdoubleHandle a, const double x); TLAdoubleHandle min_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - TLAdoubleHandle min_double_tl_adouble(double x, TLAdoubleHandle b); - TLAdoubleHandle min_tl_adouble_double(TLAdoubleHandle a, double x); + TLAdoubleHandle min_double_tl_adouble(const double x, TLAdoubleHandle b); + TLAdoubleHandle min_tl_adouble_double(TLAdoubleHandle a, const double x); TLAdoubleHandle pow_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - TLAdoubleHandle pow_tl_adouble_double(TLAdoubleHandle a, double x); + TLAdoubleHandle pow_tl_adouble_double(TLAdoubleHandle a, const double x); bool ge_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - bool ge_double_tl_adouble(double x, TLAdoubleHandle b); - bool ge_tl_adouble_double(TLAdoubleHandle a, double x); + bool ge_double_tl_adouble(const double x, TLAdoubleHandle b); + bool ge_tl_adouble_double(TLAdoubleHandle a, const double x); bool g_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - bool g_double_tl_adouble(double x, TLAdoubleHandle b); - bool g_tl_adouble_double(TLAdoubleHandle a, double x); + bool g_double_tl_adouble(const double x, TLAdoubleHandle b); + bool g_tl_adouble_double(TLAdoubleHandle a, const double x); bool le_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - bool le_double_tl_adouble(double x, TLAdoubleHandle b); - bool le_tl_adouble_double(TLAdoubleHandle a, double x); + bool le_double_tl_adouble(const double x, TLAdoubleHandle b); + bool le_tl_adouble_double(TLAdoubleHandle a, const double x); bool l_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - bool l_double_tl_adouble(double x, TLAdoubleHandle b); - bool l_tl_adouble_double(TLAdoubleHandle a, double x); + bool l_double_tl_adouble(const double x, TLAdoubleHandle b); + bool l_tl_adouble_double(TLAdoubleHandle a, const double x); bool eq_tl_adouble(TLAdoubleHandle a, TLAdoubleHandle b); - bool eq_double_tl_adouble(double x, TLAdoubleHandle b); - bool eq_tl_adouble_double(TLAdoubleHandle a, double x); + bool eq_double_tl_adouble(const double x, TLAdoubleHandle b); + bool eq_tl_adouble_double(TLAdoubleHandle a, const double x); TLAdoubleHandle tl_abs(TLAdoubleHandle a); TLAdoubleHandle tl_sqrt(TLAdoubleHandle a); @@ -120,7 +120,7 @@ extern "C" TLAdoubleHandle tl_atanh(TLAdoubleHandle a); TLAdoubleHandle tl_ceil(TLAdoubleHandle a); TLAdoubleHandle tl_floor(TLAdoubleHandle a); - TLAdoubleHandle tl_ldexp(TLAdoubleHandle a, int n); + TLAdoubleHandle tl_ldexp(TLAdoubleHandle a, const int n); TLAdoubleHandle tl_erf(TLAdoubleHandle a); #ifdef __cplusplus } diff --git a/ADOL-C/c_interface/CMakeLists.txt b/ADOL-C/c_interface/CMakeLists.txt index 961b061c..cc669382 100644 --- a/ADOL-C/c_interface/CMakeLists.txt +++ b/ADOL-C/c_interface/CMakeLists.txt @@ -1,3 +1,2 @@ - add_library(ADOLCInterface SHARED ADOLC_TB_interface.cpp ADOLC_TL_interface.cpp array_handler.cpp driver_interface.cpp) target_link_libraries(ADOLCInterface adolc)