Changeset 418
 Timestamp:
 Mar 19, 2013 12:00:45 PM (9 years ago)
 Location:
 branches/MPI/ADOLC/src
 Files:

 2 added
 2 edited
Legend:
 Unmodified
 Added
 Removed

branches/MPI/ADOLC/src/adouble.cpp
r311 r418 1358 1358 /* y+0.0 is a hack since condassign is currently not defined for 1359 1359 badoubles */ 1360 condassign( sy, y+0.0, 1.0 , 1.0 ); 1361 condassign( a1, x+0.0, (adouble) atan(y/x), 1362 (adouble)( atan(y/x)+sy*2*pihalf)); 1363 condassign( a2, (adouble) fabs(y), (adouble) (sy*pihalfatan(x/y)), 1364 (adouble) 0.0 ); 1365 condassign( ret, (adouble) (fabs(x)  fabs(y)), a1, a2 ); 1360 condassign( sy, y, (adouble)1.0 , (adouble)1.0 ); 1361 condassign( a1, x, atan(y/x), atan(y/x)+sy*2*pihalf); 1362 condassign( a2, fabs(y), sy*pihalfatan(x/y), (adouble) 0.0 ); 1363 condassign( ret, fabs(x)  fabs(y), a1, a2 ); 1366 1364 return ret; 1367 1365 } … … 1400 1398 } 1401 1399 1402 condassign (ret, coval, exp(y*ADOLC_MATH_NSP::log(coval)),1403 1400 condassign (ret, (adouble) coval, exp(y*ADOLC_MATH_NSP::log(coval)), 1401 (adouble) ADOLC_MATH_NSP::pow(coval,y.getValue()) ); 1404 1402 1405 1403 return ret; … … 1419 1417 fprintf(DIAG_OUT,"\nADOLC message: negative exponent and zero basis deactivated\n"); 1420 1418 } 1421 condassign(a1, y,ADOLC_MATH_NSP::pow(vx,vy), pow(x,vy));1422 condassign(a2, fabs(x), pow(x, vy), a1);1423 condassign(ret, x+0.0, exp(y*log(x)),a2);1419 condassign(a1, y, (adouble) ADOLC_MATH_NSP::pow(vx,vy), pow(x,vy)); 1420 condassign(a2, fabs(x), pow(x, vy), a1); 1421 condassign(ret, x, exp(y*log(x)),a2); 1424 1422 1425 1423 return ret; … … 1777 1775 1778 1776 /**/ 1779 void condassign( adouble &res, constadouble &cond,1780 const adouble &arg1, constadouble &arg2 ) {1777 void condassign( adouble &res, const badouble &cond, 1778 const badouble &arg1, const badouble &arg2 ) { 1781 1779 ADOLC_OPENMP_THREAD_NUMBER; 1782 1780 ADOLC_OPENMP_GET_THREAD_NUMBER; … … 1802 1800 1803 1801 /**/ 1804 void condassign( adouble &res, const adouble &cond, constadouble &arg ) {1802 void condassign( adouble &res, const badouble &cond, const badouble &arg ) { 1805 1803 ADOLC_OPENMP_THREAD_NUMBER; 1806 1804 ADOLC_OPENMP_GET_THREAD_NUMBER; 
branches/MPI/ADOLC/src/adouble.h
r327 r418 111 111 class adub; 112 112 class badouble; 113 class adubv;114 /* class doublev; that's history */115 113 116 114 /**/ … … 138 136 */ 139 137 class ADOLC_DLL_EXPORT badouble { 140 friend ADOLC_DLL_EXPORT class badoublev;138 friend ADOLC_DLL_EXPORT class advector; 141 139 protected: 142 140 locint location; … … 146 144 // 147 145 // badouble( const badouble& a ) {location = a.location;}; 148 badouble( locint lo ) {146 explicit badouble( locint lo ) { 149 147 location = lo; 150 148 }; … … 168 166 badouble& operator = ( const adub& ); 169 167 double getValue() const; 170 inline double value() {168 inline double value() const { 171 169 return getValue(); 172 170 } … … 286 284 /**/ 287 285 /* Conditionals */ 288 friend ADOLC_DLL_EXPORT void condassign( adouble &res, const adouble &cond,289 const adouble &arg1, constadouble &arg2 );290 friend ADOLC_DLL_EXPORT void condassign( adouble &res, const adouble &cond,291 const adouble &arg );286 friend ADOLC_DLL_EXPORT void condassign( adouble &res, const badouble &cond, 287 const badouble &arg1, const badouble &arg2 ); 288 friend ADOLC_DLL_EXPORT void condassign( adouble &res, const badouble &cond, 289 const badouble &arg ); 292 290 }; 293 291 … … 317 315 exit(2); 318 316 }; 319 adub( double ):badouble(0) {317 explicit adub( double ):badouble(0) { 320 318 fprintf(DIAG_OUT,"ADOLC error: illegal construction of adub variable" 321 319 " from double\n"); … … 402 400 */ 403 401 class ADOLC_DLL_EXPORT adouble:public badouble { 402 friend ADOLC_DLL_EXPORT class advector; 404 403 public: 405 404 adouble( const adub& );
Note: See TracChangeset
for help on using the changeset viewer.