Djinni  2.2
Public Types | Public Member Functions | Protected Attributes | Static Protected Attributes
Matrix< T, N > Class Template Reference

A recursive templatized structure representing a matrix of arbitrary dimensionality. More...

#include <TSPTWWorld.h>

Inheritance diagram for Matrix< T, N >:
Inheritance graph
[legend]
Collaboration diagram for Matrix< T, N >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef T value_type

Public Member Functions

 Matrix (std::vector< Matrix< T, N-1 > > matrix)
const Matrix< T, N-1 > & operator[] (const u_int32_t n) const
Matrix< T, N-1 > & operator[] (const u_int32_t n)
u_int32_t dimensions () const
void reset ()
u_int32_t size () const
void push_back (Matrix< T, N-1 > matrix)
void resize (const u_int32_t n)

Protected Attributes

std::vector< Matrix< T, N-1 > > _matrix

Static Protected Attributes

static const u_int32_t DIMENSIONS = N

Detailed Description

template<typename T, const int N>
class Matrix< T, N >

A recursive templatized structure representing a matrix of arbitrary dimensionality.

Originally we had our own Matrix class to provide arbitrary dimensions, but implemented it via runtime checks and nonrecursive structures. As it turns out this was precisely the wrong thing to do. Switching to a recursive template resulted in immense performance improvements.

Author:
Hansen
Since:
2.2.2

Definition at line 22 of file TSPTWWorld.h.


The documentation for this class was generated from the following file: