Itasca C++ Interface
Loading...
Searching...
No Matches
VMatrix< T, S > Class Template Reference

A 1-Dimensional version of Matrix, to represent a vector. More...

#include <matrix.h>

Inheritance diagram for VMatrix< T, S >:
Matrix< T, S, 1 >

Public Types

using iterator = T *
using const_iterator = const T *

Public Member Functions

constexpr VMatrix (const VMatrix< T, S > &)=default
constexpr VMatrix (const Matrix< T, S, 1 > &m)
constexpr VMatrix< T, S > & operator= (const VMatrix< T, S > &m)=default
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
constexpr const T & operator[] (unsigned x) const
 1D version of array operator, which currently unfortunately eliminates [x][0] syntax on VMatrix (may need to fix later).
constexpr T & operator[] (unsigned x)
 1D version of array operator, which currently unfortunately eliminates [x][0] syntax on VMatrix (may need to fix later).
Public Member Functions inherited from Matrix< T, S, 1 >
constexpr Matrix ()
 Default constructor, does nothing and no initialization.
constexpr Matrix< T, SX, SY > & operator= (const Matrix< T, SX, SY > &)=default
constexpr const T & get (unsigned x, unsigned y) const
 Retrieve value at row x column y. Bounds checking is done in a debug compile.
constexpr const Column operator[] (unsigned y) const
 Array access operator returns a Column helper class, which has it's own [] operator to access a column of the row.
constexpr const T & operator() (unsigned x, unsigned y) const
 () operator access to get(x,y)
constexpr UVect2 size () const
constexpr const Matrix< T, SX, SY > & operator+= (const Matrix< T, SX, SY > &m)
 In-place matrix addition.
constexpr const Matrix< T, SX, SY > & operator-= (const Matrix< T, SX, SY > &m)
 In-place matrix subtraction.
constexpr const Matrix< T, SX, SY > & operator*= (const T &t)
 In-place multiplication by a scalar.
constexpr const Matrix< T, SX, SY > & operator/= (const T &t)
 In-place division by a scalar.
Matrix< T, SX, SY > operator+ (const Matrix< T, SX, SY > &m) const
 Binary addition operator.
Matrix< T, SX, SY > operator- (const Matrix< T, SX, SY > &m) const
 Binary subtraction operator.
Matrix< T, SX, SY > operator/ (const T &t) const
 Binary scalar division operator.
void addBlock (const Matrix< T, SX2, SY2 > &m, unsigned iSrc, unsigned jSrc, unsigned iDst, unsigned jDst)
 Adds a block to this matrix from matrix m using the block size (BX,BY), from block indices (iSrc,jSrc) to block indices (iDst,jDst).
void addGenBlock (const Matrix< T, SX2, SY2 > &m, unsigned iSrc, unsigned jSrc, unsigned iDst, unsigned jDst)
 Adds a block to this matrix from matrix m using the block size (BX,BY), from normal not block indices (iSrc,jSrc) to (iDst,jDst).
maxNorm () const
 Returns the infinity norm of the matrix, or the maximum absolute magnitude of any element.
Matrix< T, SY, SX > transpose () const
 Return the transpose of the matrix.
trace () const
 Return the trace of the matrix or the sum of the diagonal components. Works also if the matrix is not square.
constexpr void set (const T &t=T{})
 Set all entries in the matrix to t.
constexpr T minEntry () const
constexpr T maxEntry () const

(Note that these are not member symbols.)

template<class T>
constexpr VMatrix< T, 2 > toMatrix (const Vector2< T > &v)
template<class T>
constexpr VMatrix< T, 3 > toMatrix (const Vector3< T > &v)

Additional Inherited Members

Static Public Member Functions inherited from Matrix< T, S, 1 >
static constexpr Matrix< T, SX, SY > identity ()
 Returns an identity matrix (or as close as you can get if not diagonal).
Public Attributes inherited from Matrix< T, S, 1 >
t_ [SX][SY]

Detailed Description

template<class T, unsigned S>
class VMatrix< T, S >

A 1-Dimensional version of Matrix, to represent a vector.

The SY dimension is fixed at 1. May want to specialize the get() function for optimal efficiency later.


The documentation for this class was generated from the following file:
  • C:/Source/itasca-suite/common/base/src/matrix.h