CppAD: A C++ Algorithmic Differentiation Package
20171217
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
test_vector.hpp
Go to the documentation of this file.
1
# ifndef CPPAD_CORE_TEST_VECTOR_HPP
2
# define CPPAD_CORE_TEST_VECTOR_HPP
3
4
/* --------------------------------------------------------------------------
5
CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
6
7
CppAD is distributed under multiple licenses. This distribution is under
8
the terms of the
9
Eclipse Public License Version 1.0.
10
11
A copy of this license is included in the COPYING file of this distribution.
12
Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
13
-------------------------------------------------------------------------- */
14
15
/*
16
$begin test_vector$$
17
$spell
18
autotools
19
ifdef
20
undef
21
Microsofts
22
CppADvector
23
hpp
24
std
25
endif
26
ublas
27
Dir
28
valarray
29
stdvector
30
$$
31
32
33
$section Choosing The Vector Testing Template Class$$
34
$mindex CPPAD_TEST_VECTOR test$$
35
36
$head Deprecated 2012-07-03$$
37
The $code CPPAD_TEST_VECTOR$$ macro has been deprecated,
38
use $cref/CPPAD_TESTVECTOR/testvector/$$ instead.
39
40
$head Syntax$$
41
$codei%CPPAD_TEST_VECTOR<%Scalar%>
42
%$$
43
44
$head Introduction$$
45
Many of the CppAD $cref/examples/example/$$ and tests use
46
the $code CPPAD_TEST_VECTOR$$ template class to pass information.
47
The default definition for this template class is
48
$cref/CppAD::vector/CppAD_vector/$$.
49
50
$head MS Windows$$
51
The include path for boost is not defined in the Windows project files.
52
If we are using Microsofts compiler, the following code overrides the setting
53
of $code CPPAD_BOOSTVECTOR$$:
54
$srccode%cpp% */
55
// The next 7 lines are C++ source code.
56
# ifdef _MSC_VER
57
# if CPPAD_BOOSTVECTOR
58
# undef CPPAD_BOOSTVECTOR
59
# define CPPAD_BOOSTVECTOR 0
60
# undef CPPAD_CPPADVECTOR
61
# define CPPAD_CPPADVECTOR 1
62
# endif
63
# endif
64
/* %$$
65
66
$head CppAD::vector$$
67
By default $code CPPAD_CPPADVECTOR$$ is true
68
and $code CPPAD_TEST_VECTOR$$ is defined by the following source code
69
$srccode%cpp% */
70
// The next 3 line are C++ source code.
71
# if CPPAD_CPPADVECTOR
72
# define CPPAD_TEST_VECTOR CppAD::vector
73
# endif
74
/* %$$
75
If you specify $code --with-eigenvector$$ on the
76
$cref/configure/autotools/Configure/$$ command line,
77
$code CPPAD_EIGENVECTOR$$ is true.
78
This vector type cannot be supported by $code CPPAD_TEST_VECTOR$$
79
(use $cref/CPPAD_TESTVECTOR/testvector/$$ for this support)
80
so $code CppAD::vector$$ is used in this case
81
$srccode%cpp% */
82
// The next 3 line are C++ source code.
83
# if CPPAD_EIGENVECTOR
84
# define CPPAD_TEST_VECTOR CppAD::vector
85
# endif
86
/* %$$
87
88
89
$head std::vector$$
90
If you specify $code --with-stdvector$$ on the
91
$cref/configure/autotools/Configure/$$
92
command line during CppAD installation,
93
$code CPPAD_STDVECTOR$$ is true
94
and $code CPPAD_TEST_VECTOR$$ is defined by the following source code
95
$srccode%cpp% */
96
// The next 4 lines are C++ source code.
97
# if CPPAD_STDVECTOR
98
# include <vector>
99
# define CPPAD_TEST_VECTOR std::vector
100
# endif
101
/* %$$
102
In this case CppAD will use $code std::vector$$ for its examples and tests.
103
Use of $code CppAD::vector$$, $code std::vector$$,
104
and $code std::valarray$$ with CppAD is always tested to some degree.
105
Specifying $code --with-stdvector$$ will increase the amount of
106
$code std::vector$$ testing.
107
108
$head boost::numeric::ublas::vector$$
109
If you specify a value for $icode boost_dir$$ on the configure
110
command line during CppAD installation,
111
$code CPPAD_BOOSTVECTOR$$ is true
112
and $code CPPAD_TEST_VECTOR$$ is defined by the following source code
113
$srccode%cpp% */
114
// The next 4 lines are C++ source code.
115
# if CPPAD_BOOSTVECTOR
116
# include <boost/numeric/ublas/vector.hpp>
117
# define CPPAD_TEST_VECTOR boost::numeric::ublas::vector
118
# endif
119
/* %$$
120
In this case CppAD will use Ublas vectors for its examples and tests.
121
Use of $code CppAD::vector$$, $code std::vector$$,
122
and $code std::valarray$$ with CppAD is always tested to some degree.
123
Specifying $icode boost_dir$$ will increase the amount of
124
Ublas vector testing.
125
126
$head CppADvector Deprecated 2007-07-28$$
127
The preprocessor symbol $code CppADvector$$ is defined to
128
have the same value as $code CPPAD_TEST_VECTOR$$ but its use is deprecated:
129
$srccode%cpp% */
130
# define CppADvector CPPAD_TEST_VECTOR
131
/* %$$
132
$end
133
------------------------------------------------------------------------
134
*/
135
136
# endif
cppad
core
test_vector.hpp
Generated by
1.8.5