mesh_conv::MC_v3d_vector Class Reference

Container class for a vector of MC_v3d. More...

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

List of all members.

Public Member Functions

 MC_v3d_vector ()
 empty constructor, void vector
 MC_v3d_vector (const int &new_size)
 constructor of a zeros vector of a given size
 MC_v3d_vector (const MC_v3d &v0)
 direct constructor with a MC_v3d
 MC_v3d_vector (const MC_v3d &v0, const MC_v3d &v1)
 direct constructor with a MC_v3d
 MC_v3d_vector (const MC_v3d &v0, const MC_v3d &v1, const MC_v3d &v2)
 direct constructor with a MC_v3d
 MC_v3d_vector (const MC_v3d &v0, const MC_v3d &v1, const MC_v3d &v2, const MC_v3d &v3)
 direct constructor with a MC_v3d
 MC_v3d_vector (const MC_v3d &v0, const MC_v3d &v1, const MC_v3d &v2, const MC_v3d &v3, const MC_v3d &v4)
 direct constructor with a MC_v3d
 MC_v3d_vector (const MC_v3d_vector &vec)
 copy constructor
 MC_v3d_vector (const std::vector< MC_v3d > &vec)
 direct constructor from a vector of MC_v3d
 MC_v3d_vector (const std::set< MC_v3d, MC_v3d_less > set)
 direct constructor from a set of MC_v3d
 MC_v3d_vector (const std::map< MC_v3d, int, MC_v3d_less > map)
 direct constructor from a map of MC_v3d
 MC_v3d_vector (const MC_double_vector &x_vector, const MC_double_vector &y_vector, const MC_double_vector &z_vector)
 direct constructor from a vector of x,y and z coordinates
void assert_bounds (const int &u) const
 Assert the value stays within the bounds.
int size () const
 get the size of the vector
void clear ()
 clear the vector to size 0
MC_v3d_vectorresize (const int &new_size)
 resize the vector in deleting value of adding zeros
MC_v3d_vectoradd (const MC_v3d &x)
 push back a R3 vector
MC_v3d_vectoradd (const MC_v3d_vector &v_x)
 push back a vector of MC_v3d&
MC_v3d_vectorset (const int &k_index, const MC_v3d &x)
MC_v3d_vectorset (const mesh_conv::MC_int_vector &k_index, const MC_v3d_vector &x)
const MC_v3dfirst () const
 return the first element (error if the list is empty)
MC_v3dfirst ()
 return the first element (error if the list is empty)
const MC_v3dlast () const
 return the last element (error if the list is empty)
MC_v3dlast ()
 return the last element (error if the list is empty)
MC_double_vector component (const int &k_dim) const
 extract one of the dimension of the vector
MC_v3d_vector operator- () const
 change the opposite sign of the current vector (unary negation)
MC_v3d_vectoroperator+= (const MC_v3d &to_add)
 internal add a value
MC_v3d_vectoroperator-= (const MC_v3d &to_sub)
 internal substraction
MC_v3d_vectoroperator*= (const double &to_mult)
 internal multiplication
MC_v3d_vectoroperator/= (const double &to_subdiv)
 internal divide
MC_v3d_vectoroperator+= (const MC_v3d_vector &to_add)
 internal add values
MC_v3d_vectoroperator-= (const MC_v3d_vector &to_sub)
 internal substraction
