Demonstrate MultiArrayView::transpose()
Usage: transpose
#include <iostream>
#include <vigra/multi_array.hxx>
#include <vigra/linear_algebra.hxx>
template <class T>
{
for(
int y=0; y<array.
shape(1); ++y)
{
for(
int x=0; x<array.
shape(0); ++x)
std::cout << array(x, y) << " ";
std::cout << "\n";
}
}
{
{
}
std::cout << "base_array:\n";
std::cout << "transarray:\n";
std::cout << "transArrayView:\n";
std::cout << "base_array after setting transarray to 5\n(no change, since transarray is a copy):\n";
std::cout << "base_array after setting transarrayView to 5\n(base_array changes because transarrayView is a view):\n";
std::cout <<
"Shape of array5D: " <<
array5D.shape() <<
"\n";
std::cout <<
"Shape of array5D view after default transpose(): " <<
arrayview5D.shape() <<
"\n";
std::cout <<
"Shape of array5D view after user-defined transpose(): " <<
arrayview5D_permuted.shape() <<
"\n";
std::cout << " (applied permutation 2 => 0, 1 => 1, 3 => 2, 4 => 3, 0 => 4 to the axes)\n";
return 0;
}
const difference_type & shape() const
Definition multi_array.hxx:1648
Class for a single RGB value.
Definition rgbvalue.hxx:128
size_type size() const
Definition tinyvector.hxx:913
Class for fixed size vectors.
Definition tinyvector.hxx:1008