matrix_vector.cpp
Go to the documentation of this file.
1 #define BOOST_TEST_MAIN
2 #define BOOST_TEST_DYN_LINK
3 
4 #define BOOST_TEST_MODULE MatrixVectorTests
5 #include <boost/test/unit_test.hpp>
6 
8 
10 
11 using namespace std;
12 
13 BOOST_AUTO_TEST_CASE( vector_ctors )
14 {
15  double cc[ 3 ] = {1, 2};
16  vector< double > dd( 2 ); dd[ 0 ] = -10; dd[ 1 ] = 99;
17  DVector a, b( 5 ), c(2, cc), d( dd );
18 
19  BOOST_REQUIRE( a.getDim() == 0 );
20  BOOST_REQUIRE( b.getDim() == 5 );
21  BOOST_REQUIRE( acadoIsEqual(b( 0 ), 0) );
22  BOOST_REQUIRE( c.getDim() == 2 );
23  BOOST_REQUIRE( acadoIsEqual(c( 1 ), 2) );
24  BOOST_REQUIRE( d.getDim() == 2 );
25  BOOST_REQUIRE( acadoIsEqual(d( 0 ), -10) && acadoIsEqual(d( 1 ), 99) );
26 }
BooleanType acadoIsEqual(double x, double y, double TOL)
Definition: acado_utils.cpp:88
#define USING_NAMESPACE_ACADO
unsigned getDim() const
Definition: vector.hpp:172
BOOST_AUTO_TEST_CASE(vector_ctors)


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:51