OpenNN::Vector< Type > Class Template Reference

#include <vector.h>

List of all members.

Public Member Functions

 Vector (void)
 Vector (const unsigned int &new_size)
 Vector (const unsigned int &new_size, const Type &value)
 Vector (const std::string &filename)
 Vector (const Type &first, const int &step, const Type &last)
template<class InputIterator >
 Vector (InputIterator first, InputIterator last)
 Vector (const Vector< Type > &other_vector)
 ~Vector (void)
bool operator== (const Type &value) const
bool operator!= (const Type &value) const
bool operator> (const Type &value) const
bool operator< (const Type &value) const
bool operator>= (const Type &value) const
bool operator<= (const Type &value) const
void set (void)
void set (const unsigned int &new_size)
void set (const unsigned int &new_size, const Type &new_value)
void set (const std::string &filename)
void set (const Type &first, const int &step, const Type &last)
void set (const Type &first, const double &step, const Type &last)
void set (const Vector &other_vector)
void initialize (const Type &value)
void initialize_sequential (void)
void initialize_uniform (void)
void initialize_uniform (const double &minimum, double maximum)
void initialize_uniform (const Vector< double > &minimum, const Vector< double > &maximum)
void initialize_normal (void)
void initialize_normal (const double &mean, double standard_deviation)
void initialize_normal (const Vector< double > &mean, const Vector< double > &standard_deviation)
Type calculate_minimum (void) const
Type calculate_maximum (void) const
Vector< Type > calculate_minimum_maximum (void) const
Vector< Vector< Type > > calculate_histogram (const unsigned int &bins_number) const
Vector< Vector< Type > > calculate_histogram (void) const
unsigned int calculate_minimal_index (void) const
unsigned int calculate_maximal_index (void) const
Vector< unsigned int > calculate_minimal_maximal_index (void) const
Vector< Type > calculate_pow (const Type &exponent) const
Vector< Type > calculate_competitive (void) const
Vector< Type > calculate_softmax (void) const
Matrix< Type > calculate_softmax_Jacobian (void) const
Vector< bool > calculate_binary (void) const
unsigned int calculate_cumulative_index (const Type &value) const
unsigned int calculate_closest_index (const Type &value) const
Type calculate_sum (void) const
Type calculate_product (void) const
double calculate_mean (void) const
double calculate_standard_deviation (void) const
Vector< double > calculate_mean_standard_deviation (void) const
Vector< double > calculate_statistics (void) const
double calculate_norm (void) const
double calculate_distance (const Vector< double > &other_vector) const
double calculate_sum_squared_error (const Vector< double > &other_vector) const
double calculate_Minkowski_error (const Vector< double > &other_vector, double Minkowski_parameter) const
Vector< Type > calculate_absolute_value (void) const
void apply_absolute_value (void)
Vector< Type > calculate_lower_bounded (const Type &lower_bound) const
Vector< Type > calculate_lower_bounded (const Vector< Type > &lower_bound) const
Vector< Type > calculate_upper_bounded (const Type &upper_bound) const
Vector< Type > calculate_upper_bounded (const Vector< Type > &upper_bound) const
Vector< Type > calculate_lower_upper_bounded (const Type &lower_bound, const Type &upper_bound) const
Vector< Type > calculate_lower_upper_bounded (const Vector< Type > &lower_bound, const Vector< Type > &upper_bound) const
void apply_lower_bound (const Type &lower_bound)
void apply_lower_bound (const Vector< Type > &lower_bound)
void apply_upper_bound (const Type &upper_bound)
void apply_upper_bound (const Vector< Type > &upper_bound)
void apply_lower_upper_bounds (const Type &lower_bound, const Type &upper_bound)
void apply_lower_upper_bounds (const Vector< Type > &lower_bound, const Vector< Type > &upper_bound)
Vector< Type > operator+ (const Type &scalar) const
Vector< Type > operator+ (const Vector< Type > &other_vector) const
Vector< Type > operator- (const Type &scalar) const
Vector< Type > operator- (const Vector< Type > &other_vector) const
Vector< Type > operator* (const Type &scalar) const
Vector< Type > operator* (const Vector< Type > &other_vector) const
Matrix< Type > operator* (const Matrix< Type > &matrix) const
Vector< Type > dot (const Matrix< Type > &matrix) const
Type dot (const Vector< Type > &other_vector) const
Matrix< Type > direct (const Vector< Type > &other_vector) const
Vector< Type > operator/ (const Type &scalar) const
Vector< Type > operator/ (const Vector< Type > &other_vector) const
void operator+= (const Type &value)
void operator+= (const Vector< Type > &other_vector)
void operator-= (const Type &value)
void operator-= (const Vector< Type > &other_vector)
void operator*= (const Type &value)
void operator*= (const Vector< Type > &other_vector)
void operator/= (const Type &value)
void operator/= (const Vector< Type > &other_vector)
void scale_mean_standard_deviation (const Vector< Type > &mean, const Vector< Type > &standard_deviation)
Vector< Type > calculate_scaled_minimum_maximum (const Vector< Type > &minimum, const Vector< Type > &maximum) const
Vector< Type > calculate_scaled_mean_standard_deviation (const Vector< Type > &mean, const Vector< Type > &standard_deviation) const
Vector< Type > calculate_unscaled_minimum_maximum (const Vector< Type > &minimum, const Vector< Type > &maximum) const
Vector< Type > calculate_unscaled_mean_standard_deviation (const Vector< Type > &mean, const Vector< Type > &standard_deviation) const
void scale_minimum_maximum (const Vector< Type > &minimum, const Vector< Type > &maximum)
void unscale_minimum_maximum (const Vector< Type > &minimum, const Vector< Type > &maximum)
void unscale_mean_standard_deviation (const Vector< Type > &mean, const Vector< Type > &standard_deviation)
Matrix< Type > arrange_diagonal_matrix (void) const
void load (const std::string &filename)
void save (const std::string &filename) const
void tuck_in (const unsigned int &position, const Vector< Type > &other_vector)
Vector< Type > take_out (const unsigned int &position, const unsigned int &other_size) const
Vector< Type > get_assembly (const Vector< Type > &other_vector) const
void parse (const std::string &str)
std::string to_string (void) const
Vector< std::string > get_string_vector (void) const
Matrix< Type > to_matrix (const unsigned int &rows_number, const unsigned int &columns_number) const


