source: trunk/test_more/check_simple_vector.cpp @ 1632

Last change on this file since 1632 was 1612, checked in by bradbell, 11 years ago

trunk: Improve cummulative addition speed (only affects optimized tape).

check_doxygen.sh: only error exit when doxygen version >= 1.5.5.
check_simple_vector.cpp: fix error when compiling with boost library.
makefile.am: include csum_op.hpp in distribution.
whats_new_09.omh: changes from uses point of view.
player.hpp: add special functions for CSumOp variable number of arguments.
prototype.hpp: minor edits to doxygen documentation.
optimize.hpp: use separate stack for operators, adds, and subtracts.
op.hpp: include csum_op.hpp in source.

Convert CAddOp, CSubOp and CSumOp to just CSumOp:


for_jac_sweep.hpp, op_code.hpp, forward0sweep.hpp, forward_sweep.hpp,
rev_jac_sweep.hpp, rev_hes_sweep.hpp, reverse_sweep.hpp

Warning:


Subversion download will not work because changes to makefile.in needs
to be checked in (from a different system with different version of automake).

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1/* $Id: check_simple_vector.cpp 1612 2009-12-22 13:51:29Z bradbell $ */
2/* --------------------------------------------------------------------------
3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-09 Bradley M. Bell
4
5CppAD is distributed under multiple licenses. This distribution is under
6the terms of the
7                    Common Public License Version 1.0.
8
9A copy of this license is included in the COPYING file of this distribution.
10Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
11-------------------------------------------------------------------------- */
12
13# include <cppad/cppad.hpp>
14# include <set>
15# include <vector>
16# include <valarray>
17
18namespace {
19        template <class Scalar>
20        void Case(const Scalar& x, const Scalar& y)
21        {       using CppAD::CheckSimpleVector;
22       
23                CheckSimpleVector<Scalar, CppAD::vector<Scalar> > (x, y);
24                CheckSimpleVector<Scalar, std::vector<Scalar>   > (x, y);
25                CheckSimpleVector<Scalar, std::valarray<Scalar> > (x, y);
26# if CPPAD_BOOSTVECTOR
27                typedef boost::numeric::ublas::vector<Scalar> boost_vector;
28                CheckSimpleVector<Scalar, boost_vector > (x, y);
29# endif
30        }
31}
32bool check_simple_vector(void)
33{       // Unusal test in that CheckSimpleVector will abort if an error occurs
34        Case(float(0), float(1));
35        Case(double(0), double(1));
36        //
37        std::set<size_t> x, y;
38        x.insert(1);
39        y.insert(2);
40        Case(x, y);
41        //
42        return true;
43}
Note: See TracBrowser for help on using the repository browser.