mesh_conv::MC_matrix Class Reference

A Full Matrix class. More...

Collaboration diagram for mesh_conv::MC_matrix:
Collaboration graph
[legend]

List of all members.

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_matrixclear ()
int size_1 () const
int size_2 () const
MC_int_vector size () const
int size_vec () const
MC_matrixresize (const MC_int_vector &new_size)
 internal resize the matrix
MC_matrixresize (const int &size_1, const int &size_2=-1)
 internal resize the matrix (if size_2==-1 by default, resize a square matrix)
MC_matrixresize_1 (const int &size_1)
 internal resize only in x
MC_matrixresize_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_matrixset_block (const MC_int_vector &index_1, const MC_int_vector &index_2, const MC_matrix &block)
 set a block of matrix
MC_matrixset_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_vectorto_vec () const
 return a vector of the matrix (similar to M(:))
MC_matrixadd_row (const MC_v3d &x0)
 add a block of MC_v3d only if size if (n,3)
MC_matrixadd_row (const MC_v3d &x0, const MC_v3d &x1)
 add a block of MC_v3d only if size if (n,3)
MC_matrixadd_row (const MC_v3d &x0, const MC_v3d &x1, const MC_v3d &x2)
MC_matrixadd_row (const MC_double_vector &col)
 add a column block only if size are compatibles
MC_matrixset_row (const int &id_row, const MC_double_vector &row)
 set a full row given a double_vector resize the matrix if needed
MC_matrixadd_col (const MC_v3d &x0)
 add a block of V_3D only if size if (3,n)
MC_matrixadd_col (const MC_v3d &x0, const MC_v3d &x1)
 add a block of V_3D only if size if (3,n)
MC_matrixadd_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_matrixadd_col (const MC_double_vector &col)
 add a column block only if size are compatibles
MC_matrixset_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_v3dto_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_matrixoperator+= (const double &a)
 internal add a scalar value
MC_matrixoperator+= (const MC_matrix &M)
 internal add an other matrix
MC_matrixoperator*= (const double &a)
 internal multiplication by a scalar
MC_matrixoperator/= (const double &a)
 internal division by a scalar