Detailed Description

template<class Type>
class OpenNN::Vector< Type >

This template class defines a vector for general purpose use. This vector also implements some mathematical methods which can be useful.

Definition at line 47 of file vector.h.


Constructor & Destructor Documentation

template<class Type>
OpenNN::Vector< Type >::Vector ( void   )  [inline, explicit]

Default constructor. It creates a vector of size zero.

Definition at line 56 of file vector.h.

template<class Type>
OpenNN::Vector< Type >::Vector ( const unsigned int &  new_size  )  [inline, explicit]

General constructor. It creates a vector of size n, containing n copies of the default value for Type.

Parameters:
new_size Size of vector.

Definition at line 64 of file vector.h.

template<class Type>
OpenNN::Vector< Type >::Vector ( const unsigned int &  new_size,
const Type &  value 
) [inline, explicit]

Constant reference initialization constructor. It creates a vector of size n, containing n copies of the type value of Type.

Parameters:
new_size Size of Vector.
value Initialization value of Type.

Definition at line 74 of file vector.h.

template<class Type>
OpenNN::Vector< Type >::Vector ( const std::string &  filename  )  [inline, explicit]

File constructor. It creates a vector object by loading its members from a data file.

Parameters:
filename Name of vector data file.

Definition at line 82 of file vector.h.

template<class Type>
OpenNN::Vector< Type >::Vector ( const Type &  first,
const int &  step,
const Type &  last 
) [inline, explicit]

Sequential constructor.

Definition at line 90 of file vector.h.

template<class Type>
template<class InputIterator >
OpenNN::Vector< Type >::Vector ( InputIterator  first,
InputIterator  last 
) [inline]

Input iterators constructor.

Definition at line 115 of file vector.h.

template<class Type>
OpenNN::Vector< Type >::Vector ( const Vector< Type > &  other_vector  )  [inline]

Copy constructor. It creates a copy of an existing Vector.

Parameters:
other_vector Vector to be copied.

Definition at line 123 of file vector.h.

template<class Type>
OpenNN::Vector< Type >::~Vector ( void   )  [inline]

Destructor.

Definition at line 132 of file vector.h.


Member Function Documentation

template<class Type>
bool OpenNN::Vector< Type >::operator== ( const Type &  value  )  const [inline]

Equal to operator between this vector and a Type value. It produces true if all the elements of this vector are equal to the Type value, and false otherwise.

Parameters:
value Type value to be compared with.

Definition at line 143 of file vector.h.

template<class Type>
bool OpenNN::Vector< Type >::operator!= ( const Type &  value  )  const [inline]

Not equivalent relational operator between this vector and a Type value. It produces true if some element of this vector is not equal to the Type value, and false otherwise.

Parameters:
value Type value to be compared with.

Definition at line 165 of file vector.h.

template<class Type>
bool OpenNN::Vector< Type >::operator> ( const Type &  value  )  const [inline]

Greater than relational operator between this vector and a Type value. It produces true if all the elements of this vector are greater than the Type value, and false otherwise.

Parameters:
value Type value to be compared with.

Definition at line 187 of file vector.h.

template<class Type>
bool OpenNN::Vector< Type >::operator< ( const Type &  value  )  const [inline]

Less than relational operator between this vector and a Type value. It produces true if all the elements of this vector are less than the Type value, and false otherwise.

Parameters:
value Type value to be compared with.

Definition at line 209 of file vector.h.

template<class Type>
bool OpenNN::Vector< Type >::operator>= ( const Type &  value  )  const [inline]

Greater than or equal to than relational operator between this vector and a Type value. It produces true if all the elements of this vector are greater than or equal to the Type value, and false otherwise.

Parameters:
value Type value to be compared with.

Definition at line 231 of file vector.h.

template<class Type>
bool OpenNN::Vector< Type >::operator<= ( const Type &  value  )  const [inline]

Less than or equal to than relational operator between this vector and a Type value. It produces true if all the elements of this vector are less than or equal to the Type value, and false otherwise.

Parameters:
value Type value to be compared with.

Definition at line 253 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::set ( void   )  [inline]

This method sets the size of a vector to zero.

Definition at line 275 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::set ( const unsigned int &  new_size  )  [inline]

This method sets a new size to the vector. It does not initialize the data.

Parameters:
new_size Size for the vector.

Definition at line 286 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::set ( const unsigned int &  new_size,
const Type &  new_value 
) [inline]

This method sets a new size to the vector and initializes all its elements with a given value.

Parameters:
new_size Size for the vector.
new_value Value for all the elements.

Definition at line 298 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::set ( const std::string &  filename  )  [inline]

This method sets all the members of a vector object by loading them from a data file. The format is specified in the OpenNN manual.

Parameters:
filename Name of vector data file.

Definition at line 312 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::set ( const Type &  first,
const int &  step,
const Type &  last 
) [inline]

This method makes this vector to have elements starting from a given value, continuing with a step value and finishing with a given value. Depending on the starting, step and finishin values, this method can produce a variety of sizes and data.

Parameters:
first Starting value.
step Step value.
last Finishing value.

Definition at line 326 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::set ( const Type &  first,
const double &  step,
const Type &  last 
) [inline]

This method makes this vector to have elements starting from a given value, continuing with a step value and finishing with a given value. Depending on the starting, step and finishin values, this method can produce a variety of sizes and data.

Parameters:
first Starting value.
step Step value.
last Finishing value.

Definition at line 358 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::set ( const Vector< Type > &  other_vector  )  [inline]

This method sets the members of this object with the values of another vector.

Parameters:
other_vector Object to set this vector.

Definition at line 387 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::initialize ( const Type &  value  )  [inline]

This method initializes all the elements of the vector with a given value.

Parameters:
value Type value.

Definition at line 398 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::initialize_sequential ( void   )  [inline]

This method initializes all the elements of the vector in a sequential order.

