2.10.0
Freundlich's C++ toolkit
Public Types | Public Member Functions | Static Public Member Functions
fcppt::math::matrix::object< T, R, C, S > Class Template Reference

Detailed Description

template<typename T, fcppt::math::size_type R, fcppt::math::size_type C, typename S>
class fcppt::math::matrix::object< T, R, C, S >

A class representing a static matrix.

Represents a static R by C matrix, which is a matrix consisting of R rows and C columns.

Template Parameters
TThe matrix's value_type
RThe number of rows
CThe number of columns
SThe matrix's storage type

See the module documentation for more information.

Public Types

typedef fcppt::math::static_size< R > static_rows
 
typedef fcppt::math::static_size< C > static_columns
 
typedef static_rows static_size
 
typedef fcppt::math::static_size< static_rows::value *static_columns::value > dim_wrapper
 
typedef S storage_type
 A typedef for the S parameter. More...
 
typedef fcppt::math::size_type size_type
 A type that counts the number of elements in a matrix. More...
 
typedef fcppt::math::difference_type difference_type
 A type that provides the difference between the addresses of two elements in a matrix. More...
 
typedef T value_type
 A type that represents the data type stored in a matrix. More...
 
typedef fcppt::math::vector::object< T, C, fcppt::math::matrix::detail::row_view< T, C, S > > reference
 A reference to a row of the matrix. More...
 
typedef reference::reference inner_reference
 A reference to an element of the matrix. More...
 
typedef fcppt::math::vector::object< T, C, fcppt::math::matrix::detail::row_view< T, C, S const > > const_reference
 A const reference to a row of the matrix. More...
 
typedef const_reference::const_reference const_inner_reference
 A const reference to an element of the matrix. More...
 
typedef fcppt::math::matrix::row_type< T, C > row_type
 The type of a row, which is a vector of C elements. More...
 

Public Member Functions

 object (fcppt::no_init const &)
 Construct an uninitialized matrix. More...
 
 object (storage_type const &)
 Construct a matrix from a storage source. More...
 
template<typename ... Args>
 object (Args const &...)
 Constructs a matrix from R rows. More...
 
 object (object const &)
 Copy-construct the matrix from another matrix. More...
 
template<typename OtherStorage >
 object (fcppt::math::matrix::object< T, R, C, OtherStorage > const &)
 Create a matrix from a matrix with the same dimension and value type but different storage type. More...
 
objectoperator= (object const &)
 Copy the values from a different matrix. More...
 
template<typename OtherStorage >
objectoperator= (fcppt::math::matrix::object< T, R, C, OtherStorage > const &)
 Copy the values from a different matrix of the same size but different storage type. More...
 
 ~object ()
 
template<typename S2 >
objectoperator+= (object< T, R, C, S2 > const &)
 
template<typename S2 >
objectoperator-= (object< T, R, C, S2 > const &)
 
objectoperator*= (value_type const &)
 Multiply a matrix by a scalar. More...
 
reference get_unsafe (size_type)
 Returns a reference to a row in the matrix. More...
 
const_reference get_unsafe (size_type) const
 Returns a reference to a (constant) row in the matrix. More...
 
S & storage ()
 
S const & storage () const
 
inner_reference m00 ()
 
const_inner_reference m00 () const
 
inner_reference m01 ()
 
const_inner_reference m01 () const
 
inner_reference m02 ()
 
const_inner_reference m02 () const
 
inner_reference m03 ()
 
const_inner_reference m03 () const
 
inner_reference m10 ()
 
const_inner_reference m10 () const
 
inner_reference m11 ()
 
const_inner_reference m11 () const
 
inner_reference m12 ()
 
const_inner_reference m12 () const
 
inner_reference m13 ()
 
const_inner_reference m13 () const
 
inner_reference m20 ()
 
const_inner_reference m20 () const
 
inner_reference m21 ()
 
const_inner_reference m21 () const
 
inner_reference m22 ()
 
const_inner_reference m22 () const
 
inner_reference m23 ()
 
const_inner_reference m23 () const
 
inner_reference m30 ()
 
const_inner_reference m30 () const
 
inner_reference m31 ()
 
const_inner_reference m31 () const
 
inner_reference m32 ()
 
const_inner_reference m32 () const
 
inner_reference m33 ()
 
const_inner_reference m33 () const
 

Static Public Member Functions

static constexpr size_type rows ()
 Returns the number of rows in the matrix. More...
 
static constexpr size_type columns ()
 Returns the number of columns in the matrix. More...
 

Member Typedef Documentation

◆ const_inner_reference

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef const_reference::const_reference fcppt::math::matrix::object< T, R, C, S >::const_inner_reference

A const reference to an element of the matrix.

◆ const_reference

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef fcppt::math::vector::object< T, C, fcppt::math::matrix::detail::row_view< T, C, S const > > fcppt::math::matrix::object< T, R, C, S >::const_reference

A const reference to a row of the matrix.

◆ difference_type

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef fcppt::math::difference_type fcppt::math::matrix::object< T, R, C, S >::difference_type

A type that provides the difference between the addresses of two elements in a matrix.

◆ dim_wrapper

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef fcppt::math::static_size< static_rows::value * static_columns::value > fcppt::math::matrix::object< T, R, C, S >::dim_wrapper

◆ inner_reference

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef reference::reference fcppt::math::matrix::object< T, R, C, S >::inner_reference

A reference to an element of the matrix.

◆ reference

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef fcppt::math::vector::object< T, C, fcppt::math::matrix::detail::row_view< T, C, S > > fcppt::math::matrix::object< T, R, C, S >::reference

A reference to a row of the matrix.

