TooN 2.1
Operator< T > Struct Template Reference

This is a struct used heavily in TooN internals. More...

#include <TooN.h>

List of all members.

Public Member Functions

Members in the category ``sized operators''
int size () const
int num_rows () const
int num_cols () const
Members used by Vector
template<int Size, class Precision , class Base >
void eval (Vector< Size, Precision, Base > &v) const
template<int Size, typename P1 , typename B1 >
void plusequals (Vector< Size, P1, B1 > &v) const
template<int Size, typename P1 , typename B1 >
void minusequals (Vector< Size, P1, B1 > &v) const
template<int Size, typename P1 , typename B1 >
Operator< T > add (const Vector< Size, P1, B1 > &v) const
template<int Size, typename P1 , typename B1 >
Operator< T > rsubtract (const Vector< Size, P1, B1 > &v) const
template<int Size, typename P1 , typename B1 >
Operator< T > lsubtract (const Vector< Size, P1, B1 > &v) const
Members used by Matrix

This function must be present for construction and assignment of matrices to work.

template<int R, int C, class P , class B >
void eval (Matrix< R, C, P, B > &m) const
template<int Rows, int Cols, typename P1 , typename B1 >
Operator< T > add (const Matrix< Rows, Cols, P1, B1 > &m) const
template<int Rows, int Cols, typename P1 , typename B1 >
Operator< T > rsubtract (const Matrix< Rows, Cols, P1, B1 > &m) const
template<int Rows, int Cols, typename P1 , typename B1 >
Operator< T > lsubtract (const Matrix< Rows, Cols, P1, B1 > &m) const
template<int Rows, int Cols, typename P1 , typename B1 >
void plusequals (Matrix< Rows, Cols, P1, B1 > &m) const
template<int Rows, int Cols, typename P1 , typename B1 >
void minusequals (Matrix< Rows, Cols, P1, B1 > &m) const
Members in the category ``sizeable oberators''
Operator< T > operator() (int size) const
Operator< T > operator() (int num_rows, int num_cols) const

Members in the category ``scalable operators''

typedef T Precision
template<class Pout , class Pmult >
Operator< Internal::Identity
< Pout > > 
scale_me (const Pmult &m) const

Detailed Description

template<typename T>
struct TooN::Operator< T >

This is a struct used heavily in TooN internals.

They have two main uses. The first use is in construction and is completely hidden. For an expression such as a+b, the return value of operator+ will be constructed in place in the return statement, to prevent excessive copying and calls to new/delete.

The other use is much more visible and is for objects such as TooN::Zeros and TooN::Idendity .

The features allowed (construction, addition, etc) depend on the members present. For simplicity, general arguments are given below. If members are non-general, then the operators will simply not be applicable to all vectors or matrices.

Operators belong to any of a number of categories depending on the members they provide. The categories are:


Member Function Documentation

void eval ( Vector< Size, Precision, Base > &  v) const
Operator<T> operator() ( int  size) const

Create an operator that knows its size.

Suitable for vectors and square matrices.