[CppAD] Change to VecAD specifications

Brad Bell bradbell at seanet.com
Thu Dec 1 10:23:29 EST 2005


Mark Bravington had some interested questions that he is willing to 
share with the mailing list:

Mark.Bravington at csiro.au wrote:

>Hi Brad
>
>Thanks for email. Loss of [ and ] would cause me some usability and
>translation problems (but see below). Could you introduce a "safe"
>vector class instead (or just add set & get as alternatives?), for those
>who really need the offending optimizer? Or rewrite internally using set
>& get, but have an inherited "easyvector" class which adds [ and and []=
>as synomyms? Then the rest of us could continue to access vectors as
>usual.
>  
>

In reaction to Mark's comments,
I attempted to isolate the exact cause of the problem.
While the problem does show up when using VecAD,
I am no longer convinced that VecAD is the cause.
I have found a way around it (for now) with out
changing VecAD. See the heading 12-01 in 
	http://www.coin-or.org/CppAD/Doc/whatsnew05.htm
(which will not be available until tomorrow)

>The main reason is the pain involved in losing features
>available to me in Delphi (based on libraries I've written), such as
>arbitrary starting points for vectors, multi-dimensional arrays, and
>automatic memory management. Obviously, none of these features are
>essential, but the cumulative impact on usability (speaking purely for
>myself, and specifically because of the particular style of programming
>I've adopted) has been enough to deter me from serious use so far.
>Vector access would be another impact on usability and translation of
>existing code, I guess.
>  
>

CppAD intends for you to use your a vector template class of your choice. 
One of the best such classes are provided by the uBLAS package
	http://www.boost.org/libs/numeric/ublas/doc/index.htm
If during the CppAD install
	http://www.coin-or.org/CppAD/Doc/installunix.htm
you specify the
	BOOST_DIR=BoosDir
option on the configure command line, 
the uBLAS vector class will be 
tested during the install procedure.

An ADFun<Base> object defines a mapping
F: R^n -> R^m
that is locally equal to a C++ algorithm:
http://www.coin-or.org/CppAD/Doc/adfun.xml

Computing the dependent variables for such a function object can take 
a significant amount of time.
The VecAD class is intended to extend the domain limits for which
the ADFun object is a valid representation of the C++ algorithm.
If you do not obtain higher speeds using VecAD, you should not use it.
An example of such a test can be found in
http://www.coin-or.org/CppAD/Doc/luvecadok.cpp.xml
which can be run as part of the Speed tests.

>I'm actually about to ...
>investigate whether extensions to CppAD vector classes
>along the above lines are possible, via redefining the vector class as
>the documentation indicates somewhere.
>  
>

Any Simple Vector class with elements of type AD<Base>
http://www.coin-or.org/CppAD/Doc/simplevector.htm
can easily be used directly with the CppAD package.
Thus, if your multi-dimensional array package is extended to be such a 
class, you could use it.






More information about the CppAD mailing list