Definition at line 413 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::initialize_uniform ( void   )  [inline]

This method assigns a random value comprised between -1 and 1 to each element in the vector.

Definition at line 428 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::initialize_uniform ( const double &  minimum,
double  maximum 
) [inline]

This method assigns a random value comprised between a minimum value and a maximum value to each element in the vector.

Parameters:
minimum Minimum initialization value.
maximum Maximum initialization value.

Definition at line 446 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::initialize_uniform ( const Vector< double > &  minimum,
const Vector< double > &  maximum 
) [inline]

This method assigns a random value comprised between given minimum and a maximum values to every element in the vector.

Parameters:
minimum Minimum initialization values.
maximum Maximum initialization values.

Definition at line 481 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::initialize_normal ( void   )  [inline]

This method assigns random values to each element in the vector. These are taken from a normal distribution with mean 0 and standard deviation 1.

Definition at line 528 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::initialize_normal ( const double &  mean,
double  standard_deviation 
) [inline]

This method assigns random values to each element in the vector. These are taken from a normal distribution with single mean and standard deviation values for all the elements.

Parameters:
mean Mean value of uniform distribution.
standard_deviation Standard deviation value of uniform distribution.

Definition at line 546 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::initialize_normal ( const Vector< double > &  mean,
const Vector< double > &  standard_deviation 
) [inline]

This method assigns random values to each element in the vector. These are taken from normal distributions with given means and standard deviations for each element.

Parameters:
mean Mean values of normal distributions.
standard_deviation Standard deviation values of normal distributions.

Definition at line 581 of file vector.h.

template<class Type>
Type OpenNN::Vector< Type >::calculate_minimum ( void   )  const [inline]

This method returns the smallest element in the vector.

Definition at line 627 of file vector.h.

template<class Type>
Type OpenNN::Vector< Type >::calculate_maximum ( void   )  const [inline]

This method returns the largest element in the vector.

Definition at line 649 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_minimum_maximum ( void   )  const [inline]

This method returns a vector containing the smallest and the largest elements in the vector.

Definition at line 671 of file vector.h.

template<class Type>
Vector< Vector<Type> > OpenNN::Vector< Type >::calculate_histogram ( const unsigned int &  bins_number  )  const [inline]

This method bins the elements of the vector into a given number of equally spaced containers. It returns a vector of two vectors. The size of both subvectors is the number of bins. The first subvector contains the frequency of the bins. The second subvector contains the center of the bins.

Definition at line 707 of file vector.h.

template<class Type>
Vector< Vector<Type> > OpenNN::Vector< Type >::calculate_histogram ( void   )  const [inline]

This method bins the elements of the vector into 10 equally spaced containers. It returns a vector of two vectors. The size of both subvectors is the number of bins (10). The first subvector contains the frequency of the bins. The second subvector contains the center of the bins.

Definition at line 795 of file vector.h.

template<class Type>
unsigned int OpenNN::Vector< Type >::calculate_minimal_index ( void   )  const [inline]

This method returns the index of the smallest element in the vector.

Definition at line 805 of file vector.h.

template<class Type>
unsigned int OpenNN::Vector< Type >::calculate_maximal_index ( void   )  const [inline]

This method returns the index of the largest element in the vector.

Definition at line 829 of file vector.h.

template<class Type>
Vector<unsigned int> OpenNN::Vector< Type >::calculate_minimal_maximal_index ( void   )  const [inline]

This method returns a vector with the indexes of the smallest and the largest elements in the vector.

Definition at line 853 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_pow ( const Type &  exponent  )  const [inline]

This method returns a vector with the elements of this vector raised to a power exponent.

Parameters:
exponent Pow exponent.

Definition at line 890 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_competitive ( void   )  const [inline]

This method returns the competitive vector of this vector, whose elements are one the bigest element of this vector, and zero for the other elements.

Definition at line 910 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_softmax ( void   )  const [inline]

This method returns the softmax vector of this vector, whose elements sum one, and can be interpreted as probabilities.

Definition at line 929 of file vector.h.

template<class Type>
Matrix<Type> OpenNN::Vector< Type >::calculate_softmax_Jacobian ( void   )  const [inline]

