mesh_conv::MC_double_vector Class Reference

A container class for a vector of double. More...

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

List of all members.

Public Member Functions

 MC_double_vector ()
 standard constructor
 MC_double_vector (const double &u0)
 direct constructor with one value
 MC_double_vector (const double &u0, const double &u1)
 direct constructor with multiple values
 MC_double_vector (const double &u0, const double &u1, const double &u2)
 direct constructor with multiple values
 MC_double_vector (const double &u0, const double &u1, const double &u2, const double &u3)
 direct constructor with multiple values
 MC_double_vector (const double &u0, const double &u1, const double &u2, const double &u3, const double &u4)
 direct constructor with multiple values
 MC_double_vector (const double &u0, const double &u1, const double &u2, const double &u3, const double &u4, const double &u5)
 direct constructor with multiple values
 MC_double_vector (const std::string &in, const std::string &separator=" ")
 direct constructor from string
 MC_double_vector (const std::set< double > &vec)
 constructor from a set
 MC_double_vector (const std::map< double, int > &vec)
 constructor from an indexed map
 MC_double_vector (const std::vector< double > &vec)
 constructor from a vector
 MC_double_vector (const MC_v3d &vec)
 constructor from a MC_v3d
 MC_double_vector (const MC_double_vector &vec)
 copy constructor
void assert_bounds (const int &u) const
 Assert the value stays within the bounds.
std::vector< double > & get_vector ()
 get the internal vector
const std::vector< double > & to_vector () const
 convert to vector (get internal vector)
std::set< double > to_set () const
 convert to std::set
std::map< double, int > to_map () const
 convert to std::map
void clear ()
 clear the vector to size 0
MC_double_vectorresize (const int &new_size)
 resize the vector in deleting value of adding zeros
MC_double_vectoradd (const double &val)
 add a value at the end of the vector
MC_double_vectoradd (const MC_double_vector &val)
 add some values at the end of the vector
MC_double_vectorset (const int &k_index, const double &new_value)
 set an indexed value to a certain component. Adjust the size automatically
MC_double_vectorset (const MC_int_vector &k_index, const MC_double_vector &new_value)
 set an indexed value to a certain component. Adjust the size automatically
std::pair< MC_double_vector,
double > 
delete_index (const int &index_to_delete) const
 delete the k_th value
std::pair< MC_double_vector,
MC_double_vector
delete_index (const MC_int_vector &index_to_delete) const
 delete the k_th value
std::pair< MC_double_vector,
MC_int_vector
sort () const
 ordonate the vector in increasing order
int size () const
 return the size of the MC_double_vector
std::pair< double, int > min () const
 get min value and its position
std::pair< double, int > max () const
 get max value and its position
MC_double_vectoroperator+= (const double &to_add)
 internal add a value
MC_double_vectoroperator-= (const double &to_sub)
 internal substraction
MC_double_vectoroperator*= (const double &to_mult)
 internal multiplication
MC_double_vectoroperator/= (const double &to_subdiv)
 internal divide
MC_double_vectoroperator+= (const MC_double_vector &to_add)
 internal add values
MC_double_vectoroperator-= (const MC_double_vector &to_sub)
 internal substraction
MC_double_vectoroperator*= (const MC_double_vector &to_mult)
 internal multiplication
MC_double_vectoroperator/= (const MC_double_vector &to_subdiv)
 internal divide
const double & operator() (const int &index) const
 get operator with bounds checks
double & operator() (const int &index)
 get operator with bounds checks
const double & operator[] (const int &index) const
 get operator with bounds asserts
double & operator[] (const int &index)
 get operator with bounds asserts
MC_double_vector operator() (const MC_int_vector &index) const
 get a set of value
MC_double_vector operator[] (const MC_int_vector &index) const
 get a set of value
const double & first () const
 return the first value
double & first ()
 return the first value
const double & last () const
 return the last value
double & last ()
 return the last value
const double * pointer () const
 get the pointer on the value
double * pointer_unprotected ()
 get the pointer on the value

Static Public Member Functions

static MC_double_vector zeros (const int &new_size)
 build a vector of size new_size filled with zero
static MC_double_vector linspace (const double &begin, const double &end, const double &iteration=1)
 initialize a linspace vector
