This example code is explained in the STXXL Matrix section
#include <iostream>
int main()
{
int height = 3;
int width = 3;
int internal_memory = 64 * 1024 * 1024;
const int small_block_order = 32;
block_schedular_type my_bs(internal_memory);
matrix_type A(my_bs, height, width);
matrix_type B(my_bs, height, width);
matrix_type C(my_bs, height, width);
typedef matrix_type::row_major_iterator row_iterator;
int i = 0;
for (row_iterator it_A = A.begin(); it_A != A.end(); ++it_A, ++i)
{
*it_A = i;
}
i = 0;
for (row_iterator it_B = B.begin(); it_B != B.end(); ++it_B, ++i)
{
*it_B = i * 2;
}
C = A * B;
C.transpose();
for (row_iterator it_C = C.begin(); it_C != C.end(); ++it_C)
{
std::cout << *it_C << " ";
}
return 0;
}