This method returns the softmax Jacobian of this vector.

Todo:

Definition at line 956 of file vector.h.

template<class Type>
Vector<bool> OpenNN::Vector< Type >::calculate_binary ( void   )  const [inline]

This method converts the values of the vector to be binary. The threshold value used is 0.5.

Definition at line 972 of file vector.h.

template<class Type>
unsigned int OpenNN::Vector< Type >::calculate_cumulative_index ( const Type &  value  )  const [inline]

This method applies only to cumulative vectors. It returns the index of the first element which is greater than a given value.

Parameters:
value Value.

Definition at line 1000 of file vector.h.

template<class Type>
unsigned int OpenNN::Vector< Type >::calculate_closest_index ( const Type &  value  )  const [inline]

This method returns the index of the closest element in the vector to a given value.

Definition at line 1069 of file vector.h.

template<class Type>
Type OpenNN::Vector< Type >::calculate_sum ( void   )  const [inline]

This method returns the sum of the elements in the vector.

Definition at line 1083 of file vector.h.

template<class Type>
Type OpenNN::Vector< Type >::calculate_product ( void   )  const [inline]

This method returns the product of the elements in the vector.

Definition at line 1102 of file vector.h.

template<class Type>
double OpenNN::Vector< Type >::calculate_mean ( void   )  const [inline]

This method returns the mean of the elements in the vector.

Definition at line 1121 of file vector.h.

template<class Type>
double OpenNN::Vector< Type >::calculate_standard_deviation ( void   )  const [inline]

This method returns the standard deviation of the elements in the vector.

Definition at line 1154 of file vector.h.

template<class Type>
Vector<double> OpenNN::Vector< Type >::calculate_mean_standard_deviation ( void   )  const [inline]

This method returns the mean and the standard deviation of the elements in the vector.

Definition at line 1194 of file vector.h.

template<class Type>
Vector<double> OpenNN::Vector< Type >::calculate_statistics ( void   )  const [inline]

This method returns the minimum, maximum, mean and the standard deviation of the elements in the vector.

Definition at line 1238 of file vector.h.

template<class Type>
double OpenNN::Vector< Type >::calculate_norm ( void   )  const [inline]

This element returns the vector norm.

Definition at line 1267 of file vector.h.

template<class Type>
double OpenNN::Vector< Type >::calculate_distance ( const Vector< double > &  other_vector  )  const [inline]

This method returns the distance between the elements of this vector and the elements of another vector.

Parameters:
other_vector Other vector.

Definition at line 1291 of file vector.h.

template<class Type>
double OpenNN::Vector< Type >::calculate_sum_squared_error ( const Vector< double > &  other_vector  )  const [inline]

This method returns the sum squared error between the elements of this vector and the elements of another vector.

Parameters:
other_vector Other vector.

Definition at line 1330 of file vector.h.

template<class Type>
double OpenNN::Vector< Type >::calculate_Minkowski_error ( const Vector< double > &  other_vector,
double  Minkowski_parameter 
) const [inline]

This method returns the Minkowski squared error between the elements of this vector and the elements of another vector.

Parameters:
other_vector Other vector.
Minkowski_parameter Minkowski exponent.

Definition at line 1370 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_absolute_value ( void   )  const [inline]

This method returns a vector with the absolute values of the current vector.

Definition at line 1428 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::apply_absolute_value ( void   )  [inline]

This method sets the elements of the vector to their absolute values.

Definition at line 1454 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_lower_bounded ( const Type &  lower_bound  )  const [inline]

This method returns a vector with the bounded elements from below of the current vector.

Parameters:
lower_bound Lower bound values.

Definition at line 1473 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_lower_bounded ( const Vector< Type > &  lower_bound  )  const [inline]

This method returns a vector with the bounded elements from above of the current vector.

Parameters:
lower_bound Lower bound values.

Definition at line 1500 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_upper_bounded ( const Type &  upper_bound  )  const [inline]

This method bounds the elements of the vector if they fall above an upper bound value.

Parameters:
upper_bound Upper bound value.

