source: trunk/test_more/check_simple_vector.cpp @ 3008

Last change on this file since 3008 was 2506, checked in by bradbell, 7 years ago

Change Licenses: CPL-1.0 -> EPL-1.0, GPL-2.0->GPL-3.0

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1/* $Id: check_simple_vector.cpp 2506 2012-10-24 19:36:49Z bradbell $ */
2/* --------------------------------------------------------------------------
3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
4
5CppAD is distributed under multiple licenses. This distribution is under
6the terms of the
7                    Eclipse 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                typedef CPPAD_TESTVECTOR(Scalar) testvector;
27                CheckSimpleVector<Scalar, testvector > (x, y);
28        }
29}
30bool check_simple_vector(void)
31{       // Unusal test in that CheckSimpleVector will abort if an error occurs
32        Case(float(0), float(1));
33        Case(double(0), double(1));
34        //
35        std::set<size_t> x, y;
36        x.insert(1);
37        y.insert(2);
38        Case(x, y);
39        //
40        return true;
41}
Note: See TracBrowser for help on using the repository browser.