lite::diagonal Class Reference
[Array Transformations]

This transform returns a 1-D reference array that corresponds to the main diagonal of the array. More...

#include <array.hpp>

List of all members.

Public Member Functions

LITE_INLINE diagonal (const diagonal &)
LITE_INLINE diagonaloperator= (const diagonal &)

Detailed Description

This transform returns a 1-D reference array that corresponds to the main diagonal of the array.

Remarks:
When applied to a 0-D or 1-D array, it returns a reference to the array itself.
Example:
        array<float[6][4][5]> a;    // a 6x4x5 array

        a[diagonal()] = -1;         // left hand side is a float[4] reference array 

        // the above line is equivalent to:

        const int n = std::min(a.size().i0, std::min(a.size().i1, a.size().i2)); // n will be 4

        for (int i=0; i<n; i++)
            a(i, i, i) = -1;

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Defines

Generated on Fri Nov 6 02:03:21 2009 for Lite by  doxygen 1.6.0