MC_v3d_vectoroperator*= (const MC_matrix &M)
 internal application of a matrix to the vector of MC_v3d (does the product x'=M*x)
MC_v3d_vectoroperator*= (const MC_double_vector &w)
 internal pointwise multiplication by a MC_double_vector
MC_v3d_vector normalized () const
 normalize each vector independently
MC_v3d_vectorscale (const MC_v3d_vector &s)
 internal scale the set of point by multipling componentwise with a v3d
std::pair< MC_v3d_vector, double > scaled_to_unit () const
 homogeneous scale the point set to fit into [0,1]
MC_v3d barycenter () const
 get the barycenter of the positions
const MC_v3doperator() (const int &k_index) const
 get operator
MC_v3doperator() (const int &k_index)
 get operator
const MC_v3doperator[] (const int &k_index) const
 get operator
MC_v3doperator[] (const int &k_index)
 get operator
MC_v3d_vector operator() (const MC_int_vector &index) const
 get a subset of the vector
MC_v3d_vector operator[] (const MC_int_vector &index) const
 get a subset of the vector
const MC_v3dpointer () const
 get pointer
MC_v3dpointer_unprotected ()
 get pointer
std::map< MC_v3d, int,
MC_v3d_less
to_map () const
 convert to std::map (coords is key and store the position as value)
std::set< MC_v3d, MC_v3d_lessto_set () const
 convert to std::set
std::list< MC_v3dto_list () const
 convert to list in the same order
std::pair< MC_v3d, MC_v3dbounding_box_elements () const
 get the extreme position min and max
MC_v3d bounding_box_length () const
 return the length in x,y,z coordinates of the bounding box
std::ostream & export_stream (std::ostream &output) const
 write to a stream in a transfering format (each coordinate separated by a space)
MC_v3d_vectorread_stream (std::istream &input)
 read from a stream in a transfering format (each coordinate separated by a space)

Static Public Member Functions

static MC_v3d_vector zeros (const int &new_size)
 build a vector of size new_size filled with zero
static MC_v3d sum (const MC_v3d_vector &vec)
 do a summation over the MC_v3d_vector
static MC_double_vector norm (const MC_v3d_vector &vec)
 return the norm a the vector independently

Protected Attributes

std::vector< MC_v3dv
 internal storage

Friends

MC_v3d_vector operator<< (const MC_v3d_vector &vec, const MC_v3d &value)
 add a value at the end of the vertex
MC_v3d_vector operator<< (const MC_v3d_vector &vec, const MC_v3d_vector &value)
 add a vector of values at the end of the vertex
MC_v3d_vector operator+ (const MC_v3d_vector &vec, const MC_v3d &to_add)
 add a MC_v3d value to the vector
MC_v3d_vector operator+ (const MC_v3d &to_add, const MC_v3d_vector &vec)
 add a MC_v3d value to the vector
MC_v3d_vector operator- (const MC_v3d_vector &vec, const MC_v3d &to_sub)
 substract a MC_v3d value to the vector
MC_v3d_vector operator* (const MC_v3d_vector &vec, const double &to_mult)
 multiply a double value to the vector
MC_v3d_vector operator* (const double &to_mult, const MC_v3d_vector &vec)
 multiply a double value to the vector
MC_v3d_vector operator/ (const MC_v3d_vector &vec, const double &to_subdiv)
 divide a double value to the vector
MC_v3d_vector operator+ (const MC_v3d_vector &vec, const MC_v3d_vector &to_add)
 add a set of value to the vector
MC_v3d_vector operator- (const MC_v3d_vector &vec, const MC_v3d_vector &to_sub)
 substract a v3d value to the vector
MC_v3d_vector operator* (const MC_matrix &M, const MC_v3d_vector &vec)
 apply a matrix to the vector of MC_v3d
MC_v3d_vector operator* (const MC_double_vector w, const MC_v3d_vector &vec)
 apply a pointwise multiplication by a MC_double_vector
MC_v3d_vector operator* (const MC_v3d_vector &vec, const MC_double_vector &w)
 apply a pointwise multiplication by a MC_double_vector
std::ostream & operator<< (std::ostream &output, const MC_v3d_vector &in)
 write to ostream the list (u0 u1 u2 ... )

Detailed Description

Container class for a vector of MC_v3d.

Internal structure is a std::vector<MV_v3d>


Constructor & Destructor Documentation

mesh_conv::MC_v3d_vector::MC_v3d_vector (  ) 

empty constructor, void vector

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const int &  new_size  ) 

constructor of a zeros vector of a given size

References v.

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d v0  ) 

direct constructor with a MC_v3d

References v.

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d v0,
const MC_v3d v1 
)

direct constructor with a MC_v3d

References v.

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d v0,
const MC_v3d v1,
const MC_v3d v2 
)

direct constructor with a MC_v3d

References v.

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d v0,
const MC_v3d v1,
const MC_v3d v2,
const MC_v3d v3 
)

direct constructor with a MC_v3d

References v.

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d v0,
const MC_v3d v1,
const MC_v3d v2,
const MC_v3d v3,
const MC_v3d v4 
)

direct constructor with a MC_v3d

References v.

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d_vector vec  ) 

copy constructor

References v.

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const std::vector< MC_v3d > &  vec  ) 

direct constructor from a vector of MC_v3d

References v.

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const std::set< MC_v3d, MC_v3d_less set  ) 

direct constructor from a set of MC_v3d

References v.

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const std::map< MC_v3d, int, MC_v3d_less map  ) 

direct constructor from a map of MC_v3d

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_double_vector x_vector,
const MC_double_vector y_vector,
const MC_double_vector z_vector 
)

direct constructor from a vector of x,y and z coordinates

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

Here is the call graph for this function:


Member Function Documentation

MC_v3d_vector & mesh_conv::MC_v3d_vector::add ( const MC_v3d_vector v_x  ) 

push back a vector of MC_v3d&

Returns:
the new vector

References size(), and v.

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::add ( const MC_v3d x  ) 

push back a R3 vector

Returns:
the new vector

References v.

Referenced by read_stream().

void mesh_conv::MC_v3d_vector::assert_bounds ( const int &  u  )  const

Assert the value stays within the bounds.

Returns:
nothing, but stop the programm if it goes outside bounds

References v.

Referenced by operator()(), and operator[]().

MC_v3d mesh_conv::MC_v3d_vector::barycenter (  )  const

get the barycenter of the positions

References size(), and sum().

Here is the call graph for this function:

std::pair< MC_v3d, MC_v3d > mesh_conv::MC_v3d_vector::bounding_box_elements (  )  const

get the extreme position min and max

Returns:
min
max

References first(), size(), and v.

Referenced by bounding_box_length(), and scaled_to_unit().

Here is the call graph for this function:

MC_v3d mesh_conv::MC_v3d_vector::bounding_box_length (  )  const

return the length in x,y,z coordinates of the bounding box

References bounding_box_elements().

Referenced by scaled_to_unit().

Here is the call graph for this function:

void mesh_conv::MC_v3d_vector::clear (  ) 

clear the vector to size 0

References v.

MC_double_vector mesh_conv::MC_v3d_vector::component ( const int &  k_dim  )  const

extract one of the dimension of the vector

References size(), v, and zeros().

Referenced by mesh_conv::MC_matrix::rotation_axis_to_axis_with_gradient().

Here is the call graph for this function:

std::ostream & mesh_conv::MC_v3d_vector::export_stream ( std::ostream &  output  )  const

write to a stream in a transfering format (each coordinate separated by a space)

References size(), and v.

Here is the call graph for this function:

MC_v3d & mesh_conv::MC_v3d_vector::first (  ) 

return the first element (error if the list is empty)

References size(), and v.

Here is the call graph for this function:

const MC_v3d & mesh_conv::MC_v3d_vector::first (  )  const

return the first element (error if the list is empty)

References size(), and v.

Referenced by bounding_box_elements(), mesh_conv::MC_v3d::MC_v3d(), mesh_conv::operator+(), operator+=(), mesh_conv::operator-(), and operator-=().

Here is the call graph for this function:

MC_v3d & mesh_conv::MC_v3d_vector::last (  ) 

return the last element (error if the list is empty)

References size(), and v.

Here is the call graph for this function:

const MC_v3d & mesh_conv::MC_v3d_vector::last (  )  const

return the last element (error if the list is empty)

References size(), and v.

Here is the call graph for this function:

MC_double_vector mesh_conv::MC_v3d_vector::norm ( const MC_v3d_vector vec  )  [static]

return the norm a the vector independently