Definition at line 1548 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_upper_bounded ( const Vector< Type > &  upper_bound  )  const [inline]

This method bounds the elements of the vector if they fall above their corresponding upper bound values.

Parameters:
upper_bound Upper bound values.

Definition at line 1575 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_lower_upper_bounded ( const Type &  lower_bound,
const Type &  upper_bound 
) const [inline]

This method bounds the elements of the vector if they fall above or below their lower or upper bound values, respectively.

Parameters:
lower_bound Lower bound value.
upper_bound Upper bound value.

Definition at line 1625 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_lower_upper_bounded ( const Vector< Type > &  lower_bound,
const Vector< Type > &  upper_bound 
) const [inline]

This method bounds the elements of the vector if they fall above or below their corresponding lower or upper bound values, respectively.

Parameters:
lower_bound Lower bound values.
upper_bound Upper bound values.

Definition at line 1658 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::apply_lower_bound ( const Type &  lower_bound  )  [inline]

This method sets the elements of the vector to a given value if they fall below that value.

Parameters:
lower_bound Lower bound value.

Definition at line 1711 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::apply_lower_bound ( const Vector< Type > &  lower_bound  )  [inline]

This method sets the elements of the vector to given values if they fall below that values.

Parameters:
lower_bound Lower bound values.

Definition at line 1730 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::apply_upper_bound ( const Type &  upper_bound  )  [inline]

This method sets the elements of the vector to a given value if they fall above that value.

Parameters:
upper_bound Upper bound value.

Definition at line 1749 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::apply_upper_bound ( const Vector< Type > &  upper_bound  )  [inline]

This method sets the elements of the vector to given values if they fall above that values.

Parameters:
upper_bound Upper bound values.

Definition at line 1768 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::apply_lower_upper_bounds ( const Type &  lower_bound,
const Type &  upper_bound 
) [inline]

This method sets the elements of the vector to a given lower bound value if they fall below that value, or to a given upper bound value if they fall above that value.

Parameters:
lower_bound Lower bound value.
upper_bound Upper bound value.

Definition at line 1789 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::apply_lower_upper_bounds ( const Vector< Type > &  lower_bound,
const Vector< Type > &  upper_bound 
) [inline]

This method sets the elements of the vector to given lower bound values if they fall below that values, or to given upper bound values if they fall above that values.

Parameters:
lower_bound Lower bound values.
upper_bound Upper bound values.

Definition at line 1814 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::operator+ ( const Type &  scalar  )  const [inline]

Sum vector+scalar arithmetic operator.

Parameters:
scalar Scalar value to be added to this vector.

Definition at line 1837 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::operator+ ( const Vector< Type > &  other_vector  )  const [inline]

Sum vector+vector arithmetic operator.

Parameters:
other_vector Vector to be added to this vector.

Definition at line 1857 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::operator- ( const Type &  scalar  )  const [inline]

Difference vector-scalar arithmetic operator.

Parameters:
scalar Scalar value to be subtracted to this vector.

Definition at line 1896 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::operator- ( const Vector< Type > &  other_vector  )  const [inline]

Difference vector-vector arithmetic operator.

Parameters:
other_vector vector to be subtracted to this vector.

Definition at line 1916 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::operator* ( const Type &  scalar  )  const [inline]

Product vector*scalar arithmetic operator.

Parameters:
scalar Scalar value to be multiplied to this vector.

Definition at line 1955 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::operator* ( const Vector< Type > &  other_vector  )  const [inline]

Element by element product vector*vector arithmetic operator.

Parameters:
other_vector vector to be multiplied to this vector.

Definition at line 1975 of file vector.h.

template<class Type>
Matrix<Type> OpenNN::Vector< Type >::operator* ( const Matrix< Type > &  matrix  )  const [inline]

Element by row product vector*matrix arithmetic operator.

Parameters:
matrix matrix to be multiplied to this vector.

Definition at line 2014 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::dot ( const Matrix< Type > &  matrix  )  const [inline]

This method returns the dot product of this vector with a matrix. The number of rows of the matrix must be equal to the size of the vector.

Parameters:
matrix matrix to be multiplied to this vector.

Definition at line 2058 of file vector.h.