static MC_double_vector sample (const double &begin=0, const double &end=1, const int &N_sample=100)
 initialize a vector with constant space and given number of sample
static double sum (const MC_double_vector &input)
 sum the values of the double_vector
static MC_double_vector abs (const MC_double_vector &input)
 return the absolute value componentwise

Private Attributes

std::vector< double > double_list
 the internal storage: vector of double

Friends

MC_double_vector operator<< (const MC_double_vector &vec, const double &value)
 add a value at the end of the vertex
MC_double_vector operator<< (const MC_double_vector &vec, const MC_double_vector &to_add)
 add some values at the end of the vertex
MC_double_vector operator- (const MC_double_vector &v)
 change the opposite sign of the current vector (unary negation)
MC_double_vector operator+ (const MC_double_vector &vec, const double &to_add)
 add a double value to the vector
MC_double_vector operator- (const MC_double_vector &vec, const double &to_sub)
 substract a double value to the vector
MC_double_vector operator* (const MC_double_vector &vec, const double &to_mult)
 multiply a double value to the vector
MC_double_vector operator/ (const MC_double_vector &vec, const double &to_subdiv)
 divide a double value to the vector
MC_v3d_vector operator* (const MC_double_vector &vec, const MC_v3d &to_mult)
 multiply a double_vector to a MC_v3d
MC_v3d_vector operator* (const MC_v3d &to_mult, const MC_double_vector &vec)
 multiply a double_vector to a MC_v3d
MC_v3d_vector operator/ (const MC_v3d &vec, const MC_double_vector &to_subdiv)
 divide a double value to a vector
MC_double_vector operator+ (const MC_double_vector &vec, const MC_double_vector &to_add)
 add a set of value to the vector
MC_double_vector operator- (const MC_double_vector &vec, const MC_double_vector &to_sub)
 substract set of value to the vector
MC_double_vector operator* (const MC_double_vector &vec, const MC_double_vector &to_mult)
 multiply a set of value to the vector
MC_double_vector operator/ (const MC_double_vector &vec, const MC_double_vector &to_subdiv)
 divide a set of double value to the vector
MC_int_vector operator< (const MC_double_vector &vec, const double &val)
 pointwise boolean comparison
MC_int_vector operator<= (const MC_double_vector &vec, const double &val)
 pointwise boolean comparison
MC_int_vector operator> (const MC_double_vector &vec, const double &val)
 pointwise boolean comparison
MC_int_vector operator>= (const MC_double_vector &vec, const double &val)
 pointwise boolean comparison
MC_int_vector operator== (const MC_double_vector &vec, const double &val)
 pointwise boolean comparison (with an epsilon equality)
MC_int_vector operator< (const double &val, const MC_double_vector &vec)
 pointwise boolean comparison
MC_int_vector operator<= (const double &val, const MC_double_vector &vec)
 pointwise boolean comparison
MC_int_vector operator> (const double &val, const MC_double_vector &vec)
 pointwise boolean comparison
MC_int_vector operator>= (const double &val, const MC_double_vector &vec)
 pointwise boolean comparison
MC_int_vector operator== (const double &val, const MC_double_vector &vec)
 pointwise boolean comparison
std::ostream & operator<< (std::ostream &output, const MC_double_vector &in)
 write to ostream the list (u0 u1 u2 ... )
MC_double_vectoroperator>> (std::istream &input, MC_double_vector &vec)
 load from istream a list

Detailed Description

A container class for a vector of double.

internal storage is std::vector <double>


Constructor & Destructor Documentation

mesh_conv::MC_double_vector::MC_double_vector (  ) 

standard constructor

mesh_conv::MC_double_vector::MC_double_vector ( const double &  u0  ) 

direct constructor with one value

References double_list.

mesh_conv::MC_double_vector::MC_double_vector ( const double &  u0,
const double &  u1 
)

direct constructor with multiple values

References double_list.

mesh_conv::MC_double_vector::MC_double_vector ( const double &  u0,
const double &  u1,
const double &  u2 
)

direct constructor with multiple values

References double_list.

mesh_conv::MC_double_vector::MC_double_vector ( const double &  u0,
const double &  u1,
const double &  u2,
const double &  u3 
)

direct constructor with multiple values

References double_list.

