A Full Matrix class. More...
Public Member Functions | |
MC_matrix () | |
empty constructor | |
MC_matrix (const int &size_col, const int &size_row) | |
zeros matrix with given size | |
MC_matrix (const int &size_col) | |
zeros square matrix with given size | |
MC_matrix (const MC_matrix &size_row) | |
copy constructor | |
MC_matrix (const MC_v3d &v) | |
direct constructor from a MC_v3d | |
MC_matrix (const MC_v3d &v1, const MC_v3d &v2) | |
direct constructor from a MC_v3d | |
MC_matrix (const MC_v3d &v1, const MC_v3d &v2, const MC_v3d &v3) | |
direct constructor from a MC_v3d | |
MC_matrix (const MC_v3d_vector &v) | |
direct constructor from a set of MC_v3d | |
~MC_matrix () | |
destructor | |
void | check_integrity () const |
check if size are consistent | |
MC_matrix & | clear () |
int | size_1 () const |
int | size_2 () const |
MC_int_vector | size () const |
int | size_vec () const |
MC_matrix & | resize (const MC_int_vector &new_size) |
internal resize the matrix | |
MC_matrix & | resize (const int &size_1, const int &size_2=-1) |
internal resize the matrix (if size_2==-1 by default, resize a square matrix) | |
MC_matrix & | resize_1 (const int &size_1) |
internal resize only in x | |
MC_matrix & | resize_2 (const int &size_2) |
internal resize only in y | |
MC_matrix | reshaped_1 (const int &size_1) const |
reshape the matrix with a constant total size | |
MC_matrix | reshaped_2 (const int &size_2) const |
reshape the matrix with a constant total size | |
MC_matrix | reshaped (const MC_int_vector &new_size) const |
reshape the matrix with a constant total size | |
MC_matrix | reshaped (const int &new_size_1, const int &new_size_2) const |
reshape the matrix with a constant total size | |
MC_matrix | repmat (const int &k_repeat) const |
repeat matrix by block | |
MC_matrix | repmat (const int &k_repeat_1, const int &k_repeat_2) const |
repeat matrix by block | |
MC_matrix | repmat (const MC_int_vector &k_repeat) const |
repeat matrix by block | |
MC_matrix | repmat_1 (const int &k_repeat_1) const |
repeat matrix by block in x direction | |
MC_matrix | repmat_2 (const int &k_repeat_2) const |
repeat matrix by block in y direction | |
MC_matrix & | set_block (const MC_int_vector &index_1, const MC_int_vector &index_2, const MC_matrix &block) |
set a block of matrix | |
MC_matrix & | set_block (const int &start_x, const int &end_x, const int &start_y, const int &end_y, const MC_matrix &block) |
set a block of matrix | |
const double & | to_double () const |
return a double if size are ok (size_1()==1 && size_2()==1) | |
const MC_double_vector & | to_vec () const |
return a vector of the matrix (similar to M(:)) | |
MC_matrix & | add_row (const MC_v3d &x0) |
add a block of MC_v3d only if size if (n,3) | |
MC_matrix & | add_row (const MC_v3d &x0, const MC_v3d &x1) |
add a block of MC_v3d only if size if (n,3) | |
MC_matrix & | add_row (const MC_v3d &x0, const MC_v3d &x1, const MC_v3d &x2) |
MC_matrix & | add_row (const MC_double_vector &col) |
add a column block only if size are compatibles | |
MC_matrix & | set_row (const int &id_row, const MC_double_vector &row) |
set a full row given a double_vector resize the matrix if needed | |
MC_matrix & | add_col (const MC_v3d &x0) |
add a block of V_3D only if size if (3,n) | |
MC_matrix & | add_col (const MC_v3d &x0, const MC_v3d &x1) |
add a block of V_3D only if size if (3,n) | |
MC_matrix & | add_col (const MC_v3d &x0, const MC_v3d &x1, const MC_v3d &x2) |
add a block of V_3D only if size if (3,n) | |
MC_matrix & | add_col (const MC_double_vector &col) |
add a column block only if size are compatibles | |
MC_matrix & | set_col (const int &id_col, const MC_double_vector &col) |
set a full column given a double_vector | |
MC_matrix | to_matrix4 () const |
transform a 3x3 affine matrix into a 4x4 projective one (M[4][4]=1) | |
std::pair< MC_matrix, MC_v3d > | to_matrix3 () const |
transform a 4x4 projective matrix transform into a 3x3 by resizing | |
MC_matrix | transposed () const |
transpose the matrix | |
MC_matrix | inverted () const |
Invert the matrix if possible Use newmat class to invert. | |
double | det () const |
determinant | |
double | norm_2 () const |
get the norm_2 of the matrix return the sqrt(sum x_i^2) for every elements | |
double | trace () const |
get trace | |
MC_matrix | componentwise (const MC_matrix &M1) const |
componentwise product | |
std::pair< MC_v3d, double > | rotation_parameter () const |
extract the rotation parameter if a matrix has size 3x3 or 4x4 | |
MC_matrix & | operator+= (const double &a) |
internal add a scalar value | |
MC_matrix & | operator+= (const MC_matrix &M) |
internal add an other matrix | |
MC_matrix & | operator*= (const double &a) |
internal multiplication by a scalar | |
MC_matrix & | operator/= (const double &a) |
internal division by a scalar | |
MC_matrix & | operator*= (const MC_matrix &M1) |
internal multiplication beween two matrix | |
void | internal_product (MC_v3d *to_multiply) const |
internal product to a MC_v3d | |
void | internal_product (MC_v4d *to_multiply) const |
internal product to a MC_v4d | |
MC_matrix & | add_translation (const MC_v3d &tr) |
internal add to the translation part of a matrix 4x4 | |
double & | operator() (const int &k1, const int &k2) |
direct access | |
const double & | operator() (const int &k1, const int &k2) const |
direct access | |
double & | operator() (const int &k_index) |
access from real index in vector | |
const double & | operator() (const int &k_index) const |
access from real index in vector | |
MC_matrix | operator() (const MC_int_vector &k_index) |
access from vector of real index in vector | |
MC_matrix | operator() (const MC_int_vector &index_1, const MC_int_vector &index_2) const |
submatrix from vector of coordinates | |
MC_matrix | operator() (const std::string &string_index_1, const std::string &string_index_2) |
submatrix from vector of coordinates | |
MC_matrix | operator() (const std::string &string_index) |
submatrix from a vector of coordinates given by a string | |
MC_v3d | translation_part () const |
get the translation part of a matrix 4x4 | |
MC_matrix & | set_translation (const MC_v3d &tr) |
set the translation part of a matrix 4x4 | |
MC_matrix & | set_rotation (const MC_matrix &m) |
set the rotation (block 3x3) part of a matrix 4x4 or 3x3 | |
const double * | pointer () const |
get the pointer on the value | |
Static Public Member Functions | |
static MC_matrix | zeros (const int &size_1, const int &size_2) |
build a zeros matrix | |
static MC_matrix | zeros (const int &size) |
build a square zeros matrix | |
static MC_matrix | identity (const int &size) |
build a square identity matrix | |
static MC_matrix | rotation_axis_to_axis (const MC_v3d &a1, const MC_v3d &a2) |
build a rotation matrix transforming an axis a1 into an axis a2 | |
static MC_matrix | rotation_registration (const MC_matrix &X, const MC_matrix &X0) |
get the best rotation between a set of points | |
static MC_matrix | rotation (const MC_v3d &axis, const double &angle) |
init to a rotation matrix | |
static std::pair< MC_matrix, std::vector< MC_matrix > > | rotation_axis_to_axis_with_gradient (const MC_v3d &a0, const MC_v3d &a1) |
get the rotation matrix transforming a0 to a1 and the associated gradient | |
Private Member Functions | |
void | analyse_string (const std::string &to_analyse, int dim, int *start, double *increment, int *end) const |
internal string analyser for type "start:increment:end" fill start,increment and end for the first row (ex. "0:2:end" or "end-15:7:end-8") Recognisze key word ":"; "end"; "-" | |
void | analyse_string (const char *to_analyse, int dim, int *start, double *increment, int *end) const |
internal string analyser for type "start:increment:end" | |
Private Attributes | |
MC_double_vector | M |
the internal storage format is a vector of double | |
int | current_size [2] |
the stored size (size_y x size_x)=(nbr_line x nbr_row) At every moment size(M)=N[0]*N[1] should be respected | |
Friends | |
MC_matrix | operator+ (const MC_matrix &M1, const double &alpha) |
add a double to every value | |
MC_matrix | operator+ (const double &alpha, const MC_matrix &M1) |
add a double to every value | |
MC_matrix | operator+ (const MC_matrix &M1, const MC_matrix &M2) |
add a matrix to an other (size must be compatible) | |
MC_matrix | operator- (const MC_matrix &M1, const double &alpha) |
substract a double to every value | |
MC_matrix | operator- (const double &alpha, const MC_matrix &M1) |
substract a double to every value | |
MC_matrix | operator- (const MC_matrix &M1, const MC_matrix &M2) |
substract a matrix to an other (size must be compatible) | |
MC_matrix | operator* (const MC_matrix &M1, const double &alpha) |
multiply a double to every value | |
MC_matrix | operator* (const double &alpha, const MC_matrix &M1) |
multiply a double to every value | |
MC_matrix | operator* (const MC_matrix &M1, const MC_matrix &M2) |
multiply two matrices (size must be compatible) | |
MC_matrix | operator* (const MC_matrix &M1, const MC_v3d &V) |
apply a matrix to a MC_v3d vector (size_2() must be 3 | |
MC_double_vector | operator* (const MC_matrix &M1, const MC_double_vector &v) |
apply a matrix to a MC_double_vector if size_2()==double_vec.size() | |
MC_matrix | operator/ (const MC_matrix &M1, const double &alpha) |
divide a double to every value | |
MC_matrix | operator/ (const double &alpha, const MC_matrix &M1) |
divide a double to every value | |
std::ostream & | operator<< (std::ostream &stream, const MC_matrix &_M) |
output stream |
A Full Matrix class.
internal access is given by M(i,j)=M[i+j*size_i] Many internal operations are actually based on the newmat lib http://www.robertnz.net/nm_intro.htm
mesh_conv::MC_matrix::MC_matrix | ( | ) |
empty constructor
References current_size, and resize().
Referenced by add_col(), add_row(), and zeros().
mesh_conv::MC_matrix::MC_matrix | ( | const int & | size_col, | |
const int & | size_row | |||
) |
zeros matrix with given size
References current_size, and resize().
mesh_conv::MC_matrix::MC_matrix | ( | const int & | size_col | ) |
zeros square matrix with given size
References current_size, and resize().
mesh_conv::MC_matrix::MC_matrix | ( | const MC_matrix & | size_row | ) |
copy constructor
References current_size, and M.
mesh_conv::MC_matrix::MC_matrix | ( | const MC_v3d & | v | ) |
direct constructor from a MC_v3d
References current_size, and resize().
direct constructor from a MC_v3d
References current_size, and resize().
direct constructor from a MC_v3d
References current_size, and resize().
mesh_conv::MC_matrix::MC_matrix | ( | const MC_v3d_vector & | v | ) |
direct constructor from a set of MC_v3d
References current_size, resize(), and mesh_conv::MC_v3d_vector::size().
mesh_conv::MC_matrix::~MC_matrix | ( | ) |
MC_matrix & mesh_conv::MC_matrix::add_col | ( | const MC_double_vector & | col | ) |
add a column block only if size are compatibles
References resize(), set_col(), mesh_conv::MC_double_vector::size(), size_1(), and size_2().
MC_matrix & mesh_conv::MC_matrix::add_col | ( | const MC_v3d & | x0, | |
const MC_v3d & | x1, | |||
const MC_v3d & | x2 | |||
) |
add a block of V_3D only if size if (3,n)
References add_col().
add a block of V_3D only if size if (3,n)
References add_col().
add a block of V_3D only if size if (3,n)
References MC_matrix(), resize(), set_block(), size_1(), and size_2().
Referenced by add_col(), and mesh_conv::operator*().
MC_matrix & mesh_conv::MC_matrix::add_row | ( | const MC_double_vector & | col | ) |
add a column block only if size are compatibles
References resize(), set_row(), mesh_conv::MC_double_vector::size(), size_1(), and size_2().
add a block of MC_v3d only if size if (n,3)
References MC_matrix(), resize(), set_block(), size_1(), and size_2().
Referenced by add_row().
internal add to the translation part of a matrix 4x4
References M, size(), size_1(), and size_2().
Referenced by mesh_conv::MC_navigator_tool::current_cam1(), and mesh_conv::MC_navigator_tool::current_light1().
void mesh_conv::MC_matrix::analyse_string | ( | const char * | to_analyse, | |
int | dim, | |||
int * | start, | |||
double * | increment, | |||
int * | end | |||
) | const [private] |
internal string analyser for type "start:increment:end"
References analyse_string().
void mesh_conv::MC_matrix::analyse_string | ( | const std::string & | to_analyse, | |
int | dim, | |||
int * | start, | |||
double * | increment, | |||
int * | end | |||
) | const [private] |
internal string analyser for type "start:increment:end" fill start,increment and end for the first row (ex. "0:2:end" or "end-15:7:end-8") Recognisze key word ":"; "end"; "-"
References size_1(), size_2(), and mesh_conv::MC_string_tokenizer::tokenize().
Referenced by analyse_string(), and operator()().
void mesh_conv::MC_matrix::check_integrity | ( | ) | const |
check if size are consistent
References current_size, M, and mesh_conv::MC_double_vector::size().
MC_matrix & mesh_conv::MC_matrix::clear | ( | ) |
resize to 0
References current_size, M, and mesh_conv::MC_double_vector::resize().
Referenced by ~MC_matrix().
componentwise product
double mesh_conv::MC_matrix::det | ( | ) | const |
determinant
References M, size_1(), and size_2().
Referenced by inverted(), and rotation_parameter().
MC_matrix mesh_conv::MC_matrix::identity | ( | const int & | size | ) | [static] |
build a square identity matrix
Referenced by mesh_conv::MC_navigator_tool::current_cam1(), mesh_conv::MC_navigator_tool::current_light1(), inverted(), rotation_axis_to_axis(), and to_matrix4().
void mesh_conv::MC_matrix::internal_product | ( | MC_v4d * | to_multiply | ) | const |
void mesh_conv::MC_matrix::internal_product | ( | MC_v3d * | to_multiply | ) | const |
internal product to a MC_v3d
References M, size(), size_1(), and size_2().
Referenced by mesh_conv::MC_v4d::operator*=(), and mesh_conv::MC_v3d::operator*=().
MC_matrix mesh_conv::MC_matrix::inverted | ( | ) | const |
Invert the matrix if possible Use newmat class to invert.
if size=3x3 or 2x2 direct calculation
References det(), identity(), size_1(), and size_2().
Referenced by mesh_conv::MC_navigator_tool::ray_world_space_cam1().
double mesh_conv::MC_matrix::norm_2 | ( | ) | const |
get the norm_2 of the matrix return the sqrt(sum x_i^2) for every elements
References current_size.
MC_matrix mesh_conv::MC_matrix::operator() | ( | const std::string & | string_index | ) |
submatrix from a vector of coordinates given by a string
References analyse_string(), and mesh_conv::MC_int_vector::linspace().
MC_matrix mesh_conv::MC_matrix::operator() | ( | const std::string & | string_index_1, | |
const std::string & | string_index_2 | |||
) |
submatrix from vector of coordinates
take the set as a tensor product
References analyse_string(), and mesh_conv::MC_int_vector::linspace().
MC_matrix mesh_conv::MC_matrix::operator() | ( | const MC_int_vector & | index_1, | |
const MC_int_vector & | index_2 | |||
) | const |
submatrix from vector of coordinates
directly take the set of index_1 x index_2 as a tensor product
References mesh_conv::MC_int_vector::size().
MC_matrix mesh_conv::MC_matrix::operator() | ( | const MC_int_vector & | k_index | ) |
access from vector of real index in vector
References mesh_conv::MC_int_vector::size().
const double & mesh_conv::MC_matrix::operator() | ( | const int & | k_index | ) | const |
access from real index in vector
Calculated as k1+N_1*k2
References M, and mesh_conv::MC_double_vector::size().
double & mesh_conv::MC_matrix::operator() | ( | const int & | k_index | ) |
access from real index in vector
Calculated as k1+N_1*k2
References M, resize(), mesh_conv::MC_double_vector::size(), size_1(), and size_2().
const double & mesh_conv::MC_matrix::operator() | ( | const int & | k1, | |
const int & | k2 | |||
) | const |
direct access
References current_size, M, mesh_conv::MC_double_vector::size(), and size().
double & mesh_conv::MC_matrix::operator() | ( | const int & | k1, | |
const int & | k2 | |||
) |
direct access
References current_size, M, resize(), mesh_conv::MC_double_vector::size(), and size().
internal multiplication beween two matrix
MC_matrix & mesh_conv::MC_matrix::operator*= | ( | const double & | a | ) |
internal multiplication by a scalar
References M, and mesh_conv::MC_double_vector::size().
internal add an other matrix
References M, mesh_conv::MC_double_vector::size(), size_1(), and size_2().
MC_matrix & mesh_conv::MC_matrix::operator+= | ( | const double & | a | ) |
internal add a scalar value
References M, and mesh_conv::MC_double_vector::size().
MC_matrix & mesh_conv::MC_matrix::operator/= | ( | const double & | a | ) |
internal division by a scalar
References M, and mesh_conv::MC_double_vector::size().
const double * mesh_conv::MC_matrix::pointer | ( | ) | const |
get the pointer on the value
References M, and mesh_conv::MC_double_vector::pointer().
Referenced by display_callback(), draw_orientation(), and draw_pointer().
MC_matrix mesh_conv::MC_matrix::repmat | ( | const MC_int_vector & | k_repeat | ) | const |
repeat matrix by block
References repmat(), and mesh_conv::MC_int_vector::size().
MC_matrix mesh_conv::MC_matrix::repmat | ( | const int & | k_repeat_1, | |
const int & | k_repeat_2 | |||
) | const |
repeat matrix by block
References mesh_conv::MC_int_vector::linspace(), set_block(), size_1(), and size_2().
MC_matrix mesh_conv::MC_matrix::repmat | ( | const int & | k_repeat | ) | const |
repeat matrix by block
repeat k_reapeat times in x and y
Referenced by repmat(), repmat_1(), and repmat_2().
MC_matrix mesh_conv::MC_matrix::repmat_1 | ( | const int & | k_repeat_1 | ) | const |
repeat matrix by block in x direction
References repmat().
MC_matrix mesh_conv::MC_matrix::repmat_2 | ( | const int & | k_repeat_2 | ) | const |
repeat matrix by block in y direction
References repmat().
MC_matrix mesh_conv::MC_matrix::reshaped | ( | const int & | new_size_1, | |
const int & | new_size_2 | |||
) | const |
reshape the matrix with a constant total size
References reshaped().
MC_matrix mesh_conv::MC_matrix::reshaped | ( | const MC_int_vector & | new_size | ) | const |
reshape the matrix with a constant total size
References current_size, M, and mesh_conv::MC_double_vector::size().
Referenced by reshaped(), reshaped_1(), and reshaped_2().
MC_matrix mesh_conv::MC_matrix::reshaped_1 | ( | const int & | size_1 | ) | const |
reshape the matrix with a constant total size
References M, reshaped(), and mesh_conv::MC_double_vector::size().
MC_matrix mesh_conv::MC_matrix::reshaped_2 | ( | const int & | size_2 | ) | const |
reshape the matrix with a constant total size
References M, reshaped(), and mesh_conv::MC_double_vector::size().
MC_matrix & mesh_conv::MC_matrix::resize | ( | const int & | size_1, | |
const int & | size_2 = -1 | |||
) |
internal resize the matrix (if size_2==-1 by default, resize a square matrix)
References resize().
MC_matrix & mesh_conv::MC_matrix::resize | ( | const MC_int_vector & | new_size | ) |
internal resize the matrix
References current_size, M, and zeros().
Referenced by add_col(), add_row(), MC_matrix(), operator()(), resize(), resize_1(), and resize_2().
MC_matrix & mesh_conv::MC_matrix::resize_1 | ( | const int & | size_1 | ) |
MC_matrix & mesh_conv::MC_matrix::resize_2 | ( | const int & | size_2 | ) |
init to a rotation matrix
axis of the rotation (normalized inside) angle in radians
References mesh_conv::MC_v3d::normalized().
MC_matrix mesh_conv::MC_matrix::rotation_axis_to_axis | ( | const MC_v3d & | a1, | |
const MC_v3d & | a2 | |||
) | [static] |
build a rotation matrix transforming an axis a1 into an axis a2
Get rotation matrix R such that R a1 = a2 Automaticaly works on normalized axis
References mesh_conv::MC_v3d::cross(), mesh_conv::MC_v3d::dot(), identity(), mesh_conv::MC_v3d::norm(), and mesh_conv::MC_v3d::normalized().
std::pair< MC_matrix, std::vector< MC_matrix > > mesh_conv::MC_matrix::rotation_axis_to_axis_with_gradient | ( | const MC_v3d & | a0, | |
const MC_v3d & | a1 | |||
) | [static] |
get the rotation matrix transforming a0 to a1 and the associated gradient
References mesh_conv::MC_v3d_vector::component(), mesh_conv::MC_v3d::cross(), mesh_conv::MC_v3d::dot(), and mesh_conv::MC_v3d::norm().
std::pair< MC_v3d, double > mesh_conv::MC_matrix::rotation_parameter | ( | ) | const |
extract the rotation parameter if a matrix has size 3x3 or 4x4
References det(), mesh_conv::MC_int_vector::linspace(), mesh_conv::MC_v3d::norm(), size(), size_1(), size_2(), and trace().
Referenced by mesh_conv::MC_quaternion::MC_quaternion().
static MC_matrix mesh_conv::MC_matrix::rotation_registration | ( | const MC_matrix & | X, | |
const MC_matrix & | X0 | |||
) | [static] |
get the best rotation between a set of points
Use registration method to find rotation: Let's X, X0 be the 3D position in a matrix form Find R such that R X = X0 in the best way for froebenius norm. R = S V^t, with S.D.V^t = X X0^{t}.
MC_matrix & mesh_conv::MC_matrix::set_block | ( | const int & | start_x, | |
const int & | end_x, | |||
const int & | start_y, | |||
const int & | end_y, | |||
const MC_matrix & | block | |||
) |
set a block of matrix
block size must correspond to size of index_1 and 2
References mesh_conv::MC_int_vector::linspace(), and set_block().
MC_matrix & mesh_conv::MC_matrix::set_block | ( | const MC_int_vector & | index_1, | |
const MC_int_vector & | index_2, | |||
const MC_matrix & | block | |||
) |
set a block of matrix
block size must correspond to size of index_1 and 2
References mesh_conv::MC_int_vector::size(), size_1(), and size_2().
Referenced by add_col(), add_row(), mesh_conv::MC_quaternion::quat_interp(), repmat(), set_block(), and to_matrix4().
MC_matrix & mesh_conv::MC_matrix::set_col | ( | const int & | id_col, | |
const MC_double_vector & | col | |||
) |
set a full column given a double_vector
resize the matrix if needed
References mesh_conv::MC_double_vector::size().
Referenced by add_col().
MC_matrix & mesh_conv::MC_matrix::set_row | ( | const int & | id_row, | |
const MC_double_vector & | row | |||
) |
set a full row given a double_vector resize the matrix if needed
References mesh_conv::MC_double_vector::size().
Referenced by add_row().
MC_int_vector mesh_conv::MC_matrix::size | ( | ) | const |
get both sizes
References current_size.
Referenced by add_translation(), internal_product(), operator()(), mesh_conv::operator*(), rotation_parameter(), set_rotation(), set_translation(), size_vec(), to_matrix3(), to_matrix4(), and translation_part().
int mesh_conv::MC_matrix::size_1 | ( | ) | const |
get size 1
References current_size.
Referenced by add_col(), add_row(), add_translation(), analyse_string(), det(), internal_product(), inverted(), mesh_conv::MC_v3d::MC_v3d(), mesh_conv::MC_v4d::MC_v4d(), operator()(), mesh_conv::operator*(), mesh_conv::operator+(), operator+=(), mesh_conv::operator-(), mesh_conv::operator/(), mesh_conv::operator<<(), repmat(), resize_2(), rotation_parameter(), set_block(), set_rotation(), set_translation(), to_double(), to_matrix3(), to_matrix4(), trace(), translation_part(), and transposed().
int mesh_conv::MC_matrix::size_2 | ( | ) | const |
get size 2
References current_size.
Referenced by add_col(), add_row(), add_translation(), analyse_string(), det(), internal_product(), inverted(), mesh_conv::MC_v3d::MC_v3d(), mesh_conv::MC_v4d::MC_v4d(), operator()(), mesh_conv::operator*(), mesh_conv::operator+(), operator+=(), mesh_conv::operator-(), mesh_conv::operator/(), mesh_conv::operator<<(), repmat(), resize_1(), rotation_parameter(), set_block(), set_rotation(), set_translation(), to_double(), to_matrix3(), to_matrix4(), trace(), translation_part(), and transposed().
int mesh_conv::MC_matrix::size_vec | ( | ) | const |
get size for a vector
must be a vector
References current_size, and size().
const double & mesh_conv::MC_matrix::to_double | ( | ) | const |
transform a 4x4 projective matrix transform into a 3x3 by resizing
References size(), size_1(), and size_2().
Referenced by mesh_conv::MC_navigator_tool::axis_cam1(), mesh_conv::MC_navigator_tool::axis_light1(), mesh_conv::MC_navigator_tool::current_cam1(), mesh_conv::MC_navigator_tool::current_light1(), and mesh_conv::MC_navigator_tool::ray_world_space_cam1().
MC_matrix mesh_conv::MC_matrix::to_matrix4 | ( | ) | const |
transform a 3x3 affine matrix into a 4x4 projective one (M[4][4]=1)
References identity(), set_block(), size(), size_1(), and size_2().
Referenced by mesh_conv::MC_navigator_tool::current_cam1(), and mesh_conv::MC_navigator_tool::current_light1().
const MC_double_vector & mesh_conv::MC_matrix::to_vec | ( | ) | const |
double mesh_conv::MC_matrix::trace | ( | ) | const |
get trace
References size_1(), and size_2().
Referenced by rotation_parameter().
MC_v3d mesh_conv::MC_matrix::translation_part | ( | ) | const |
get the translation part of a matrix 4x4
References size(), size_1(), and size_2().
Referenced by mesh_conv::MC_navigator_tool::ray_world_space_cam1().
MC_matrix mesh_conv::MC_matrix::transposed | ( | ) | const |
MC_matrix mesh_conv::MC_matrix::zeros | ( | const int & | size | ) | [static] |
MC_matrix mesh_conv::MC_matrix::zeros | ( | const int & | size_1, | |
const int & | size_2 | |||
) | [static] |
build a zeros matrix
References MC_matrix().
Referenced by resize().
MC_double_vector operator* | ( | const MC_matrix & | M1, | |
const MC_double_vector & | v | |||
) | [friend] |
apply a matrix to a MC_double_vector if size_2()==double_vec.size()
multiply two matrices (size must be compatible)
multiply a double to every value
multiply a double to every value
add a matrix to an other (size must be compatible)
add a double to every value
add a double to every value
substract a matrix to an other (size must be compatible)
substract a double to every value
substract a double to every value
divide a double to every value
divide a double to every value
std::ostream& operator<< | ( | std::ostream & | stream, | |
const MC_matrix & | _M | |||
) | [friend] |
output stream
int mesh_conv::MC_matrix::current_size[2] [private] |
the stored size (size_y x size_x)=(nbr_line x nbr_row) At every moment size(M)=N[0]*N[1] should be respected
Referenced by check_integrity(), clear(), MC_matrix(), norm_2(), operator()(), reshaped(), resize(), size(), size_1(), size_2(), and size_vec().
MC_double_vector mesh_conv::MC_matrix::M [private] |
the internal storage format is a vector of double
Referenced by add_translation(), check_integrity(), clear(), det(), internal_product(), MC_matrix(), operator()(), operator*=(), mesh_conv::operator+(), operator+=(), mesh_conv::operator-(), operator/=(), pointer(), reshaped(), reshaped_1(), reshaped_2(), resize(), set_rotation(), set_translation(), to_double(), and to_vec().