The Vish Visualization Shell 0.3
Vish
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Eagle::LowerTriangular< N, value > Class Template Reference

A symmetric matrix stored in lower triangular form. More...

#include <elementary/eagle/Matrix.hpp>

Inheritance diagram for Eagle::LowerTriangular< N, value >:
Eagle::Vector< value, N *(N+1)/2 > Eagle::FixedArray< value, N >

Public Types

typedef Vector< value, N *(N+1)/2 > Base_t
 The (vectorial) base class.
 
typedef Base_t::Vector_t Vector_t
 The compatible vector class.
 
- Public Types inherited from Eagle::Vector< value, N *(N+1)/2 >
enum  
 The number of elements in this array.
 
- Public Types inherited from Eagle::FixedArray< value, N >
typedef FlattenedArray_t::value_type Element_t
 The maximally reduced type of elements stored here.
 
typedef GetFixedArrayType< value >::result_t ElementAsFixedArray_t
 Element type as fixed array, if it is convertible to a fixed array.
 
typedef FixedArray FixedArray_t
 Exporting the type definition of this array cass type.
 
typedef FixedArrayFlattener< FixedArrayOfElements_tFixedArrayFlattener_t
 Internal helper class.
 
typedef FixedArray< ElementAsFixedArray_t, N > FixedArrayOfElements_t
 If the value is derived from a fixed array type itself, then the FixedArrayOfElements_t is an FixedArray<FixedArray<>> type.
 
typedef FixedArrayFlattener_t::result_t FlattenedArray_t
 Reduction of this array type, if it is nested, to an flattened type which contains elementary types.
 
typedef value value_type
 Export the type of the respective element value type.
 

Public Member Functions

 LowerTriangular ()
 Constructor, does not initialize anything.
 
 LowerTriangular (const LowerTriangular &LT)
 Copy constructor.
 
 LowerTriangular (const LowerTriangular &LT, const LowerTriangular &RT, const Operator<'+'> &A)
 Computational constructor for adding two types.
 
 LowerTriangular (const LowerTriangular &LT, const LowerTriangular &RT, const Operator<'-'> &A)
 Computational constructor for adding two types.
 
 LowerTriangular (const LowerTriangular &LT, const value &v, const Operator<' *'> &M)
 Computational constructor for scalar multiplication.
 
template<class T >
 LowerTriangular (const LowerTriangular< N, T > &LT)
 Construct from symmetric matrix of same size but different type.
 
template<class T >
constexpr LowerTriangular (const std::initializer_list< T > &Init)
 Initialize from initializer list.
 
template<class T >
 LowerTriangular (const Vector< T, N *(N+1)/2 > &V)
 Construct symmetric matrix from compatible vector of possibly different type.
 
value & operator() (dimension_t row, dimension_t column)
 read/write Element access
 
const value & operator() (dimension_t row, dimension_t column) const
 readonly Element access
 
LowerTriangular< N-1, value > & submatrix ()
 Due to the special layout of the LowerTriangular matrix class, retrieving a writeable reference to the lower dimensional submatrix is a possible operation and without runtime costs.
 
const LowerTriangular< N-1, value > & submatrix () const
 Due to the special layout of the LowerTriangular matrix class, retrieving a reference to the lower dimensional submatrix is a no-cost operation.
 
- Public Member Functions inherited from Eagle::Vector< value, N *(N+1)/2 >
Base_tfixed_array ()
 Provide access to the base class, writable.
 
const Base_tfixed_array () const
 Provide access to the base class, read-only.
 
Vectoroperator*= (const value &value)
 Self-multiplication.
 
Vectoroperator+= (const Vector &v)
 Self-addition.
 
Vector operator- () const
 Unary minus.
 
Vectoroperator-= (const Vector &v)
 Self-subtraction.
 
Vectoroperator/= (const value &value)
 Self-division.
 
Assignment< Vector, 0 > operator= (const scalar &x)
 Assign first element with scalar and use consecutive comma expressions for assignment of further elements As such a Vector may be assigned as.
 
Vectoroperator= (const Vector &src)
 Assignment operator.
 
void set (const V &value)
 Assign all values to the same scalar.
 
constexpr Vector ()
 Default constructor.
 
 Vector (const FixedArray< AType, n > &l, const FixedArray< BType, n > &r, const Operator< CompType > &Op)
 Computational constructor for binary operations on two fixed arrays, calls the Operator's ternary() member function for each element.
 
 Vector (const FixedArray< AType, n > &l, const Operator< CompType > &, const ScalarType &scalar)
 Computational constructor from vector with scalar, calls the Operator's ternary() member function for each element and the scalar as its 3rd argument.
 
 Vector (const FixedArray< InputType, SIZE > &V)
 Type conversion constructor.
 
 Vector (const Indicable &I, const AnyType &)
 Construct from indicable object, i.e.
 
 Vector (const Operator< CompType > &, const ScalarType &scalar, const FixedArray< AType, n > &v)
 Computational constructor from scalar with vector calls the Operator's ternary() member function for each element and the scalar as its 2nd argument.
 
constexpr Vector (const std::initializer_list< InputType > &Init)
 Construct from a initialization array.
 
 Vector (const value &a)
 Convenience Constructor: initialize the first element.
 
 Vector (const value &a, const value &b)
 Convenience Constructor: initialize the first two elements.
 
 Vector (const value &a, const value &b, const value &c)
 Convenience Constructor: initialize the first three elements.
 
 Vector (const value &a, const value &b, const value &c, const value &d)
 Convenience Constructor: initialize the first four elements.
 
 Vector (const Vector &l, const Vector &r, const Operator< CompType > &)
 Computational constructor for binary operations on two vectors calls the Operator's ternary() member function for each element.
 
 Vector (const Vector &NV, const Sub &, const Sub &)
 Computational constructor for unary minus.
 