mesh_conv::MC_double_vector::MC_double_vector ( const double &  u0,
const double &  u1,
const double &  u2,
const double &  u3,
const double &  u4 
)

direct constructor with multiple values

References double_list.

mesh_conv::MC_double_vector::MC_double_vector ( const double &  u0,
const double &  u1,
const double &  u2,
const double &  u3,
const double &  u4,
const double &  u5 
)

direct constructor with multiple values

References double_list.

mesh_conv::MC_double_vector::MC_double_vector ( const std::string &  in,
const std::string &  separator = " " 
)

direct constructor from string

Can handle any string with given separator "5.4,4.5,6.1,7.8,4.1..." means <5.4,4.5,6.1,7.8,4.1,...>

References add(), and mesh_conv::MC_string_tokenizer::tokenize().

Here is the call graph for this function:

mesh_conv::MC_double_vector::MC_double_vector ( const std::set< double > &  vec  ) 

constructor from a set

References double_list.

mesh_conv::MC_double_vector::MC_double_vector ( const std::map< double, int > &  vec  ) 

constructor from an indexed map

suppose that the second value is the index of the values

mesh_conv::MC_double_vector::MC_double_vector ( const std::vector< double > &  vec  ) 

constructor from a vector

References double_list.

mesh_conv::MC_double_vector::MC_double_vector ( const MC_v3d vec  ) 

constructor from a MC_v3d

References double_list.

mesh_conv::MC_double_vector::MC_double_vector ( const MC_double_vector vec  ) 

copy constructor

References double_list, and to_vector().

Here is the call graph for this function:


Member Function Documentation

MC_double_vector mesh_conv::MC_double_vector::abs ( const MC_double_vector input  )  [static]

return the absolute value componentwise

References size(), and zeros().

Here is the call graph for this function:

MC_double_vector & mesh_conv::MC_double_vector::add ( const MC_double_vector val  ) 

add some values at the end of the vector

Returns:
the new current vector

References double_list, and size().

Here is the call graph for this function:

MC_double_vector & mesh_conv::MC_double_vector::add ( const double &  val  ) 

add a value at the end of the vector

Returns:
the current vector

References double_list.

Referenced by delete_index(), linspace(), MC_double_vector(), mesh_conv::operator>>(), and sample().

void mesh_conv::MC_double_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 double_list.

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

void mesh_conv::MC_double_vector::clear (  ) 

clear the vector to size 0

References double_list.

std::pair< MC_double_vector, MC_double_vector > mesh_conv::MC_double_vector::delete_index ( const MC_int_vector index_to_delete  )  const

delete the k_th value

Warning:
, this is internaly slow

return <the new vector,the deleted value>

References add(), double_list, size(), and mesh_conv::MC_int_vector::to_set().

Here is the call graph for this function:

std::pair< MC_double_vector, double > mesh_conv::MC_double_vector::delete_index ( const int &  index_to_delete  )  const

delete the k_th value

Warning:
, this is internaly slow

return <the new vector, the deleted value>

References add(), double_list, and size().

Here is the call graph for this function:

double & mesh_conv::MC_double_vector::first (  ) 

return the first value

References double_list, and size().

Here is the call graph for this function:

const double & mesh_conv::MC_double_vector::first (  )  const
std::vector< double > & mesh_conv::MC_double_vector::get_vector (  ) 

get the internal vector

Returns:
the std::vector of the internal parameters

References double_list.

double & mesh_conv::MC_double_vector::last (  ) 

return the last value

References double_list, and size().

Here is the call graph for this function:

const double & mesh_conv::MC_double_vector::last (  )  const

return the last value

References double_list, and size().

Here is the call graph for this function:

MC_double_vector mesh_conv::MC_double_vector::linspace ( const double &  begin,
const double &  end,
const double &  iteration = 1 
) [static]

initialize a linspace vector

References add(), and size().

Here is the call graph for this function:

std::pair< double, int > mesh_conv::MC_double_vector::max (  )  const

get max value and its position

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

Here is the call graph for this function:

std::pair< double, int > mesh_conv::MC_double_vector::min (  )  const

get min value and its position

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

Here is the call graph for this function:

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

get a set of value

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

Here is the call graph for this function:

double & mesh_conv::MC_double_vector::operator() ( const int &  index  ) 

get operator with bounds checks

