Skip to content
Snippets Groups Projects
Commit 653b0704 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Inject ADOL-C overloads into the std namespace

[[Imported from SVN: r9394]]
parent 640f7e8d
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,8 @@ SUBDIRS = coupling
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/..
srcincludedir = $(includedir)/dune/common
srcinclude_HEADERS = averagedistanceassembler.hh \
srcinclude_HEADERS = adolcnamespaceinjections.hh \
averagedistanceassembler.hh \
averageinterface.hh \
cosseratvtkwriter.hh \
geodesicdifference.hh \
......
#ifndef DUNE_GFE_ADOLC_NAMESPACE_INJECTIONS_HH
#define DUNE_GFE_ADOLC_NAMESPACE_INJECTIONS_HH
adouble sqrt_hack(adouble a) {
return sqrt(a);
}
adouble pow_hack(const adouble& a, const adouble& b) {
return pow(a,b);
}
adouble pow_hack(const adouble& a, double b) {
return pow(a,b);
}
namespace std
{
adouble min(adouble a, adouble b) {
return fmin(a,b);
}
adouble max(adouble a, adouble b) {
return fmax(a,b);
}
adouble sqrt(adouble a) {
return sqrt_hack(a);
}
adouble abs(adouble a) {
return fabs(a);
}
// adouble fabs(adouble a) {
// return fabs(a);
// }
adouble pow(const adouble& a, const adouble& b) {
return pow_hack(a,b);
}
adouble pow(const adouble& a, double b) {
return pow_hack(a,b);
}
adouble sin(adouble a) {
return sin(a);
}
adouble cos(adouble a) {
return cos(a);
}
adouble acos(adouble a) {
return acos(a);
}
bool isnan(adouble a) {
return std::isnan(a.value());
}
bool isinf(adouble a) {
return std::isinf(a.value());
}
}
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment