1/* --------------------------------------------------------------------------
2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell
3
4  CppAD is distributed under the terms of the
5               Eclipse Public License Version 2.0.
6
7  This Source Code may also be made available under the following
8  Secondary License when the conditions for such availability set forth
9  in the Eclipse Public License, Version 2.0 are satisfied:
10        GNU General Public License, Version 2.0 or later.
11-------------------------------------------------------------------------- */
12
13$begin speed_xpackage$$
14$dollar @$$
15$spell
16    xpackage
17    CppAD
18    grep
19    cp
20    ls
21    sed
22$$
23
24
25$section Speed Test Example and Template for a New Package$$
26
27$head Purpose$$
28CppAD has a set of speed tests that are used to compare
29AD packages.
30This section can be used as a starting point for linking a new package
31to he CppAD speed tests.
32
33$head Files$$
34Use the following command, in the
35$cref/distribution directory/download/Distribution Directory/$$,
36to see which files link the example package $code xpackage$$
37to the speed tests:
38$codei%
39    git grep -l xpackage
40%$$
41
42$head Template$$
43Suppose $icode your_package$$ is the name of a package you
44want to add to the speed tests.
45If you are using a Unix system,
46executing the following commands in the distribution directory
47will use $code xpackage$$ as a template for your package:
48$codei%
49    cp -r speed/xpackage speed/%your_package%
50    for file in `ls speed/%your_package%`
51    do
52        sed -i speed/%your_package%/@file -e 's|xpackage|%your_package%|'
53    done
54%$$
55where $icode your_package$$ has been replaced by the name of the new package.
56
57
58$head Running Tests$$
59To build the xpackage version of the tests,
60execute the following commands starting in the
61$cref/build directory/cmake/Build Directory/$$:
62$codei%
63    cd speed/xpackage
64    make check_speed_xpackage VERBOSE=1
65%$$
66You can then run the corresponding speed tests
67with the following command
68$codei%
69    ./speed_xpackage speed %seed%
70%$$
71where $icode seed$$ is a positive integer.
72See $cref speed_main$$ for more options.
73
74$contents%
75    speed/xpackage/det_minor.cpp%
76    speed/xpackage/det_lu.cpp%
77    speed/xpackage/mat_mul.cpp%
78    speed/xpackage/ode.cpp%
79    speed/xpackage/poly.cpp%
80    speed/xpackage/sparse_hessian.cpp%
81    speed/xpackage/sparse_jacobian.cpp
82%$$
83
84$end
85