References assert_bounds(), and double_list.

Here is the call graph for this function:

const double & mesh_conv::MC_double_vector::operator() ( const int &  index  )  const

get operator with bounds checks

References assert_bounds(), and double_list.

Here is the call graph for this function:

MC_double_vector & mesh_conv::MC_double_vector::operator*= ( const MC_double_vector to_mult  ) 

internal multiplication

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

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

Here is the call graph for this function:

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

internal multiplication

References double_list, and size().

Here is the call graph for this function:

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

internal add values

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

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

Here is the call graph for this function:

MC_double_vector & mesh_conv::MC_double_vector::operator+= ( const double &  to_add  ) 

internal add a value

References double_list, and size().

Here is the call graph for this function:

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

internal substraction

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

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

Here is the call graph for this function:

MC_double_vector & mesh_conv::MC_double_vector::operator-= ( const double &  to_sub  ) 

internal substraction

References double_list, and size().

Here is the call graph for this function:

MC_double_vector & mesh_conv::MC_double_vector::operator/= ( const MC_double_vector to_subdiv  ) 

internal divide

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

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

Here is the call graph for this function:

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

internal divide

References double_list, and size().

Here is the call graph for this function:

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

get a set of value

double & mesh_conv::MC_double_vector::operator[] ( const int &  index  ) 

get operator with bounds asserts

References assert_bounds(), and double_list.

Here is the call graph for this function:

const double & mesh_conv::MC_double_vector::operator[] ( const int &  index  )  const

get operator with bounds asserts

References assert_bounds(), and double_list.

Here is the call graph for this function:

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

get the pointer on the value

Warning:
use with care

References double_list.

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

double * mesh_conv::MC_double_vector::pointer_unprotected (  ) 

get the pointer on the value

Warning:
use with care

References double_list.

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

resize the vector in deleting value of adding zeros

Returns:
the new value

References double_list.

Referenced by mesh_conv::MC_matrix::clear(), mesh_conv::operator-(), and zeros().

MC_double_vector mesh_conv::MC_double_vector::sample ( const double &  begin = 0,
const double &  end = 1,
const int &  N_sample = 100 
) [static]

initialize a vector with constant space and given number of sample

References add(), and zeros().

Here is the call graph for this function:

MC_double_vector & mesh_conv::MC_double_vector::set ( const MC_int_vector k_index,
const MC_double_vector new_value 
)

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

Returns:
the new vector

new_value and k_index must have the same size, or new_value must be of size 1 ex. set(MC_int_vector("1 7 5 8"),MC_double_vector("4.1 -5.5 6.7 8.1")) or set(MC_int_vector("1 7 5 8"),MC_double_vector("-1.5"))

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

Here is the call graph for this function:

MC_double_vector & mesh_conv::MC_double_vector::set ( const int &  k_index,
const double &  new_value 
)

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

Returns:
the new vector

References double_list, and size().

Here is the call graph for this function:

int mesh_conv::MC_double_vector::size (  )  const
std::pair< MC_double_vector, MC_int_vector > mesh_conv::MC_double_vector::sort (  )  const

ordonate the vector in increasing order

Returns:
the ordonated value (MC_double_vector)
the corresponding mapping (MC_int_vector)

References double_list, and size().

Here is the call graph for this function:

double mesh_conv::MC_double_vector::sum ( const MC_double_vector input  )  [static]

sum the values of the double_vector

References size().

Here is the call graph for this function:

std::map< double, int > mesh_conv::MC_double_vector::to_map (  )  const

convert to std::map

Returns:
the std::map corresponding to this vector (the int value return its index in the vector)

References size().

Here is the call graph for this function:

std::set< double > mesh_conv::MC_double_vector::to_set (  )  const

convert to std::set

Returns:
the std::set corresponding to this vector

References double_list.

const std::vector< double > & mesh_conv::MC_double_vector::to_vector (  )  const

convert to vector (get internal vector)

Returns:
the std::vector corresponding to the MC_double_vector

return the const reference of the internal parameter.

References double_list.

Referenced by MC_double_vector().

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

build a vector of size new_size filled with zero

References resize().

Referenced by abs(), operator()(), mesh_conv::operator*(), mesh_conv::operator+(), mesh_conv::operator-(), mesh_conv::operator/(), sample(), and set().

