![]() |
ModelSpace
|
Standard vector class derived from Matrix. More...
#include <CartesianVector.hpp>
Public Member Functions | |
CartesianVector () | |
Redeclare constructors - note here that we're defining these to call their matrix counterparts, with the exception of the initializer list which we redefine for a vector Default constructor to initialize a vector to all zeroes. | |
CartesianVector (T elements) | |
Constructor to initialize a matrix with all the same element. | |
CartesianVector (const T(&initial)[L]) | |
Constructor for Matrix class with initialization. Initializes matrix to values passed in via array. | |
CartesianVector (const CartesianVector< T, L > &initial) | |
Copy constructor for Matrix class. Copies data from matrix object to the current instance. | |
CartesianVector (const std::array< T, L > &initial) | |
Constructor for vector initialization via array. | |
~CartesianVector () | |
Destructor – doesn't do anything because we don't dynamically allocate. | |
T & | operator[] (unsigned int idx) |
Function to return a vector value. | |
int | set (const unsigned int &idx, const T &value) |
Setter specific to the vector class. | |
int | get (const unsigned int &idx, T &result) const |
Getter specific to the vector class. | |
T | get (const unsigned int &idx) const |
Getter specific to the vector class. | |
int | norm (T &result) const |
Function to take the norm of a vector. | |
T | norm () const |
Function to take the norm of a vector. | |
int | normSquared (T &result) const |
Function to take the squared norm of a vector. | |
T | normSquared () const |
Function to take the squared norm of a vector. | |
int | unit (CartesianVector< T, L > &result) const |
Function to return the unitized version of the vector. | |
int | unitize () |
Function to unitize the current vector. | |
int | normalize () |
Function to unitize the current vector. | |
std::string | str () const |
Function to write out vector as a string. | |
void | dump () const |
Function to dump information on matrix. | |
int | set (const unsigned int &row, const unsigned int &col, const T &value) |
Function to set a single value in the matrix. | |
int | get (const unsigned int &row, const unsigned int &col, T &result) const |
Function to get a single value in the matrix. | |
T | get (const unsigned int &row, const unsigned int &col) const |
Function to get a single value in the matrix. | |
void | setFromArray (const T *start_ptr) |
Function to set the values of the matrix row-wise. | |
void | getAsArray (T *start_ptr) const |
Function to get the values of the matrix row-wise. | |
void | getCopy (Matrix< T, R, C > &result) const |
Function to get a copy of the matrix. | |
std::pair< unsigned int, unsigned int > | size () |
Function to get the size of the matrix. | |
void | max (T &result, std::pair< unsigned int, unsigned int > &index) const |
Function to return the maximum value in the matrix. | |
void | min (T &result, std::pair< unsigned int, unsigned int > &index) const |
Function to return the minimum value in the matrix. | |
int | det (T &result) const |
Function to return the determinant of the matrix. | |
int | inverse (Matrix< T, R, C > &result) const |
Function to return the inverse of the matrix. | |
Matrix< T, R, C > | inverse () const |
void | transpose (Matrix< T, C, R > &result) const |
Function to return the transpose of the matrix. | |
Matrix< T, C, R > | transpose () const |
int | trace (T &result) const |
Function to return the trace of the matrix. | |
void | setToZeros () |
Function to set all elements of the matrix to zero. | |
int | identity () |
Function to set matrix to identity, if it is a square matrix. | |
int | eye () |
Public Attributes | |
std::array< std::array< T, C >, R > | values |
The actual values held by the matrix – a two dimensional array of values indexed as (row, column). NOTE: Public for ease of access and speed (no need to use setter/getter), and functions in Matrix and Safemath libraries are tested safe. Behavior using matrices outside of clockwerk libraries should use setter/getter, rather than direct access, for safety. | |
Protected Member Functions | |
int | _checkLookupBoundaries (const unsigned int &start_r, const unsigned int &end_r, const unsigned int &start_c, const unsigned int &end_c) const |
Function to check, given a set of submatrix boundaries, that those boundaries are valid for the current matrix. | |
int | _LUPDecompose (T *A[R], unsigned int P[R+1]) const |
Function to take a 2-d matrix represented by A and decompose it into LU form. | |
Standard vector class derived from Matrix.
This file defines a simple vector class for cartesian systems in any number of dimensions. As an inherited class from the Matrix class defined in this directory, it can perform all matrix operations and has several operations of its own specific to vectors.
|
protectedinherited |
Function to take a 2-d matrix represented by A and decompose it into LU form.
A | A 2-d matrix represented as a double pointer After ops A contains a copy of both matrices L-E and U as A=(L-E)+U such that P*A=L*U. |
P | The permutation matrix to hold info on matrix changes |
|
inherited |
|
inline |
Getter specific to the vector class.
idx | The index to return |
|
inline |
Getter specific to the vector class.
idx | The index to return |
value | PBR return of the value in the vector |
|
inherited |
Function to get a single value in the matrix.
row | The row index |
col | The column index |
|
inherited |
Function to get a single value in the matrix.
row | The row index |
col | The column index |
value | PBR return of the value in the matrix |
|
inherited |
Function to get the values of the matrix row-wise.
start_ptr | The data address at which write should begin. |
|
inherited |
Function to get a copy of the matrix.
result | PBR return of a copy of this matrix |
|
inherited |
Function to set matrix to identity, if it is a square matrix.
|
inherited |
Function to return the inverse of the matrix.
result | PBR return of matrix inverse |
|
inherited |
Function to return the maximum value in the matrix.
result | PBR return of maximum value |
|
inherited |
Function to return the minimum value in the matrix.
result | PBR return of minimum value |
|
inline |
Function to take the norm of a vector.
int clockwerk::CartesianVector< T, L >::norm | ( | T & | result | ) | const |
Function to take the norm of a vector.
result | PBR return of the norm operation |
int clockwerk::CartesianVector< T, L >::normalize | ( | ) |
Function to unitize the current vector.
|
inline |
Function to take the squared norm of a vector.
int clockwerk::CartesianVector< T, L >::normSquared | ( | T & | result | ) | const |
Function to take the squared norm of a vector.
result | PBR return of the norm^2 operation |
T & clockwerk::CartesianVector< T, L >::operator[] | ( | unsigned int | idx | ) |
Function to return a vector value.
idx | The index to return |
|
inline |
Setter specific to the vector class.
idx | Vector element to set |
value | The value to set the element to |
|
inherited |
|
inherited |
Function to set the values of the matrix row-wise.
start_ptr | The data address at which read should begin. |
|
inlineinherited |
std::string clockwerk::CartesianVector< T, L >::str | ( | ) | const |
Function to write out vector as a string.
|
inherited |
Function to return the trace of the matrix.
result | PBR return of matrix trace |
|
inherited |
Function to return the transpose of the matrix.
result | PBR return of matrix transpose |
int clockwerk::CartesianVector< T, L >::unit | ( | CartesianVector< T, L > & | result | ) | const |
Function to return the unitized version of the vector.
result | PBR return of the unit vector |
int clockwerk::CartesianVector< T, L >::unitize | ( | ) |
Function to unitize the current vector.