Prev | Next | whats_new_03 |
double
should have been references
to the base type
(in reverse mode and in the Grad/
and Hess
functions).
This has been fixed.
WIN32
was being used to determine
if one was using Microsoft's C++ compiler.
This symbol is predefined by the
MinGW
version of the GNU C++ compiler
and hence CppAD had errors during installation using MinGW.
This has been fixed by using the preprocessor symbol
_MSC_VER
to determine if
one is using the Microsoft C++ compiler.
OdeOne
and OdeTwo
have
been removed from the distribution.
In addition, the interface to the ODE solvers have been simplified.
CppADCreateTape
macro
and have the tapes created and grow automatically.
size_t TapeName.Independent(AD<Base> &indvar)
size_t TapeName.Record(size_t order)
size_t TapeName.Stop(void)
bool Dependent(const AD<Base> &var) const
bool TapeName.Dependent(const AD<Base> &var) const
size_t TapeName.Total(void) const
size_t TapeName.Required(void) const
size_t TapeName.Erase(void)
TapeState TapeName.State(void) const
size_t TapeName.Order(void) const
size_t TapeName.Required(void) const
bool Parameter(CppADvector< AD<Base> > &u)
TapeName.Forward(indvar)
TapeName.Reverse(var)
TapeName.Partial(var)
TapeName.ForwardTwo(indvar)
TapeName.ReverseTwo(var)
TapeName.PartialTwo(var)
CppADCreateTape
.
The examples
were changed to not use
TapeName
.
The following examples were skipped because
they document the functions that access
TapeName
:
DefFun.cpp
,
For.cpp
,
for_two.cpp
,
Rev.cpp
, and
rev_two.cpp
.
f.Rev
and
f.RevTwo
and
when two dependent variables were always equal and shared
the same location in the tape.
This has been fixed.
The ODE Example was changed to tape the solution
(and not use OdeOne
or OdeTwo
).
This is simpler to use and
the resulting speed tests gave much faster results.
void Independent(const CppADvector<Base> &x)
which will declare the independent variables and begin recording
AD<Base>
operations
(see Independent
).
The ADFun
constructor was modified so that it
stops the recording and erases that tape as well as creates the
ADFun
object.
In addition, the tape no longer needs to be specified in the constructor.
StiffZero
to set of ODE solvers.
AbsGeq
and LeqZero
in
LuSolve
were changed to template functions so they could have
default definitions in the case where the <=
and >=
operators are defined.
This made the double
and AD<double>
use of
LuSolve
simpler because the user need not worry about these functions.
On the other hand, it made the std::complex
and AD<std::complex>
use of
LuSolve
more complex.
The member function names for the
fun
argument to ODE were changed from
fun.f
to
fun.Ode
and from
fun.g
to
fun.Ode_ini
.
The LuSolve
utility is now part of the distribution
and not just an example; i.e.,
it is automatically included by
cppad.hpp
.
The template argument
Type
was changed to
Base
where ever it was the
base type
of an AD class.
speed_cppad/OdeSpeed.cpp/
test was added
and some changes were made to the
ODE interface in order to make it faster.
The most significant change was in the specifications for
the ODE function object
fun
.
example/UnaryFun.cpp
was incorrect.
It has been corrected and extended.
std::vector
template class was previously used.
You can replace the CppAD::vector
class
with a vector template class of your choosing during the
Install
procedure.
DoubleTape
was changed to ADdoubleTape
(and the other example tape names were also changed).
order
equal zero)
or solving the extended set of differential equations
for both first and second derivatives (cases
order
equal
one and two).
In addition, an initial condition that depends on the parameter
values is also allowed.
Reverse
,
Partial
,
ReverseTwo
, and
PartialTwo
functions.
CppAD
include files,
except cppad.hpp
were moved into an include
subdirectory.
ADFun
functions supports directional derivatives in both
Forward
and Reverse
mode where as the
tape only supports partial derivatives.
sqrt
function was added to the
unary_standard_math
functions.
In addition, a definition of the power function for the types
float
and double
was automatically included in the CppAD
namespace.
The Value
function was changed so that it can
be called when the tape is in the Empty state.
atan
function was added to the
unary_standard_math
functions.
zero
and
one
are parameters that are exactly equal to zero and one.
If the variables
z
and
x
were related in any of the following ways,
they share can share the same record on the tape
because they will have the same derivatives.
z = x + zero z = x * one
z = zero + x z = one * x
z = x - zero z = x / one
Furthermore, in the following cases, the result
z
is a parameter (equal to zero)
and need not be recorded in the tape:
z = x * zero z = zero / x
z = zero * x
The
arithmetic operators
were
all checked to make sure they did not add to the tape
in these special cases.
The total record count for the program in the Example directory
was 552 before this change
and 458 after.
The function
TapeName.Total
was added
to make it easy to track how many tape records are used by
the test suite.
This will help with future optimization of the CppAD recording process.
There was a bug
(found by Mike Dodds
)
in the error checking of the
TapeName.Erase
function.
If Erase
was called twice in a row,
and NDEBUG
was false during compilation,
the program would abort.
This has been fixed.
There was a bug in reverse mode when an dependent variable
was exactly equal to an independent variable.
In this case, it was possible for it to be located
before other of the independent variables on the tape.
These other independent variable partials were not initialized
to zero before the reverse calculation and hence had what ever
value was left by the previous mode calculation.
This has been fixed and the
Eq.cpp
example has been changed to test for this case.
The following tape functions were changed to be declared
const
because they do not modify the tape in any way:
State
,
Order
,
Required
,
Dependent
, and
Parameter
.
Grad
and Hess
were
changed to use function objects
instead of function pointers.
const
.
RemoveFromVarList
to remove variables from the list.
(RemoveFromVarList
is a private AD member function
not visible to the user.)
AD< AD<double> >
to compute higher derivatives was added.
The name GaussEliminate
was changed to
LuSolve
to better reflect the solution method.
AbsOfDoubleNotDefine
flag is no longer used
and it was removed from the Windows
install
instructions.
The 03-09-03 distribution did not have the proper date
attached to it.
The distribution script has been changed so that attaching
the proper date is automated
(i.e., this should not happen again).
A Frequently Asked Questions and Answers section was started.
Version | double Rate | AD<double> Rate | Gradient Rate | Hessian Rate | Tape Length |
03-08-20 | 8,524 | 5,278 | 4,260 | 2,450 | 532 |
03-08-23 | 7,869 | 4,989 | 4,870 | 2,637 | 464 |
The
LuSolve
routine what changed to use
std::vector<Base> &
arguments in place of
Base *
arguments.
This removes the need to use new
and delete
with LuSolve
.
When testing the speed of the change to using standard vector,
it was noticed that the LuSolve routine
was much slower. (see times for 03-08-16 below).
This was do to computing the determinant instead of the log
of the determinant.
Converting back to the log of the determinant regained
the high speeds.
The following results correspond to the speed test
of DetLu on a 9 by 9 matrix:
Version | double Rate | AD<double> Rate | Gradient Rate | Hessian Rate | Tape Length |
03-08-16 | 9,509 | 5,565 | 3,587 | 54 | 537 |
03-08-19 | 8,655 | 5,313 | 4,307 | 2,495 | 532 |
CppADTapeOverflow
was added
so that CppAD can check for tape overflow
even in the NDEBUG
preprocessor flag is defined.
GradLu.cpp
were converted to a complex case.
Version | double Rate | AD<double> Rate | Gradient Rate | Hessian Rate | Tape Length |
03-08-10 | 49,201 | 7,787 | 2,655 | 1,809 | 824 |
03-08-11 | 35,178 | 12,681 | 4,521 | 2,541 | 540 |
The documentation and type conversion in
LuSolve
was improved.
The absolute value function was removed from the examples because
some systems do not yet properly support
double abs(double x)
,
Version | Tape Length | Gradient Rate | Hessian Rate |
03-08-05 | 176 | 11,362 | 1,149 |
03-08-06 | 167 | 12,780 | 10,625 |
AbsOfDoubleNotDefined
to the make files so that it could be removed on systems where the
function
double abs(double x)
was defined in math.h
.
Grad
and Hess
functions were modified
to handel the case where the function does not depend on
the independent variables.
The
LuSolve
example was added to show how
on can differentiate linear algebra calculations.
In addition, it was used to add another set of
speed tests
.
The standard Math functions were added both
as examples of defining atomic operations and to support
mathematical operations for the AD<double>
case.
The <<
operator was added to the AD
template class for output to streams.
AD
template class.
The name of the Speed/SpeedTest
program was changed to
Speed/Speed
.
In addition, Speed/SpeedRun
was changed to
Speed/SpeedTest
.
x = y = z;
i.e., multiple assignments.
AD<Base>
data structure
was changed to include a doubly linked list of variables.
This enabled the
AD copy constructor
constructor and
assignment
operator
to create multiple references to
the same place in the tape.
This reduced the size of the tape and increased the speed
for the calculation of the gradient and Hessian for
the determinant of a 5 by 5 matrix as follows:
Version | Tape Length | Gradient Rate | Hessian Rate |
03-07-22 | 1668 | 1,363 | 53 |
03-07-26 | 436 | 3,436 | 213 |
The Windows version make file directive /I ..\..
in example\Example.mak
and Speed\Speed.mak
was changed to /I ..
(as it should have been).
The first Alpha for the Windows
installation
was released.
Compiled and ran the tests under Microsoft Windows.
(The Windows release should not take much more work.)