27 #include "../Config.h" 32 #define BOOST_TEST_NO_MAIN 33 #include <boost/test/unit_test.hpp> 42 BOOST_CHECK( m1.
reset( 2, 2,
44 BOOST_CHECK( ( ! m1.
isEmpty() ) );
55 BOOST_CHECK( m1( 0 , 0 ) == 0.0 );
56 BOOST_CHECK( m1( 0 , 1 ) == 1.0 );
57 BOOST_CHECK( m1( 1 , 0 ) == 2.0 );
58 BOOST_CHECK( m1( 1 , 1 ) == 3.0 );
60 BOOST_CHECK( m1[ 0 ][ 0 ] == 0.0 );
61 BOOST_CHECK( m1[ 0 ][ 1 ] == 1.0 );
62 BOOST_CHECK( m1[ 1 ][ 0 ] == 2.0 );
63 BOOST_CHECK( m1[ 1 ][ 1 ] == 3.0 );
67 BOOST_CHECK( m1.
reset( 2, 2 ) );
78 BOOST_CHECK( m1( 0 , 0 ) == 0.0 );
79 BOOST_CHECK( m1( 0 , 1 ) == 1.0 );
80 BOOST_CHECK( m1( 1 , 0 ) == 2.0 );
81 BOOST_CHECK( m1( 1 , 1 ) == 3.0 );
94 BOOST_CHECK( m2.getLinesNumber() == 2 );
95 BOOST_CHECK( m2.getColumnsNumber() == 2 );
97 BOOST_CHECK( m2( 0 , 0 ) == 0.0 );
98 BOOST_CHECK( m2( 0 , 1 ) == 1.0 );
99 BOOST_CHECK( m2( 1 , 0 ) == 2.0 );
100 BOOST_CHECK( m2( 1 , 1 ) == 3.0 );
110 BOOST_CHECK( m3( 0 , 0 ) == 0.0 );
111 BOOST_CHECK( m3( 0 , 1 ) == 1.0 );
112 BOOST_CHECK( m3( 1 , 0 ) == 2.0 );
113 BOOST_CHECK( m3( 1 , 1 ) == 3.0 );
118 unsigned long int lines = 2;
119 unsigned long int cols = 2;
126 double counter = 0.0;
128 unsigned int line = 0;
129 unsigned int col = 0;
131 for( line = 0 ; line < lines ; ++
line ) {
132 for( col = 0 ; col < cols ; ++
col ) {
133 m1( line , col ) = counter;
141 for( line = 0 ; line < lines ; ++
line ) {
142 for( col = 0 ; col < cols ; ++
col ) {
143 BOOST_CHECK( ( m1( line , col ) == counter ) );
156 unsigned long int lines = 3;
157 unsigned long int cols = 3;
164 double counter = 0.0;
166 unsigned int line = 0;
167 unsigned int col = 0;
169 for( line = 0 ; line < lines ; ++
line ) {
170 for( col = 0 ; col < cols ; ++
col ) {
171 m1( line , col ) = counter;
179 for( line = 0 ; line < lines ; ++
line ) {
180 for( col = 0 ; col < cols ; ++
col ) {
181 BOOST_CHECK( ( m1( line , col ) == counter ) );
194 unsigned long int lines = 3;
195 unsigned long int cols = 3;
198 BOOST_CHECK( m1.
reset( lines, cols,
205 unsigned int line = 0;
206 unsigned int col = 0;
207 double counter = 0.0;
209 for( line = 0 ; line < lines ; ++
line ) {
210 for( col = 0 ; col < cols ; ++
col ) {
211 m1( line , col ) = counter;
218 for( line = 0 ; line < lines ; ++
line ) {
219 for( col = 0 ; col < cols ; ++
col ) {
220 BOOST_CHECK( ( m1( line , col ) == counter ) );
230 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(matrix_tests) BOOST_AUTO_TEST_CASE(generic_tests)
BOOST_AUTO_TEST_CASE(rAMMemPol_test)
MemoryPolicy getMemPolicy() const
Returns the current memory policy.
unsigned int getColumnsNumber() const
The number of current matrix columns.
This file contains include headers for the TerraLib Raster Processing module.
void reset()
Reset (clear) the active instance data.
This file contains include headers for the TerraLib Common Runtime module.
bool isEmpty() const
Empty Matrix verification.
unsigned int getLinesNumber() const
The number of current matrix lines.