constexpr Vector (const Vector &v)
 Copy constructor.
 
 Vector (const Vector &v, const Operator<'-'> &)
 Unitary minus computational constructor Applies the unitary minus to each element.
 
 Vector (const Vector< InputType, SIZE > &V)
 Type conversion constructor.
 
- Public Member Functions inherited from Eagle::FixedArray< value, N >
void expandMinMax (FixedArray &MinValues, FixedArray &MaxValues) const
 Expand a range given by MinValues,MaxValues to include the values of this array, done per component.
 
constexpr FixedArray () noexcept
 Default constructor.
 
template<class AType , class BType , OperatorID_t CompType>
constexpr FixedArray (const FixedArray< AType, N > &l, const FixedArray< BType, N > &r, const Operator< CompType > &)
 Computational constructor for binary operations on two fixed arrays, calls the Operator's ternary() member function for each element.
 
template<typename T , dimension_t M>
constexpr FixedArray (const FixedArray< T, M > &F, const T &DefaultValue)
 Construct array from another array type of variable length.
 
template<typename T >
constexpr FixedArray (const FixedArray< T, N > &F)
 Automatic type conversion function.
 
template<typename T , typename ConversionFunctor >
constexpr FixedArray (const FixedArray< T, N > &F, const ConversionFunctor &CF, const FA_CONVERT &)
 Construct array from another array type of same length.
 
template<class InitType >
constexpr FixedArray (const std::initializer_list< InitType > &Init)
 Construct from a initialization array.
 
constexpr FixedArray (const value &a)
 Convenience Constructor: initialize the first element.
 
constexpr FixedArray (const value &a, const value &b)
 Convenience Constructor: initialize the first two elements.
 
 FixedArray (const value &a, const value &b, const value &c)
 Convenience Constructor: initialize the first three elements.
 
constexpr FixedArray (const value &a, const value &b, const value &c, const value &d)
 Convenience Constructor: initialize the first four elements.
 
constexpr FixedArray (const value &a, const value &b, const value &c, const value &d, const value &e)
 Convenience Constructor: initialize the first five elements.
 
constexpr value & get (int i)
 writable element access
 
constexpr const value & get (int i) const
 read-only element access
 
template<int subsize, int offset>
constexpr const FixedArray< value, subsize > * get_subarray () const
 Helper class for retrieve a subset of the current array.
 
constexpr const FixedArray< value, SIZE-1 > & get_subdim () const
 Mainly introduced because of Interpolate::operator[].
 
const FixedArray_tgetFixedArray () const noexcept
 convenience function for base classes
 
FixedArray_tgetFixedArray () noexcept
 convenience function for base classes
 
constexpr value getMax () const
 Compute the maximum element value of this array.
 
constexpr value getMin () const
 Compute the maximum element value of this array.
 
template<typename T >
constexpr bool operator!= (const FixedArray< T, N > &F) const
 Compare two arrays.
 
template<typename T >
constexpr bool operator== (const FixedArray< T, N > &F) const
 Compare two arrays.
 
constexpr value & operator[] (int i)
 writeable element access operator
 
constexpr const value & operator[] (int i) const
 read-only element access operator
 
constexpr value * ptr (int i=0) noexcept
 Return a pointer to the ith element, no range checking.
 
template<class Value >
constexpr void set (const Value &x)
 Set all array elements to the same value.
 
void setFromArray (const value *x, int length=SIZE, int offset=0)
 Set all array elements to an array's element value.
 
void sort (FixedArray< int, N > &I) const
 Sort the elements of an array into the index array.
 

Static Public Member Functions

static constexpr dimension_t mem_index (dimension_t row, dimension_t column)
 Retrieve the linear index from row/column indices.
 
- Static Public Member Functions inherited from Eagle::FixedArray< value, N >
template<typename T , typename ConversionFunctor >
static constexpr FixedArray convert (const FixedArray< T, N > &F, const ConversionFunctor &CF)
 Perform a type conversion on a given fixed array into another basis type:
 
static constexpr dimension_t size ()
 The number of elements here.
 

Public Attributes

STATIC_CONSTEXPR_BEGIN columns = N
 number of columns
 
STATIC_CONSTEXPR_BEGIN rows = N
 number of rows
 

Static Public Attributes

static constexpr auto MEMSIZE = sizeof(Base_t) / sizeof(value)
 The number of value elements occupied in memory due to alignment.
 
static constexpr auto SIZE = Vector_t::SIZE
 The number of value elements, i.e. N*(N+1)/2.
 

Additional Inherited Members

- Protected Attributes inherited from Eagle::FixedArray< value, N >
value data [SIZE]
 The actual data values, intentional no-initialization for data member, which increases performance on vector creation.
 

Detailed Description

template<dimension_t N, class value>
class Eagle::LowerTriangular< N, value >

A symmetric matrix stored in lower triangular form.

For a 3x3 symmetric matrix (six independent components) we get the following layout:

0 1 3
1 2 4
3 4 5

and for a 4x4 symmetric matrix with ten components we get:

0 1 3 6
1 2 4 7
3 4 5 8
6 7 8 9

This layout ensures that the upper left submatrix of lower dimension is always contained in higher dimensional matrices. I.e. a matrix of type LowerTriangular<N> may always be casted to a matrix of type LowerTriangular<N-n> with n<N.