matrix_vector.cpp
Go to the documentation of this file.
00001 #define BOOST_TEST_MAIN
00002 #define BOOST_TEST_DYN_LINK
00003 
00004 #define BOOST_TEST_MODULE MatrixVectorTests
00005 #include <boost/test/unit_test.hpp>
00006 
00007 #include <acado/matrix_vector/matrix_vector.hpp>
00008 
00009 USING_NAMESPACE_ACADO
00010 
00011 using namespace std;
00012 
00013 BOOST_AUTO_TEST_CASE( vector_ctors )
00014 {
00015         double cc[ 3 ] = {1, 2};
00016         vector< double > dd( 2 ); dd[ 0 ] = -10; dd[ 1 ] = 99;
00017         DVector a, b( 5 ), c(2, cc), d( dd );
00018 
00019     BOOST_REQUIRE( a.getDim() == 0 );
00020     BOOST_REQUIRE( b.getDim() == 5 );
00021     BOOST_REQUIRE( acadoIsEqual(b( 0 ), 0) );
00022     BOOST_REQUIRE( c.getDim() == 2 );
00023     BOOST_REQUIRE( acadoIsEqual(c( 1 ), 2) );
00024     BOOST_REQUIRE( d.getDim() == 2 );
00025     BOOST_REQUIRE( acadoIsEqual(d( 0 ), -10) && acadoIsEqual(d( 1 ), 99) );
00026 }


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 11:59:11