using namespace boost::numeric::ublas;
-int expected_index( int index, column_major ) {
+int expected_index( size_t index, column_major ) {
// this is the data shown on http://www.netlib.org/lapack/lug/node124.html
// read column-by-column, aka column_major
int mapping[] = { 0, 11, 21, 31, 12, 22, 32, 42, 23, 33, 43, 53, 34, 44, 54, 0, 45, 55, 0, 0 };
}
-int expected_index( int index, row_major ) {
+int expected_index( size_t index, row_major ) {
// this is the data shown on http://www.netlib.org/lapack/lug/node124.html
// read row-by-row, aka row_major
int mapping[] = { 0, 0, 11, 12, 0, 21, 22, 23, 31, 32, 33, 34, 42, 43, 44, 45, 53, 54, 55, 0 };
return mapping[ index ];
}
-int expected_index_6_by_5( int index, column_major ) {
+int expected_index_6_by_5( size_t index, column_major ) {
// read column-by-column, aka column_major
int mapping[] = { 0, 11, 21, 31, 12, 22, 32, 42, 23, 33, 43, 53, 34, 44, 54, 64, 45, 55, 65, 0 };
return mapping[ index ];
}
-int expected_index_6_by_5( int index, row_major ) {
+int expected_index_6_by_5( size_t index, row_major ) {
// read row-by-row, aka row_major
int mapping[] = { 0, 0, 11, 12, 0, 21, 22, 23, 31, 32, 33, 34, 42, 43, 44, 45, 53, 54, 55, 0, 64, 65, 0, 0 };
return mapping[ index ];
}
-int expected_index_5_by_6( int index, column_major ) {
+int expected_index_5_by_6( size_t index, column_major ) {
// read column-by-column, aka column_major
int mapping[] = { 0, 11, 21, 31, 12, 22, 32, 42, 23, 33, 43, 53, 34, 44, 54, 0, 45, 55, 0, 0, 56, 0, 0, 0 };
return mapping[ index ];
}
-int expected_index_5_by_6( int index, row_major ) {
+int expected_index_5_by_6( size_t index, row_major ) {
// read row-by-row, aka row_major
int mapping[] = { 0, 0, 11, 12, 0, 21, 22, 23, 31, 32, 33, 34, 42, 43, 44, 45, 53, 54, 55, 56};
return mapping[ index ];
banded_matrix< int, Orientation > test_matrix( m, n, kl, ku );
test_matrix.clear();
- int band_storage_size = test_matrix.data().size();
+ size_t band_storage_size = test_matrix.data().size();
test_matrix( 0, 0 ) = 11;
test_matrix( 0, 1 ) = 12;
BOOST_UBLAS_TEST_TRACE( std::setw( 3 ) << test_matrix );
BOOST_UBLAS_TEST_TRACE( "data() of matrix" );
- for ( int i = 0; i < band_storage_size; ++i ) {
+ for ( size_t i = 0; i < band_storage_size; ++i ) {
std::cerr << test_matrix.data()[ i ] << " ";
}
std::cerr << std::endl;
BOOST_UBLAS_TEST_TRACE( "Expected data() of matrix" );
- for ( int i = 0; i < band_storage_size; ++i ) {
+ for ( size_t i = 0; i < band_storage_size; ++i ) {
std::cerr << expected_index( i, Orientation() ) << " ";
}
std::cerr << std::endl;
size_t mismatch = 0;
- for ( int i = 0; i < band_storage_size; ++i ) {
+ for ( size_t i = 0; i < band_storage_size; ++i ) {
if ( test_matrix.data()[ i ] != expected_index( i, Orientation() ) ) {
++mismatch;
}
banded_matrix< int, Orientation > test_matrix( m, n, kl, ku );
test_matrix.clear();
- int band_storage_size = test_matrix.data().size();
+ size_t band_storage_size = test_matrix.data().size();
test_matrix( 0, 0 ) = 11;
test_matrix( 0, 1 ) = 12;
BOOST_UBLAS_TEST_TRACE( std::setw( 3 ) << test_matrix );
BOOST_UBLAS_TEST_TRACE( "data() of matrix" );
- for ( int i = 0; i < band_storage_size; ++i ) {
+ for ( size_t i = 0; i < band_storage_size; ++i ) {
std::cerr << test_matrix.data()[ i ] << " ";
}
std::cerr << std::endl;
BOOST_UBLAS_TEST_TRACE( "Expected data() of matrix" );
- for ( int i = 0; i < band_storage_size; ++i ) {
+ for ( size_t i = 0; i < band_storage_size; ++i ) {
std::cerr << expected_index_6_by_5( i, Orientation() ) << " ";
}
std::cerr << std::endl;
size_t mismatch = 0;
- for ( int i = 0; i < band_storage_size; ++i ) {
+ for ( size_t i = 0; i < band_storage_size; ++i ) {
if ( test_matrix.data()[ i ] != expected_index_6_by_5( i, Orientation() ) ) {
++mismatch;
}
banded_matrix< int, Orientation > test_matrix( m, n, kl, ku );
test_matrix.clear();
- int band_storage_size = test_matrix.data().size();
+ size_t band_storage_size = test_matrix.data().size();
test_matrix( 0, 0 ) = 11;
test_matrix( 0, 1 ) = 12;
BOOST_UBLAS_TEST_TRACE( std::setw( 3 ) << test_matrix );
BOOST_UBLAS_TEST_TRACE( "data() of matrix" );
- for ( int i = 0; i < band_storage_size; ++i ) {
+ for ( size_t i = 0; i < band_storage_size; ++i ) {
std::cerr << test_matrix.data()[ i ] << " ";
}
std::cerr << std::endl;
BOOST_UBLAS_TEST_TRACE( "Expected data() of matrix" );
- for ( int i = 0; i < band_storage_size; ++i ) {
+ for ( size_t i = 0; i < band_storage_size; ++i ) {
std::cerr << expected_index_5_by_6( i, Orientation() ) << " ";
}
std::cerr << std::endl;
size_t mismatch = 0;
- for ( int i = 0; i < band_storage_size; ++i ) {
+ for ( size_t i = 0; i < band_storage_size; ++i ) {
if ( test_matrix.data()[ i ] != expected_index_5_by_6( i, Orientation() ) ) {
++mismatch;
}
BOOST_UBLAS_TEST_DO( banded_matrix_row_major_5_by_6 );
- BOOST_UBLAS_TEST_END();
-
- return EXIT_SUCCESS;
+ BOOST_UBLAS_TEST_END();
}
-
-