References size(), and zeros().

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::normalized (  )  const

normalize each vector independently

References size(), and v.

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::operator() ( const MC_int_vector index  )  const

get a subset of the vector

References mesh_conv::MC_int_vector::size(), size(), v, and zeros().

Here is the call graph for this function:

MC_v3d & mesh_conv::MC_v3d_vector::operator() ( const int &  k_index  ) 

get operator

References assert_bounds(), and v.

Here is the call graph for this function:

const MC_v3d & mesh_conv::MC_v3d_vector::operator() ( const int &  k_index  )  const

get operator

References assert_bounds(), and v.

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::operator*= ( const MC_double_vector w  ) 

internal pointwise multiplication by a MC_double_vector

Warning:
the MC_double_vector must be the same size as the vector or of size 1

References mesh_conv::MC_double_vector::first(), mesh_conv::MC_double_vector::size(), size(), and v.

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::operator*= ( const MC_matrix M  ) 

internal application of a matrix to the vector of MC_v3d (does the product x'=M*x)

References size(), and v.

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::operator*= ( const double &  to_mult  ) 

internal multiplication

References size(), and v.

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::operator+= ( const MC_v3d_vector to_add  ) 

internal add values

to_add must be of size 1 or this->size()

References first(), size(), and v.

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::operator+= ( const MC_v3d to_add  ) 

internal add a value

References size(), and v.

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::operator- (  )  const

change the opposite sign of the current vector (unary negation)

Returns:
a new vector with opposite sign

References resize(), size(), and v.

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::operator-= ( const MC_v3d_vector to_sub  ) 

internal substraction

to_add must be of size 1 or this->size()

References first(), size(), and v.

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::operator-= ( const MC_v3d to_sub  ) 

internal substraction

References size(), and v.

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::operator/= ( const double &  to_subdiv  ) 

internal divide

References size(), and v.

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::operator[] ( const MC_int_vector index  )  const

get a subset of the vector

MC_v3d & mesh_conv::MC_v3d_vector::operator[] ( const int &  k_index  ) 

get operator

References assert_bounds(), and v.

Here is the call graph for this function:

const MC_v3d & mesh_conv::MC_v3d_vector::operator[] ( const int &  k_index  )  const

get operator

References assert_bounds(), and v.

Here is the call graph for this function:

const MC_v3d * mesh_conv::MC_v3d_vector::pointer (  )  const

get pointer

References v.

MC_v3d * mesh_conv::MC_v3d_vector::pointer_unprotected (  ) 

get pointer

Warning:
not protected

References v.

MC_v3d_vector & mesh_conv::MC_v3d_vector::read_stream ( std::istream &  input  ) 

read from a stream in a transfering format (each coordinate separated by a space)

References add().

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::resize ( const int &  new_size  ) 

resize the vector in deleting value of adding zeros

Returns:
the new value

References v.

Referenced by mesh_conv::operator*(), mesh_conv::operator+(), mesh_conv::operator-(), operator-(), mesh_conv::operator/(), and zeros().

MC_v3d_vector & mesh_conv::MC_v3d_vector::scale ( const MC_v3d_vector s  ) 

internal scale the set of point by multipling componentwise with a v3d

References size(), and v.

Here is the call graph for this function:

std::pair< MC_v3d_vector, double > mesh_conv::MC_v3d_vector::scaled_to_unit (  )  const

homogeneous scale the point set to fit into [0,1]

Returns:
the new vector
the applied scaling factor

References bounding_box_elements(), bounding_box_length(), and size().

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::set ( const mesh_conv::MC_int_vector k_index,
const MC_v3d_vector x 
)

set an indexed value to a certain component. Adjust the size automatically

Returns:
the new vector with the setted component

k_index and x must have the same size (or x must be of size 1)

References mesh_conv::MC_int_vector::size(), size(), and zeros().

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::set ( const int &  k_index,
const MC_v3d x 
)

set an indexed value to a certain component. Adjust the size automatically

Returns:
the new vector with the setted component

References size(), and v.

Here is the call graph for this function:

int mesh_conv::MC_v3d_vector::size (  )  const
MC_v3d mesh_conv::MC_v3d_vector::sum ( const MC_v3d_vector vec  )  [static]

do a summation over the MC_v3d_vector

References size().

Referenced by barycenter(), and mesh_conv::MC_quaternion::quat_interp().

Here is the call graph for this function:

std::list< MC_v3d > mesh_conv::MC_v3d_vector::to_list (  )  const

convert to list in the same order

References size(), and v.

Here is the call graph for this function:

std::map< MC_v3d, int, MC_v3d_less > mesh_conv::MC_v3d_vector::to_map (  )  const

convert to std::map (coords is key and store the position as value)

References size(), and v.

Here is the call graph for this function:

std::set< MC_v3d, MC_v3d_less > mesh_conv::MC_v3d_vector::to_set (  )  const

convert to std::set

References size(), and v.

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::zeros ( const int &  new_size  )  [static]

build a vector of size new_size filled with zero

References resize().

Referenced by component(), norm(), mesh_conv::MC_v3d::normalized_with_gradient(), operator()(), mesh_conv::operator+(), mesh_conv::operator-(), and set().

Here is the call graph for this function:


Friends And Related Function Documentation

MC_v3d_vector operator* ( const MC_v3d_vector vec,
const MC_double_vector w 
) [friend]

apply a pointwise multiplication by a MC_double_vector

Warning:
the MC_double_vector must be the same size as the vector or of size 1
MC_v3d_vector operator* ( const MC_double_vector  w,
const MC_v3d_vector vec 
) [friend]

apply a pointwise multiplication by a MC_double_vector

Warning:
the MC_double_vector must be the same size as the vector or of size 1
MC_v3d_vector operator* ( const MC_matrix M,
const MC_v3d_vector vec 
) [friend]

apply a matrix to the vector of MC_v3d

MC_v3d_vector operator* ( const double &  to_mult,
const MC_v3d_vector vec 
) [friend]

multiply a double value to the vector

Returns:
the new vector
MC_v3d_vector operator* ( const MC_v3d_vector vec,
const double &  to_mult 
) [friend]

multiply a double value to the vector

Returns:
the new vector
MC_v3d_vector operator+ ( const MC_v3d_vector vec,
const MC_v3d_vector to_add 
) [friend]

add a set of value to the vector

Returns:
the new vector

to_add must be of size 1 or vec.size()

MC_v3d_vector operator+ ( const MC_v3d to_add,
const MC_v3d_vector vec 
) [friend]

add a MC_v3d value to the vector

Returns:
the new vector
MC_v3d_vector operator+ ( const MC_v3d_vector vec,
const MC_v3d to_add 
) [friend]

add a MC_v3d value to the vector

Returns:
the new vector
MC_v3d_vector operator- ( const MC_v3d_vector vec,
const MC_v3d_vector to_sub 
) [friend]

substract a v3d value to the vector

Returns:
the new vector

to_sub must be of size 1 or vec.size()

MC_v3d_vector operator- ( const MC_v3d_vector vec,
const MC_v3d to_sub 
) [friend]

substract a MC_v3d value to the vector

Returns:
the new vector
MC_v3d_vector operator/ ( const MC_v3d_vector vec,
const double &  to_subdiv 
) [friend]

divide a double value to the vector

Returns:
the new vector
std::ostream& operator<< ( std::ostream &  output,
const MC_v3d_vector in 
) [friend]

write to ostream the list (u0 u1 u2 ... )

MC_v3d_vector operator<< ( const MC_v3d_vector vec,
const MC_v3d_vector value 
) [friend]

add a vector of values at the end of the vertex

Returns:
the current vector (copy)
MC_v3d_vector operator<< ( const MC_v3d_vector vec,
const MC_v3d value 
) [friend]

add a value at the end of the vertex

Returns:
the current vector (copy)

Member Data Documentation

std::vector<MC_v3d> mesh_conv::MC_v3d_vector::v [protected]

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

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