Here is the call graph for this function:


Friends And Related Function Documentation

MC_double_vector operator* ( const MC_double_vector vec,
const MC_double_vector to_mult 
) [friend]

multiply a set of value to the vector

Returns:
the new vector

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

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

multiply a double_vector to a MC_v3d

Returns:
the MC_v3d_vector corresponding

pointwise multiplication

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

multiply a double_vector to a MC_v3d

Returns:
the MC_v3d_vector corresponding

pointwise multiplication

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

multiply a double value to the vector

Returns:
the new vector
MC_double_vector operator+ ( const MC_double_vector vec,
const MC_double_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_double_vector operator+ ( const MC_double_vector vec,
const double &  to_add 
) [friend]

add a double value to the vector

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

substract set of value to the vector

Returns:
the new vector

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

MC_double_vector operator- ( const MC_double_vector vec,
const double &  to_sub 
) [friend]

substract a double value to the vector

Returns:
the new vector
MC_double_vector operator- ( const MC_double_vector v  )  [friend]

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

Returns:
a new vector with opposite sign
MC_double_vector operator/ ( const MC_double_vector vec,
const MC_double_vector to_subdiv 
) [friend]

divide a set of double value to the vector

Returns:
the new vector

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

MC_v3d_vector operator/ ( const MC_v3d vec,
const MC_double_vector to_subdiv 
) [friend]

divide a double value to a vector

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

divide a double value to the vector

Returns:
the new vector
MC_int_vector operator< ( const double &  val,
const MC_double_vector vec 
) [friend]

pointwise boolean comparison

Returns:
a MC_double_vector with the same size as the entry (result is given by 0 or 1)
MC_int_vector operator< ( const MC_double_vector vec,
const double &  val 
) [friend]

pointwise boolean comparison

Returns:
a MC_double_vector with the same size as the entry (result is given by 0 or 1)
std::ostream& operator<< ( std::ostream &  output,
const MC_double_vector in 
) [friend]

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

MC_double_vector operator<< ( const MC_double_vector vec,
const MC_double_vector to_add 
) [friend]

add some values at the end of the vertex

Returns:
the new vector (copy)
MC_double_vector operator<< ( const MC_double_vector vec,
const double &  value 
) [friend]

add a value at the end of the vertex

Returns:
the current vector (copy)
MC_int_vector operator<= ( const double &  val,
const MC_double_vector vec 
) [friend]

pointwise boolean comparison

Returns:
a MC_double_vector with the same size as the entry (result is given by 0 or 1)
MC_int_vector operator<= ( const MC_double_vector vec,
const double &  val 
) [friend]

pointwise boolean comparison

Returns:
a MC_double_vector with the same size as the entry (result is given by 0 or 1)
MC_int_vector operator== ( const double &  val,
const MC_double_vector vec 
) [friend]

pointwise boolean comparison

Returns:
a MC_double_vector with the same size as the entry (result is given by 0 or 1)
MC_int_vector operator== ( const MC_double_vector vec,
const double &  val 
) [friend]

pointwise boolean comparison (with an epsilon equality)

Returns:
a MC_double_vector with the same size as the entry (result is given by 0 or 1)
MC_int_vector operator> ( const double &  val,
const MC_double_vector vec 
) [friend]

pointwise boolean comparison

Returns:
a MC_double_vector with the same size as the entry (result is given by 0 or 1)
MC_int_vector operator> ( const MC_double_vector vec,
const double &  val 
) [friend]

pointwise boolean comparison

Returns:
a MC_double_vector with the same size as the entry (result is given by 0 or 1)
MC_int_vector operator>= ( const double &  val,
const MC_double_vector vec 
) [friend]

pointwise boolean comparison

Returns:
a MC_double_vector with the same size as the entry (result is given by 0 or 1)
MC_int_vector operator>= ( const MC_double_vector vec,
const double &  val 
) [friend]

pointwise boolean comparison

Returns:
a MC_double_vector with the same size as the entry (result is given by 0 or 1)
MC_double_vector& operator>> ( std::istream &  input,
MC_double_vector vec 
) [friend]

load from istream a list

stop at the first bad character encountered


Member Data Documentation

std::vector<double> mesh_conv::MC_double_vector::double_list [private]

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

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