template<class Type>
Type OpenNN::Vector< Type >::dot ( const Vector< Type > &  other_vector  )  const [inline]

Dot product vector*vector arithmetic operator.

Parameters:
other_vector vector to be multiplied to this vector.

Definition at line 2104 of file vector.h.

template<class Type>
Matrix<Type> OpenNN::Vector< Type >::direct ( const Vector< Type > &  other_vector  )  const [inline]

Outer product vector*vector arithmetic operator.

Parameters:
other_vector vector to be multiplied to this vector.

Definition at line 2143 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::operator/ ( const Type &  scalar  )  const [inline]

Cocient vector/scalar arithmetic operator.

Parameters:
scalar Scalar value to be divided to this vector.

Definition at line 2197 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::operator/ ( const Vector< Type > &  other_vector  )  const [inline]

Cocient vector/vector arithmetic operator.

Parameters:
other_vector vector to be divided to this vector.

Definition at line 2217 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::operator+= ( const Type &  value  )  [inline]

Scalar sum and assignment operator.

Parameters:
value Scalar value to be added to this vector.

Definition at line 2256 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::operator+= ( const Vector< Type > &  other_vector  )  [inline]

Vector sum and assignment operator.

Parameters:
other_vector Vector to be added to this vector.

Definition at line 2272 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::operator-= ( const Type &  value  )  [inline]

Scalar rest and assignment operator.

Parameters:
value Scalar value to be subtracted to this vector.

Definition at line 2307 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::operator-= ( const Vector< Type > &  other_vector  )  [inline]

Vector rest and assignment operator.

Parameters:
other_vector Vector to be subtracted to this vector.

Definition at line 2323 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::operator*= ( const Type &  value  )  [inline]

Scalar product and assignment operator.

Parameters:
value Scalar value to be multiplied to this vector.

Definition at line 2358 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::operator*= ( const Vector< Type > &  other_vector  )  [inline]

Vector product and assignment operator.

Parameters:
other_vector Vector to be multiplied to this vector.

Definition at line 2374 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::operator/= ( const Type &  value  )  [inline]

Scalar division and assignment operator.

Parameters:
value Scalar value to be divided to this vector.

Definition at line 2409 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::operator/= ( const Vector< Type > &  other_vector  )  [inline]

Vector division and assignment operator.

Parameters:
other_vector Vector to be divided to this vector.

Definition at line 2425 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::scale_mean_standard_deviation ( const Vector< Type > &  mean,
const Vector< Type > &  standard_deviation 
) [inline]

This method scales the vector elements with given mean and standard deviation values. It updates the data in the vector. The size of the mean and standard deviation vectors must be equal to the size of the vector.

Parameters:
mean Mean values.
standard_deviation Standard deviation values.

Definition at line 2463 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_scaled_minimum_maximum ( const Vector< Type > &  minimum,
const Vector< Type > &  maximum 
) const [inline]

This method returns a vector with the scaled elements of this vector acording to the minimum and maximum method. The size of the minimum and maximum vectors must be equal to the size of the vector.

Parameters:
minimum Minimum values.
maximum Maximum values.

Definition at line 2526 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_scaled_mean_standard_deviation ( const Vector< Type > &  mean,
const Vector< Type > &  standard_deviation 
) const [inline]

This method returns a vector with the scaled elements of this vector acording to the mean and standard deviation method. The size of the mean and standard deviation vectors must be equal to the size of the vector.

Parameters:
mean Mean values.
standard_deviation Standard deviation values.

Definition at line 2592 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_unscaled_minimum_maximum ( const Vector< Type > &  minimum,
const Vector< Type > &  maximum 
) const [inline]

This method returns a vector with the unscaled elements of this vector acording to the minimum and maximum method. The size of the minimum and maximum vectors must be equal to the size of the vector.

Parameters:
minimum Minimum values.
maximum Maximum values.

Definition at line 2654 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::calculate_unscaled_mean_standard_deviation ( const Vector< Type > &  mean,
const Vector< Type > &  standard_deviation 
) const [inline]

