Prev | Next |

@(@\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@

`# include <cppad/utility/check_simple_vector.hpp>`

`CheckSimpleVector<`*Scalar*, *Vector*>()

`CheckSimpleVector<`*Scalar*, *Vector*>(*x*, *y*)

Preforms compile and run time checks that the type specified by

*Vector*

satisfies all the requirements for
a SimpleVector
class with
elements of type
*Scalar*

.
If a requirement is not satisfied,
a an error message makes it clear what condition is not satisfied.
If the arguments

*x*

and
*y*

are present,
they have prototype

const *Scalar*& *x*

const *Scalar*& *y*

In addition, the check

*x* == *x*

will return the boolean value `true`

, and

*x* == *y*

will return `false`

.
If the arguments

*x*

and
*y*

are not present,
the following extra assumption is made by `CheckSimpleVector`

:
If
*x*

is a
*Scalar*

object

*x* = 0

*y* = 1

assigns values to the objects
*x*

and
*y*

.
In addition,
*x* == *x*

would return the boolean value `true`

and
*x* == *y*

would return `false`

.
The file

`cppad/check_simple_vector.hpp`

is included by `cppad/cppad.hpp`

but it can also be included separately with out the rest
if the CppAD include files.
The routine thread_alloc::parallel_setup must be called before it can be used in parallel mode.

The file check_simple_vector.cpp contains an example and test of this function where

*S*

is the same as
*T*

.
It returns true, if it succeeds an false otherwise.
The comments in this example suggest a way to change the example
so
*S*

is not the same as
*T*

.
Input File: cppad/utility/check_simple_vector.hpp