◆ row_type

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef fcppt::math::matrix::row_type< T, C > fcppt::math::matrix::object< T, R, C, S >::row_type

The type of a row, which is a vector of C elements.

◆ size_type

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef fcppt::math::size_type fcppt::math::matrix::object< T, R, C, S >::size_type

A type that counts the number of elements in a matrix.

◆ static_columns

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef fcppt::math::static_size< C > fcppt::math::matrix::object< T, R, C, S >::static_columns

◆ static_rows

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef fcppt::math::static_size< R > fcppt::math::matrix::object< T, R, C, S >::static_rows

◆ static_size

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef static_rows fcppt::math::matrix::object< T, R, C, S >::static_size

◆ storage_type

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef S fcppt::math::matrix::object< T, R, C, S >::storage_type

A typedef for the S parameter.

◆ value_type

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
typedef T fcppt::math::matrix::object< T, R, C, S >::value_type

A type that represents the data type stored in a matrix.

Constructor & Destructor Documentation

◆ object() [1/5]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
fcppt::math::matrix::object< T, R, C, S >::object ( fcppt::no_init const &  )
explicit

Construct an uninitialized matrix.

Warning
The content of the matrix will be undefined (not null) after initialization

◆ object() [2/5]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
fcppt::math::matrix::object< T, R, C, S >::object ( storage_type const &  )
explicit

Construct a matrix from a storage source.

◆ object() [3/5]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
template<typename ... Args>
fcppt::math::matrix::object< T, R, C, S >::object ( Args const &  ...)
explicit

Constructs a matrix from R rows.

Constructs a matrix by using R arguments of type fcppt::math::matrix::object::row_type. You can use fcppt::math::matrix::row to create them.

◆ object() [4/5]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
fcppt::math::matrix::object< T, R, C, S >::object ( object< T, R, C, S > const &  )

Copy-construct the matrix from another matrix.

◆ object() [5/5]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
template<typename OtherStorage >
fcppt::math::matrix::object< T, R, C, S >::object ( fcppt::math::matrix::object< T, R, C, OtherStorage > const &  )
explicit

Create a matrix from a matrix with the same dimension and value type but different storage type.

Template Parameters
OtherStorageThe other matrix's storage type

◆ ~object()

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
fcppt::math::matrix::object< T, R, C, S >::~object ( )

Member Function Documentation

◆ columns()

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
static constexpr size_type fcppt::math::matrix::object< T, R, C, S >::columns ( )
static

Returns the number of columns in the matrix.

◆ get_unsafe() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
reference fcppt::math::matrix::object< T, R, C, S >::get_unsafe ( size_type  )

Returns a reference to a row in the matrix.

Warning
Behaviour is undefined if the index is out of range.

◆ get_unsafe() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_reference fcppt::math::matrix::object< T, R, C, S >::get_unsafe ( size_type  ) const

Returns a reference to a (constant) row in the matrix.

Warning
Behaviour is undefined if the index is out of range.

◆ m00() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m00 ( )

◆ m00() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m00 ( ) const

◆ m01() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m01 ( )

◆ m01() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m01 ( ) const

◆ m02() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m02 ( )

◆ m02() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m02 ( ) const

◆ m03() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m03 ( )

◆ m03() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m03 ( ) const

◆ m10() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m10 ( )

◆ m10() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m10 ( ) const

◆ m11() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m11 ( )

◆ m11() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m11 ( ) const

◆ m12() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m12 ( )

◆ m12() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m12 ( ) const

◆ m13() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m13 ( )

◆ m13() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m13 ( ) const

◆ m20() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m20 ( )

◆ m20() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m20 ( ) const

◆ m21() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m21 ( )

◆ m21() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m21 ( ) const

◆ m22() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m22 ( )

◆ m22() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m22 ( ) const

◆ m23() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m23 ( )

◆ m23() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m23 ( ) const

◆ m30() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m30 ( )

◆ m30() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m30 ( ) const

◆ m31() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m31 ( )

◆ m31() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m31 ( ) const

◆ m32() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m32 ( )

◆ m32() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m32 ( ) const

◆ m33() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
inner_reference fcppt::math::matrix::object< T, R, C, S >::m33 ( )

◆ m33() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
const_inner_reference fcppt::math::matrix::object< T, R, C, S >::m33 ( ) const

◆ operator*=()

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
object& fcppt::math::matrix::object< T, R, C, S >::operator*= ( value_type const &  )

Multiply a matrix by a scalar.

◆ operator+=()

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
template<typename S2 >
object& fcppt::math::matrix::object< T, R, C, S >::operator+= ( object< T, R, C, S2 > const &  )

◆ operator-=()

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
template<typename S2 >
object& fcppt::math::matrix::object< T, R, C, S >::operator-= ( object< T, R, C, S2 > const &  )

◆ operator=() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
object& fcppt::math::matrix::object< T, R, C, S >::operator= ( object< T, R, C, S > const &  )

Copy the values from a different matrix.

◆ operator=() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
template<typename OtherStorage >
object& fcppt::math::matrix::object< T, R, C, S >::operator= ( fcppt::math::matrix::object< T, R, C, OtherStorage > const &  )

Copy the values from a different matrix of the same size but different storage type.

Template Parameters
OtherStorageThe other matrix's storage type

◆ rows()

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
static constexpr size_type fcppt::math::matrix::object< T, R, C, S >::rows ( )
static

Returns the number of rows in the matrix.

◆ storage() [1/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
S& fcppt::math::matrix::object< T, R, C, S >::storage ( )

◆ storage() [2/2]

template<typename T , fcppt::math::size_type R, fcppt::math::size_type C, typename S >
S const& fcppt::math::matrix::object< T, R, C, S >::storage ( ) const