This method returns a vector with the unscaled elements of this vector acording to the mean and standard deviation method. The size of the mean and standard deviation vectors must be equal to the size of the vector.

Parameters:
mean Mean values.
standard_deviation Standard deviation values.

Definition at line 2718 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::scale_minimum_maximum ( const Vector< Type > &  minimum,
const Vector< Type > &  maximum 
) [inline]

This method scales the vectir elements with given minimum and maximum values. It updates the data in the vector. The size of the minimum and maximum vectors must be equal to the size of the vector.

Parameters:
minimum Minimum values.
maximum Maximum values.

Definition at line 2783 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::unscale_minimum_maximum ( const Vector< Type > &  minimum,
const Vector< Type > &  maximum 
) [inline]

This method unscales the vector elements with given minimum and maximum values. It updates the vector elements. The size of the minimum and maximum vectors must be equal to the size of the vector.

Parameters:
minimum Minimum values.
maximum Maximum deviation values.

Definition at line 2846 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::unscale_mean_standard_deviation ( const Vector< Type > &  mean,
const Vector< Type > &  standard_deviation 
) [inline]

This method unscales the vector elements with given mean and standard deviation values. It updates the vector elements. The size of the mean and standard deviation vectors must be equal to the size of the vector.

Parameters:
mean Mean values.
standard_deviation Standard deviation values.

Definition at line 2907 of file vector.h.

template<class Type>
Matrix<Type> OpenNN::Vector< Type >::arrange_diagonal_matrix ( void   )  const [inline]

This method returns a squared matrix in which the entries outside the main diagonal are all zero. The elements in the diagonal are the elements in this vector.

Definition at line 2965 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::load ( const std::string &  filename  )  [inline]

This method loads the members of a vector from an data file. Please be careful with the file format, which is specified in the OpenNN manual.

Parameters:
filename Name of vector file.

Definition at line 2986 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::save ( const std::string &  filename  )  const [inline]

This method saves to a data file the elements of the vector. The file format is as follows: element_0 element_1 ... element_N-1

Parameters:
filename Name of vector data file.

Definition at line 3031 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::tuck_in ( const unsigned int &  position,
const Vector< Type > &  other_vector 
) [inline]

Insert another vector starting from a given position.

Parameters:
position Insertion position.
other_vector Vector to be inserted.

Definition at line 3069 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::take_out ( const unsigned int &  position,
const unsigned int &  other_size 
) const [inline]

Extract a vector of a given size from a given position

Parameters:
position Extraction position.
other_size Size of vector to be extracted.

Definition at line 3105 of file vector.h.

template<class Type>
Vector<Type> OpenNN::Vector< Type >::get_assembly ( const Vector< Type > &  other_vector  )  const [inline]

Assemble two vectors.

Parameters:
other_vector Vector to be get_assemblyd to this vector.

Definition at line 3142 of file vector.h.

template<class Type>
void OpenNN::Vector< Type >::parse ( const std::string &  str  )  [inline]

This method takes a string representation of a vector and sets this vector to have size equal to the number of words and values equal to that words.

Parameters:
str String to be parsed.

Definition at line 3185 of file vector.h.

template<class Type>
std::string OpenNN::Vector< Type >::to_string ( void   )  const [inline]

This method returns a string representation of this vector.

Definition at line 3218 of file vector.h.

template<class Type>
Vector<std::string> OpenNN::Vector< Type >::get_string_vector ( void   )  const [inline]

This method retuns a vector of strings with size equal to the size of this vector and elements equal to string representations of the elements of this vector.

Definition at line 3232 of file vector.h.

template<class Type>
Matrix<Type> OpenNN::Vector< Type >::to_matrix ( const unsigned int &  rows_number,
const unsigned int &  columns_number 
) const [inline]

This method returns a matrix with given numbers of rows and columns and with the elements of this vector ordered by rows. The number of rows multiplied by the number of columns must be equal to the size of this vector.

Parameters:
rows_number Number of rows in the new matrix.
columns_number Number of columns in the new matrix.

Definition at line 3260 of file vector.h.


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

Generated on Sun Aug 26 11:58:22 2012 for OpenNN by  doxygen 1.5.9