MC_matrixoperator*= (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_matrixadd_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_matrixset_translation (const MC_v3d &tr)
 set the translation part of a matrix 4x4
MC_matrixset_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

Detailed Description

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


Constructor & Destructor Documentation

mesh_conv::MC_matrix::MC_matrix (  ) 

empty constructor

References current_size, and resize().

Referenced by add_col(), add_row(), and zeros().

Here is the call graph for this function:

mesh_conv::MC_matrix::MC_matrix ( const int &  size_col,
const int &  size_row 
)

zeros matrix with given size

References current_size, and resize().

Here is the call graph for this function:

mesh_conv::MC_matrix::MC_matrix ( const int &  size_col  ) 

zeros square matrix with given size

References current_size, and resize().

Here is the call graph for this function:

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().

Here is the call graph for this function:

mesh_conv::MC_matrix::MC_matrix ( const MC_v3d v1,
const MC_v3d v2 
)

direct constructor from a MC_v3d

References current_size, and resize().

Here is the call graph for this function:

mesh_conv::MC_matrix::MC_matrix ( const MC_v3d v1,
const MC_v3d v2,
const MC_v3d v3 
)

direct constructor from a MC_v3d

References current_size, and resize().

Here is the call graph for this function:

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().

Here is the call graph for this function:

mesh_conv::MC_matrix::~MC_matrix (  ) 

destructor

References clear().

Here is the call graph for this function:


Member Function Documentation

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::add_col ( const MC_v3d x0,
const MC_v3d x1 
)

add a block of V_3D only if size if (3,n)

References add_col().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::add_col ( const MC_v3d x0  ) 

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*().

Here is the call graph for this function:

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().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::add_row ( const MC_v3d x0,
const MC_v3d x1,
const MC_v3d x2 
)

add a block of MC_v3d only if size if (n,3)

References add_row().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::add_row ( const MC_v3d x0,
const MC_v3d x1 
)

add a block of MC_v3d only if size if (n,3)

References add_row().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::add_row ( const MC_v3d x0  ) 

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().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::add_translation ( const MC_v3d tr  ) 

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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()().

Here is the call graph for this function:

void mesh_conv::MC_matrix::check_integrity (  )  const

check if size are consistent

Returns:
nothing but exit if something is wrong

References current_size, M, and mesh_conv::MC_double_vector::size().

Here is the call graph for this function:

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().

Here is the call graph for this function:

MC_matrix mesh_conv::MC_matrix::componentwise ( const MC_matrix M1  )  const

componentwise product

Warning:
matrices must have the same size
double mesh_conv::MC_matrix::det (  )  const

determinant

References M, size_1(), and size_2().

Referenced by inverted(), and rotation_parameter().

Here is the call graph for this function:

MC_matrix mesh_conv::MC_matrix::identity ( const int &  size  )  [static]
void mesh_conv::MC_matrix::internal_product ( MC_v4d to_multiply  )  const

internal product to a MC_v4d

See also:
MC_v4d::operator*=(const MC_matrix& M)
Returns:
nothing and the pointer to_multiply is set to the value M*to_multiply to goal of this function is do perform relativly fastly the product x=M*x <=> x*=M;

References M, size(), size_1(), and size_2().

Here is the call graph for this function:

void mesh_conv::MC_matrix::internal_product ( MC_v3d to_multiply  )  const

internal product to a MC_v3d

See also:
MC_v3d::operator*=(const MC_matrix& M)
Returns:
nothing and the pointer to_multiply is set to the value M*to_multiply to goal of this function is do perform relativly fastly the product x=M*x <=> x*=M;

References M, size(), size_1(), and size_2().

Referenced by mesh_conv::MC_v4d::operator*=(), and mesh_conv::MC_v3d::operator*=().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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

Returns:
a row matrix

References analyse_string(), and mesh_conv::MC_int_vector::linspace().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

MC_matrix mesh_conv::MC_matrix::operator() ( const MC_int_vector k_index  ) 

access from vector of real index in vector

Returns:
a row matrix Calculated as k1+N_1*k2

References mesh_conv::MC_int_vector::size().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::operator*= ( const MC_matrix M1  ) 

internal multiplication beween two matrix

Warning:
not optimized implementation
MC_matrix & mesh_conv::MC_matrix::operator*= ( const double &  a  ) 

internal multiplication by a scalar

References M, and mesh_conv::MC_double_vector::size().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::operator+= ( const MC_matrix M  ) 

internal add an other matrix

References M, mesh_conv::MC_double_vector::size(), size_1(), and size_2().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::operator+= ( const double &  a  ) 

internal add a scalar value

References M, and mesh_conv::MC_double_vector::size().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::operator/= ( const double &  a  ) 

internal division by a scalar

References M, and mesh_conv::MC_double_vector::size().

Here is the call graph for this function:

const double * mesh_conv::MC_matrix::pointer (  )  const

get the pointer on the value

Warning:
use with care

References M, and mesh_conv::MC_double_vector::pointer().

Referenced by display_callback(), draw_orientation(), and draw_pointer().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

MC_matrix mesh_conv::MC_matrix::repmat_2 ( const int &  k_repeat_2  )  const

repeat matrix by block in y direction

References repmat().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::resize_1 ( const int &  size_1  ) 

internal resize only in x

References resize(), and size_2().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::resize_2 ( const int &  size_2  ) 

internal resize only in y

References resize(), and size_1().

Here is the call graph for this function:

MC_matrix mesh_conv::MC_matrix::rotation ( const MC_v3d axis,
const double &  angle 
) [static]

init to a rotation matrix

axis of the rotation (normalized inside) angle in radians

References mesh_conv::MC_v3d::normalized().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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

Returns:
the rotation matrix R
the gradient (dR/da0[0],dR/da0[1],dR/da0[2],dR/da1[0],dR/da1[1],dR/da1[2])
Warning:
(a0,a1) have to be normalized before being used

References mesh_conv::MC_v3d_vector::component(), mesh_conv::MC_v3d::cross(), mesh_conv::MC_v3d::dot(), and mesh_conv::MC_v3d::norm().

Here is the call graph for this function:

std::pair< MC_v3d, double > mesh_conv::MC_matrix::rotation_parameter (  )  const

extract the rotation parameter if a matrix has size 3x3 or 4x4

Returns:
<the axis of rotation,the angle>
Warning:
the matrix must be a rotation matrix

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::set_rotation ( const MC_matrix m  ) 

set the rotation (block 3x3) part of a matrix 4x4 or 3x3

References M, size(), size_1(), and size_2().

Here is the call graph for this function:

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().

Here is the call graph for this function:

MC_matrix & mesh_conv::MC_matrix::set_translation ( const MC_v3d tr  ) 

set the translation part of a matrix 4x4

References M, size(), size_1(), and size_2().

Here is the call graph for this function:

MC_int_vector mesh_conv::MC_matrix::size (  )  const
int mesh_conv::MC_matrix::size_1 (  )  const
int mesh_conv::MC_matrix::size_2 (  )  const
int mesh_conv::MC_matrix::size_vec (  )  const

get size for a vector

must be a vector

References current_size, and size().

Here is the call graph for this function:

const double & mesh_conv::MC_matrix::to_double (  )  const

return a double if size are ok (size_1()==1 && size_2()==1)

References M, size_1(), and size_2().

Here is the call graph for this function:

std::pair< MC_matrix, MC_v3d > mesh_conv::MC_matrix::to_matrix3 (  )  const

transform a 4x4 projective matrix transform into a 3x3 by resizing

Returns:
<MC_matrix: 3x3 matrix ,MC_v3d the translation>

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

const MC_double_vector & mesh_conv::MC_matrix::to_vec (  )  const

return a vector of the matrix (similar to M(:))

References M.

Referenced by mesh_conv::operator*().

double mesh_conv::MC_matrix::trace (  )  const

get trace

References size_1(), and size_2().

Referenced by rotation_parameter().

Here is the call graph for this function:

MC_v3d mesh_conv::MC_matrix::translation_part (  )  const

get the translation part of a matrix 4x4

Returns:
get_block("0:2","3") if the matrix is 4x4

References size(), size_1(), and size_2().

Referenced by mesh_conv::MC_navigator_tool::ray_world_space_cam1().

Here is the call graph for this function:

MC_matrix mesh_conv::MC_matrix::transposed (  )  const

transpose the matrix

References size_1(), and size_2().

Here is the call graph for this function:

MC_matrix mesh_conv::MC_matrix::zeros ( const int &  size  )  [static]

build a square zeros matrix

References MC_matrix().

Here is the call graph for this function:

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().

Here is the call graph for this function:


Friends And Related Function Documentation

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()

MC_matrix operator* ( const MC_matrix M1,
const MC_v3d V 
) [friend]

apply a matrix to a MC_v3d vector (size_2() must be 3

MC_matrix operator* ( const MC_matrix M1,
const MC_matrix M2 
) [friend]

multiply two matrices (size must be compatible)

MC_matrix operator* ( const double &  alpha,
const MC_matrix M1 
) [friend]

multiply a double to every value

MC_matrix operator* ( const MC_matrix M1,
const double &  alpha 
) [friend]

multiply a double to every value

MC_matrix operator+ ( const MC_matrix M1,
const MC_matrix M2 
) [friend]

add a matrix to an other (size must be compatible)

MC_matrix operator+ ( const double &  alpha,
const MC_matrix M1 
) [friend]

add a double to every value

MC_matrix operator+ ( const MC_matrix M1,
const double &  alpha 
) [friend]

add a double to every value

MC_matrix operator- ( const MC_matrix M1,
const MC_matrix M2 
) [friend]

substract a matrix to an other (size must be compatible)

MC_matrix operator- ( const double &  alpha,
const MC_matrix M1 
) [friend]

substract a double to every value

MC_matrix operator- ( const MC_matrix M1,
const double &  alpha 
) [friend]

substract a double to every value

MC_matrix operator/ ( const double &  alpha,
const MC_matrix M1 
) [friend]

divide a double to every value

MC_matrix operator/ ( const MC_matrix M1,
const double &  alpha 
) [friend]

divide a double to every value

std::ostream& operator<< ( std::ostream &  stream,
const MC_matrix _M 
) [friend]

output stream


Member Data Documentation

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().


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

Generated on Wed Nov 11 17:13:52 2009 by  doxygen 1.6.1