Changeset 2939 for trunk/cppad/example/base_adolc.hpp
 Timestamp:
 Oct 14, 2013 7:06:18 AM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/cppad/example/base_adolc.hpp
r2506 r2939 3 3 # define CPPAD_BASE_ADOLC_INCLUDED 4 4 /*  5 CppAD: C++ Algorithmic Differentiation: Copyright (C) 20031 2Bradley M. Bell5 CppAD: C++ Algorithmic Differentiation: Copyright (C) 200313 Bradley M. Bell 6 6 7 7 CppAD is distributed under multiple licenses. This distribution is under … … 222 222 namespace CppAD { 223 223 inline adouble sign(const adouble& x) 224 { adouble s_plus, s_minus ;224 { adouble s_plus, s_minus, half(.5); 225 225 // set s_plus to sign(x)/2, except for case x == 0, s_plus = .5 226 condassign(s_plus, +x,  .5, .5);226 condassign(s_plus, +x, half, +half); 227 227 // set s_minus to sign(x)/2, except for case x == 0, s_minus = .5 228 condassign(s_minus, x,  .5, .5);228 condassign(s_minus, x, half, +half); 229 229 // set s to sign(x) 230 230 return s_plus  s_minus;
Note: See TracChangeset
for help on using the changeset viewer.