![]() |
Prev | Next | speed_main |
speed/
package/
package
option
seed
double
in which case
the function values (instead of derivatives) are computed
using double precision operations.
This enables one to compare the speed of computing function
values in double
to the speed of the derivative computations.
(It is often useful to divide the speed of the derivative computation by
the speed of the function evaluation in double
.)
profile
,
the CppAD package is compiled and run with profiling to aid in determining
where it is spending most of its time.
correct
,
all of the correctness tests are run.
speed
,
all of the speed tests are run.
bool
return value.
If a particular package supports a test,
it should return true
when the corresponding function is called.
Otherwise (if the return value is false
),
the test is skipped whenever the corresponding
package and option are specified.
uniform_01(
seed)
before any of the testing routines (listed above) are called.
det_lu
,
the correctness and speed test for the
gradient of the determinant using LU factorization tests are run.
Each package defines a version of this test with the following prototype:
extern bool compute_det_lu(
size_t size ,
size_t repeat ,
CppAD::vector<double> &matrix ,
CppAD::vector<double> &gradient
);
size*
size elements.
The input value of its elements does not matter.
The output value of its elements is the last matrix that the
gradient is computed for.
size*
size elements.
The input value of its elements does not matter.
The output value of its elements is the gradient of the
determinant of matrix with respect to its elements.
gradient is computed for.
(If package is double
, only the first element
of gradient is used and it is actually the determinant value instead
of the gradient value.)
det_minor
,
the correctness and speed test for the
gradient of the determinant using expansion by minors are run.
Each package defines a version of this test with the following prototype:
extern bool compute_det_minor(
size_t size ,
size_t repeat ,
CppAD::vector<double> &matrix ,
CppAD::vector<double> &gradient
);
size*
size elements.
The input value of its elements does not matter.
The output value of its elements is the last matrix that the
gradient is computed for.
size*
size elements.
The input value of its elements does not matter.
The output value of its elements is the gradient of the
determinant of matrix with respect to its elements.
gradient is computed for.
(If package is double
, only the first element
of gradient is used and it is actually the determinant value
instead of the gradient value.)
poly
,
the correctness and speed test for the derivative of a polynomial are run.
Each package defines a version of this test with the following prototype:
extern bool compute_poly(
size_t size ,
size_t repeat ,
CppAD::vector<double> &a ,
CppAD::vector<double> &z ,
CppAD::vector<double> &ddp
);
size*
size elements.
The input value of its elements does not matter.
The output value of its is the coefficients of the
last polynomial that is differentiated
(i-th element is coefficient of order
i
).
double
, only the first element
of ddp is used and it is actually the polynomial value instead
of the gradient value.)
sparse_hessian
,
the correctness and speed test for computing a sparse Hessian matrix are run.
Each package defines a version of this test with the following prototype:
extern bool compute_sparse_hessian(
size_t size ,
size_t repeat ,
size_t ell ,
CppAD::vector<size_t> &i ,
CppAD::vector<size_t> &j ,
CppAD::vector<double> &hessian
);
f : \R^n \rightarrow \R
is defined by
\[
f(x) = \sum_{k=1}^\ell x_{i[k]} x_{j[k]}
\]
Note that different vectors
i
and
j
correspond to different functions
f(x)
.
f
;
i.e. size is equal to
n
.
f(x)
that the Hessian is computed for.
size_t
ell
and is the number of terms in the summation that defines
f(x)
; i.e.,
\ell
.
f(x)
(each element of the repeat
loop corresponds to a different choice of
i
and
j
).
All the elements of i must be between zero and
size-1
.
f(x)
.
All the elements of j must be between zero and
size-1
.
n*
n elements.
The input value of its elements does not matter.
The output value of its elements is the Hessian of the function
f(x)
corresponding to output values of i and j.
To be more specific,
k = 0 , \ldots , n-1
,
m = 0 , \ldots , n-1
,
\[
\DD{f}{x[k]}{x[m]} = hessian [ k * n + m ]
\]
(If package is double
, only the first element
of hessian is used and it is actually
f(x)
value instead
of
f^{(2)} (x)
.)