Codebase list cppad / 6da2a91
Update upstream source from tag 'upstream/2021.00.00.8' Update to upstream version '2021.00.00.8' with Debian dir a18d6803d20101a03e3d67e852707f6664006bb8 Barak A. Pearlmutter 2 years ago
5 changed file(s) with 51 addition(s) and 38 deletion(s). Raw diff Collapse all Expand all
2424 endif()
2525 #
2626 # cppad_version is used by version.sh to get the version number.
27 SET(cppad_version "20210000.7")
27 SET(cppad_version "20210000.8")
2828 SET(cppad_url "https://coin-or.github.io/CppAD" )
2929 SET(cppad_description "Differentiation of C++ Algorithms" )
3030 #
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for cppad 20210000.7.
2 # Generated by GNU Autoconf 2.69 for cppad 20210000.8.
33 #
44 # Report bugs to <cppad@list.coin-or.org>.
55 #
578578 # Identity of this package.
579579 PACKAGE_NAME='cppad'
580580 PACKAGE_TARNAME='cppad'
581 PACKAGE_VERSION='20210000.7'
582 PACKAGE_STRING='cppad 20210000.7'
581 PACKAGE_VERSION='20210000.8'
582 PACKAGE_STRING='cppad 20210000.8'
583583 PACKAGE_BUGREPORT='cppad@list.coin-or.org'
584584 PACKAGE_URL=''
585585
13511351 # Omit some internal or obsolete options to make the list less imposing.
13521352 # This message is too long to be a string in the A/UX 3.1 sh.
13531353 cat <<_ACEOF
1354 \`configure' configures cppad 20210000.7 to adapt to many kinds of systems.
1354 \`configure' configures cppad 20210000.8 to adapt to many kinds of systems.
13551355
13561356 Usage: $0 [OPTION]... [VAR=VALUE]...
13571357
14211421
14221422 if test -n "$ac_init_help"; then
14231423 case $ac_init_help in
1424 short | recursive ) echo "Configuration of cppad 20210000.7:";;
1424 short | recursive ) echo "Configuration of cppad 20210000.8:";;
14251425 esac
14261426 cat <<\_ACEOF
14271427
15431543 test -n "$ac_init_help" && exit $ac_status
15441544 if $ac_init_version; then
15451545 cat <<\_ACEOF
1546 cppad configure 20210000.7
1546 cppad configure 20210000.8
15471547 generated by GNU Autoconf 2.69
15481548
15491549 Copyright (C) 2012 Free Software Foundation, Inc.
19161916 This file contains any messages produced by compilers while
19171917 running configure, to aid debugging if configure makes a mistake.
19181918
1919 It was created by cppad $as_me 20210000.7, which was
1919 It was created by cppad $as_me 20210000.8, which was
19201920 generated by GNU Autoconf 2.69. Invocation command line was
19211921
19221922 $ $0 $@
28062806
28072807 # Define the identity of the package.
28082808 PACKAGE='cppad'
2809 VERSION='20210000.7'
2809 VERSION='20210000.8'
28102810
28112811
28122812 cat >>confdefs.h <<_ACEOF
76487648 # report actual input values of CONFIG_FILES etc. instead of their
76497649 # values after options handling.
76507650 ac_log="
7651 This file was extended by cppad $as_me 20210000.7, which was
7651 This file was extended by cppad $as_me 20210000.8, which was
76527652 generated by GNU Autoconf 2.69. Invocation command line was
76537653
76547654 CONFIG_FILES = $CONFIG_FILES
77057705 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
77067706 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
77077707 ac_cs_version="\\
7708 cppad config.status 20210000.7
7708 cppad config.status 20210000.8
77097709 configured by $0, generated by GNU Autoconf 2.69,
77107710 with options \\"\$ac_cs_config\\"
77117711
1010 # -----------------------------------------------------------------------------
1111 dnl Process this file with autoconf to produce a configure script.
1212 dnl package version bug-report
13 AC_INIT([cppad], [20210000.7], [cppad@list.coin-or.org])
13 AC_INIT([cppad], [20210000.8], [cppad@list.coin-or.org])
1414 AM_SILENT_RULES([no])
1515
1616 dnl By defalut disable maintainer mode when running configure;
00 # ifndef CPPAD_CORE_ATAN2_HPP
11 # define CPPAD_CORE_ATAN2_HPP
22 /* --------------------------------------------------------------------------
3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-21 Bradley M. Bell
44
55 CppAD is distributed under the terms of the
66 Eclipse Public License Version 2.0.
9090 // BEGIN CondExp
9191 template <class Base>
9292 AD<Base> atan2 (const AD<Base> &y, const AD<Base> &x)
93 { AD<Base> alpha;
94 AD<Base> beta;
95 AD<Base> theta;
96
93 { //
94 // zero, pi2, pi
9795 AD<Base> zero(0.);
9896 AD<Base> pi2(2. * atan(1.));
9997 AD<Base> pi(2. * pi2);
100
101 AD<Base> ax = fabs(x);
102 AD<Base> ay = fabs(y);
103
104 // if( ax > ay )
105 // theta = atan(ay / ax);
106 // else theta = pi2 - atan(ax / ay);
107 alpha = atan(ay / ax);
108 beta = pi2 - atan(ax / ay);
109 theta = CondExpGt(ax, ay, alpha, beta); // use of CondExp
110
111 // if( x <= 0 )
112 // theta = pi - theta;
113 theta = CondExpLe(x, zero, pi - theta, theta); // use of CondExp
114
115 // if( y <= 0 )
116 // theta = - theta;
117 theta = CondExpLe(y, zero, -theta, theta); // use of CondExp
118
119 return theta;
98 //
99 // abs_x, abs_y
100 // Not using fabs because its derivative is zero at zero
101 AD<Base> abs_x = CondExpGe(x, zero, x, -x);
102 AD<Base> abs_y = CondExpGe(y, zero, y, -y);
103 //
104 // first
105 // This is the result for first quadrant: x >= 0 , y >= 0
106 AD<Base> alpha = atan(abs_y / abs_x);
107 AD<Base> beta = pi2 - atan(abs_x / abs_y);
108 AD<Base> first = CondExpGt(abs_x, abs_y, alpha, beta);
109 //
110 // second
111 // This is the result for second quadrant: x <= 0 , y >= 0
112 AD<Base> second = pi - first;
113 //
114 // third
115 // This is the result for third quadrant: x <= 0 , y <= 0
116 AD<Base> third = - pi + first;
117 //
118 // fourth
119 // This is the result for fourth quadrant: x >= 0 , y <= 0
120 AD<Base> fourth = - first;
121 //
122 // alpha
123 // This is the result for x >= 0
124 alpha = CondExpGe(y, zero, first, fourth);
125 //
126 // beta
127 // This is the result for x <= 0
128 beta = CondExpGe(y, zero, second, third);
129 //
130 //
131 AD<Base> result = CondExpGe(x, zero, alpha, beta);
132 return result;
120133 }
121134 // END CondExp
122135
6464
6565 $comment bin/version assumes that : follows cppad version number here$$
6666 $section
67 cppad-20210000.7: A C++ Algorithmic Differentiation Package$$
67 cppad-20210000.8: A C++ Algorithmic Differentiation Package$$
6868
6969 $comment =================================================================== $$
7070 $align middle$$