OpenNN
2.2
Open Neural Networks Library
|
#include <vector.h>
Public Member Functions | |
Vector (void) | |
Vector (const size_t &) | |
Vector (const size_t &, const T &) | |
Vector (const std::string &) | |
Vector (const T &, const double &, const T &) | |
template<class InputIterator > | |
Vector (InputIterator, InputIterator) | |
Vector (const Vector< T > &) | |
virtual | ~Vector (void) |
bool | operator== (const T &) const |
bool | operator!= (const T &) const |
bool | operator> (const T &) const |
bool | operator< (const T &) const |
bool | operator>= (const T &) const |
bool | operator<= (const T &) const |
void | set (void) |
void | set (const size_t &) |
void | set (const size_t &, const T &) |
void | set (const std::string &) |
void | set (const T &, const double &, const T &) |
void | set (const Vector &) |
void | initialize (const T &) |
void | initialize_sequential (void) |
void | randomize_uniform (const double &=-1.0, const double &=1.0) |
void | randomize_uniform (const Vector< double > &, const Vector< double > &) |
void | randomize_normal (const double &=0.0, const double &=1.0) |
void | randomize_normal (const Vector< double > &, const Vector< double > &) |
bool | contains (const T &) const |
bool | contains (const Vector< T > &) const |
bool | is_in (const T &, const T &) const |
bool | is_constant (const double &=0.0) const |
bool | is_crescent (void) const |
bool | is_decrescent (void) const |
size_t | count_occurrences (const T &) const |
Vector< size_t > | calculate_occurrence_indices (const T &) const |
size_t | count_greater_than (const T &) const |
size_t | count_less_than (const T &) const |
Vector< size_t > | calculate_less_than_indices (const T &) const |
Vector< size_t > | calculate_greater_than_indices (const T &) const |
T | calculate_minimum (void) const |
T | calculate_maximum (void) const |
Vector< T > | calculate_minimum_maximum (void) const |
T | calculate_minimum_missing_values (const Vector< size_t > &) const |
T | calculate_maximum_missing_values (const Vector< size_t > &) const |
Vector< T > | calculate_minimum_maximum_missing_values (const Vector< size_t > &) const |
Histogram< T > | calculate_histogram (const size_t &=10) const |
Histogram< T > | calculate_histogram_missing_values (const Vector< size_t > &, const size_t &=10) const |
size_t | calculate_minimal_index (void) const |
size_t | calculate_maximal_index (void) const |
Vector< size_t > | calculate_minimal_indices (const size_t &) const |
Vector< size_t > | calculate_maximal_indices (const size_t &) const |
Vector< size_t > | calculate_minimal_maximal_index (void) const |
Vector< T > | calculate_pow (const T &) const |
Vector< T > | calculate_competitive (void) const |
Vector< T > | calculate_softmax (void) const |
Matrix< T > | calculate_softmax_Jacobian (void) const |
Vector< bool > | calculate_binary (void) const |
Vector< T > | calculate_cumulative (void) const |
size_t | calculate_cumulative_index (const T &) const |
size_t | calculate_closest_index (const T &) const |
T | calculate_sum (void) const |
T | calculate_sum_missing_values (const Vector< size_t > &) const |
T | calculate_product (void) const |
double | calculate_mean (void) const |
double | calculate_standard_deviation (void) const |
Vector< double > | calculate_mean_standard_deviation (void) const |
double | calculate_mean_missing_values (const Vector< size_t > &) const |
double | calculate_standard_deviation_missing_values (const Vector< size_t > &) const |
Statistics< T > | calculate_statistics (void) const |
Statistics< T > | calculate_statistics_missing_values (const Vector< size_t > &) const |
double | calculate_norm (void) const |
Vector< T > | calculate_norm_gradient (void) const |
Matrix< T > | calculate_norm_Hessian (void) const |
double | calculate_p_norm (const double &) const |
Vector< double > | calculate_p_norm_gradient (const double &) const |
Vector< T > | calculate_normalized (void) const |
double | calculate_distance (const Vector< double > &) const |
double | calculate_sum_squared_error (const Vector< double > &) const |
double | calculate_Minkowski_error (const Vector< double > &, const double &) const |
T | calculate_linear_correlation (const Vector< T > &) const |
T | calculate_linear_correlation_missing_values (const Vector< T > &, const Vector< size_t > &) const |
LinearRegressionParameters< T > | calculate_linear_regression_parameters (const Vector< T > &) const |
Vector< T > | calculate_absolute_value (void) const |
void | apply_absolute_value (void) |
Vector< T > | calculate_lower_bounded (const T &) const |
Vector< T > | calculate_lower_bounded (const Vector< T > &) const |
Vector< T > | calculate_upper_bounded (const T &) const |
Vector< T > | calculate_upper_bounded (const Vector< T > &) const |
Vector< T > | calculate_lower_upper_bounded (const T &, const T &) const |
Vector< T > | calculate_lower_upper_bounded (const Vector< T > &, const Vector< T > &) const |
void | apply_lower_bound (const T &) |
void | apply_lower_bound (const Vector< T > &) |
void | apply_upper_bound (const T &) |
void | apply_upper_bound (const Vector< T > &) |
void | apply_lower_upper_bounds (const T &, const T &) |
void | apply_lower_upper_bounds (const Vector< T > &, const Vector< T > &) |
Vector< size_t > | calculate_less_rank (void) const |
Vector< size_t > | calculate_greater_rank (void) const |
Vector< T > | operator+ (const T &) const |
Vector< T > | operator+ (const Vector< T > &) const |
Vector< T > | operator- (const T &) const |
Vector< T > | operator- (const Vector< T > &) const |
Vector< T > | operator* (const T &) const |
Vector< T > | operator* (const Vector< T > &) const |
Matrix< T > | operator* (const Matrix< T > &) const |
double | dot (const Vector< double > &) const |
Vector< double > | dot (const Matrix< T > &) const |
Matrix< T > | direct (const Vector< T > &) const |
Vector< T > | operator/ (const T &) const |
Vector< T > | operator/ (const Vector< T > &) const |
void | operator+= (const T &) |
void | operator+= (const Vector< T > &) |
void | operator-= (const T &) |
void | operator-= (const Vector< T > &) |
void | operator*= (const T &) |
void | operator*= (const Vector< T > &) |
void | operator/= (const T &) |
void | operator/= (const Vector< T > &) |
void | filter_positive (void) |
void | filter_negative (void) |
void | scale_minimum_maximum (const T &, const T &) |
void | scale_minimum_maximum (const Statistics< T > &) |
Statistics< T > | scale_minimum_maximum (void) |
void | scale_mean_standard_deviation (const T &, const T &) |
void | scale_mean_standard_deviation (const Statistics< T > &) |
Statistics< T > | scale_mean_standard_deviation (void) |
void | scale_minimum_maximum (const Vector< T > &, const Vector< T > &) |
void | scale_mean_standard_deviation (const Vector< T > &, const Vector< T > &) |
Vector< T > | calculate_scaled_minimum_maximum (const Vector< T > &, const Vector< T > &) const |
Vector< T > | calculate_scaled_mean_standard_deviation (const Vector< T > &, const Vector< T > &) const |
Vector< T > | calculate_unscaled_minimum_maximum (const Vector< T > &, const Vector< T > &) const |
Vector< T > | calculate_unscaled_mean_standard_deviation (const Vector< T > &, const Vector< T > &) const |
void | unscale_minimum_maximum (const Vector< T > &, const Vector< T > &) |
void | unscale_mean_standard_deviation (const Vector< T > &, const Vector< T > &) |
Matrix< T > | arrange_diagonal_matrix (void) const |
Vector< T > | arrange_subvector (const Vector< size_t > &) const |
Vector< T > | arrange_subvector_first (const size_t &) const |
Vector< T > | arrange_subvector_last (const size_t &) const |
void | load (const std::string &) |
void | save (const std::string &) const |
void | tuck_in (const size_t &, const Vector< T > &) |
Vector< T > | take_out (const size_t &, const size_t &) const |
Vector< T > | insert_element (const size_t &, const T &) const |
Vector< T > | remove_element (const size_t &) const |
Vector< T > | remove_value (const T &) const |
Vector< T > | assemble (const Vector< T > &) const |
std::vector< T > | to_std_vector (void) const |
Matrix< T > | to_row_matrix (void) const |
Matrix< T > | to_column_matrix (void) const |
void | parse (const std::string &) |
std::string | to_text () const |
std::string | to_string (const std::string &=" ") const |
Vector< std::string > | write_string_vector (const size_t &=3) const |
Matrix< T > | to_matrix (const size_t &, const size_t &) const |
This template represents an array of any kind of numbers or objects. It inherits from the vector of the standard library, and implements additional utilities.
|
explicit |
|
explicit |
|
explicit |
OpenNN::Vector< T >::Vector | ( | const Vector< T > & | other_vector | ) |
void OpenNN::Vector< T >::apply_lower_bound | ( | const T & | lower_bound | ) |
void OpenNN::Vector< T >::apply_lower_bound | ( | const Vector< T > & | lower_bound | ) |
void OpenNN::Vector< T >::apply_lower_upper_bounds | ( | const T & | lower_bound, |
const T & | upper_bound | ||
) |
void OpenNN::Vector< T >::apply_lower_upper_bounds | ( | const Vector< T > & | lower_bound, |
const Vector< T > & | upper_bound | ||
) |
void OpenNN::Vector< T >::apply_upper_bound | ( | const T & | upper_bound | ) |
void OpenNN::Vector< T >::apply_upper_bound | ( | const Vector< T > & | upper_bound | ) |
Matrix< T > OpenNN::Vector< T >::arrange_diagonal_matrix | ( | void | ) | const |
Vector< T > OpenNN::Vector< T >::arrange_subvector | ( | const Vector< size_t > & | indices | ) | const |
Vector< T > OpenNN::Vector< T >::arrange_subvector_first | ( | const size_t & | elements_number | ) | const |
Vector< T > OpenNN::Vector< T >::arrange_subvector_last | ( | const size_t & | elements_number | ) | const |
Vector< T > OpenNN::Vector< T >::assemble | ( | const Vector< T > & | other_vector | ) | const |
Vector< bool > OpenNN::Vector< T >::calculate_binary | ( | void | ) | const |
Vector< T > OpenNN::Vector< T >::calculate_competitive | ( | void | ) | const |
Vector< T > OpenNN::Vector< T >::calculate_cumulative | ( | void | ) | const |
size_t OpenNN::Vector< T >::calculate_cumulative_index | ( | const T & | value | ) | const |
double OpenNN::Vector< T >::calculate_distance | ( | const Vector< double > & | other_vector | ) | const |
Vector< size_t > OpenNN::Vector< T >::calculate_greater_rank | ( | void | ) | const |
Vector< size_t > OpenNN::Vector< T >::calculate_greater_than_indices | ( | const T & | value | ) | const |
Histogram< T > OpenNN::Vector< T >::calculate_histogram | ( | const size_t & | bins_number = 10 | ) | const |
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.
Histogram< T > OpenNN::Vector< T >::calculate_histogram_missing_values | ( | const Vector< size_t > & | missing_indices, |
const size_t & | bins_number = 10 |
||
) | const |
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.
Vector< size_t > OpenNN::Vector< T >::calculate_less_rank | ( | void | ) | const |
Vector< size_t > OpenNN::Vector< T >::calculate_less_than_indices | ( | const T & | value | ) | const |
T OpenNN::Vector< T >::calculate_linear_correlation | ( | const Vector< T > & | other | ) | const |
T OpenNN::Vector< T >::calculate_linear_correlation_missing_values | ( | const Vector< T > & | other, |
const Vector< size_t > & | missing_indices | ||
) | const |
LinearRegressionParameters< T > OpenNN::Vector< T >::calculate_linear_regression_parameters | ( | const Vector< T > & | other | ) | const |
Vector< T > OpenNN::Vector< T >::calculate_lower_bounded | ( | const T & | lower_bound | ) | const |
Vector< T > OpenNN::Vector< T >::calculate_lower_bounded | ( | const Vector< T > & | lower_bound | ) | const |
Vector< T > OpenNN::Vector< T >::calculate_lower_upper_bounded | ( | const T & | lower_bound, |
const T & | upper_bound | ||
) | const |
Vector< T > OpenNN::Vector< T >::calculate_lower_upper_bounded | ( | const Vector< T > & | lower_bound, |
const Vector< T > & | upper_bound | ||
) | const |
Vector< size_t > OpenNN::Vector< T >::calculate_maximal_indices | ( | const size_t & | number | ) | const |
Vector< size_t > OpenNN::Vector< T >::calculate_minimal_indices | ( | const size_t & | number | ) | const |
double OpenNN::Vector< T >::calculate_Minkowski_error | ( | const Vector< double > & | other_vector, |
const double & | Minkowski_parameter | ||
) | const |
Vector< size_t > OpenNN::Vector< T >::calculate_occurrence_indices | ( | const T & | value | ) | const |
Vector< T > OpenNN::Vector< T >::calculate_pow | ( | const T & | exponent | ) | const |
Vector< T > OpenNN::Vector< T >::calculate_scaled_mean_standard_deviation | ( | const Vector< T > & | mean, |
const Vector< T > & | standard_deviation | ||
) | const |
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.
mean | Mean values. |
standard_deviation | Standard deviation values. |
Vector< T > OpenNN::Vector< T >::calculate_scaled_minimum_maximum | ( | const Vector< T > & | minimum, |
const Vector< T > & | maximum | ||
) | const |
Vector< T > OpenNN::Vector< T >::calculate_softmax | ( | void | ) | const |
double OpenNN::Vector< T >::calculate_sum_squared_error | ( | const Vector< double > & | other_vector | ) | const |
Vector< T > OpenNN::Vector< T >::calculate_unscaled_mean_standard_deviation | ( | const Vector< T > & | mean, |
const Vector< T > & | standard_deviation | ||
) | const |
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.
mean | Mean values. |
standard_deviation | Standard deviation values. |
Vector< T > OpenNN::Vector< T >::calculate_unscaled_minimum_maximum | ( | const Vector< T > & | minimum, |
const Vector< T > & | maximum | ||
) | const |
Vector< T > OpenNN::Vector< T >::calculate_upper_bounded | ( | const T & | upper_bound | ) | const |
Vector< T > OpenNN::Vector< T >::calculate_upper_bounded | ( | const Vector< T > & | upper_bound | ) | const |
size_t OpenNN::Vector< T >::count_greater_than | ( | const T & | value | ) | const |
size_t OpenNN::Vector< T >::count_less_than | ( | const T & | value | ) | const |
Matrix< T > OpenNN::Vector< T >::direct | ( | const Vector< T > & | other_vector | ) | const |
double OpenNN::Vector< T >::dot | ( | const Vector< double > & | other_vector | ) | const |
Vector< double > OpenNN::Vector< T >::dot | ( | const Matrix< T > & | matrix | ) | const |
void OpenNN::Vector< T >::initialize | ( | const T & | value | ) |
Vector< T > OpenNN::Vector< T >::insert_element | ( | const size_t & | index, |
const T & | value | ||
) | const |
bool OpenNN::Vector< T >::is_constant | ( | const double & | tolerance = 0.0 | ) | const |
bool OpenNN::Vector< T >::is_in | ( | const T & | minimum, |
const T & | maximum | ||
) | const |
void OpenNN::Vector< T >::load | ( | const std::string & | file_name | ) |
bool OpenNN::Vector< T >::operator!= | ( | const T & | value | ) | const |
|
inline |
|
inline |
|
inline |
void OpenNN::Vector< T >::operator*= | ( | const T & | value | ) |
void OpenNN::Vector< T >::operator*= | ( | const Vector< T > & | other_vector | ) |
|
inline |
|
inline |
void OpenNN::Vector< T >::operator+= | ( | const T & | value | ) |
void OpenNN::Vector< T >::operator+= | ( | const Vector< T > & | other_vector | ) |
|
inline |
|
inline |
void OpenNN::Vector< T >::operator-= | ( | const T & | value | ) |
void OpenNN::Vector< T >::operator-= | ( | const Vector< T > & | other_vector | ) |
Vector< T > OpenNN::Vector< T >::operator/ | ( | const T & | scalar | ) | const |
Vector< T > OpenNN::Vector< T >::operator/ | ( | const Vector< T > & | other_vector | ) | const |
void OpenNN::Vector< T >::operator/= | ( | const T & | value | ) |
void OpenNN::Vector< T >::operator/= | ( | const Vector< T > & | other_vector | ) |
bool OpenNN::Vector< T >::operator< | ( | const T & | value | ) | const |
bool OpenNN::Vector< T >::operator<= | ( | const T & | value | ) | const |
bool OpenNN::Vector< T >::operator== | ( | const T & | value | ) | const |
bool OpenNN::Vector< T >::operator> | ( | const T & | value | ) | const |
bool OpenNN::Vector< T >::operator>= | ( | const T & | value | ) | const |
void OpenNN::Vector< T >::parse | ( | const std::string & | str | ) |
void OpenNN::Vector< T >::randomize_normal | ( | const double & | mean = 0.0 , |
const double & | standard_deviation = 1.0 |
||
) |
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.
mean | Mean value of uniform distribution. |
standard_deviation | Standard deviation value of uniform distribution. |
void OpenNN::Vector< T >::randomize_normal | ( | const Vector< double > & | mean, |
const Vector< double > & | standard_deviation | ||
) |
Assigns random values to each element in the vector. These are taken from normal distributions with given means and standard deviations for each element.
mean | Mean values of normal distributions. |
standard_deviation | Standard deviation values of normal distributions. |
void OpenNN::Vector< T >::randomize_uniform | ( | const double & | minimum = -1.0 , |
const double & | maximum = 1.0 |
||
) |
void OpenNN::Vector< T >::randomize_uniform | ( | const Vector< double > & | minimums, |
const Vector< double > & | maximums | ||
) |
Vector< T > OpenNN::Vector< T >::remove_element | ( | const size_t & | index | ) | const |
Vector< T > OpenNN::Vector< T >::remove_value | ( | const T & | value | ) | const |
void OpenNN::Vector< T >::save | ( | const std::string & | file_name | ) | const |
void OpenNN::Vector< T >::scale_mean_standard_deviation | ( | const T & | mean, |
const T & | standard_deviation | ||
) |
void OpenNN::Vector< T >::scale_mean_standard_deviation | ( | const Statistics< T > & | statistics | ) |
Normalizes the elements of this vector using the mean and standard deviation method.
statistics | Statistics structure, which contains the mean and standard deviation values for the scaling. |
Statistics< T > OpenNN::Vector< T >::scale_mean_standard_deviation | ( | void | ) |
void OpenNN::Vector< T >::scale_mean_standard_deviation | ( | const Vector< T > & | mean, |
const Vector< T > & | standard_deviation | ||
) |
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.
mean | Mean values. |
standard_deviation | Standard deviation values. |
void OpenNN::Vector< T >::scale_minimum_maximum | ( | const T & | minimum, |
const T & | maximum | ||
) |
void OpenNN::Vector< T >::scale_minimum_maximum | ( | const Statistics< T > & | statistics | ) |
Normalizes the elements of this vector using the minimum and maximum method.
statistics | Statistics structure, which contains the minimum and maximum values for the scaling. |
Statistics< T > OpenNN::Vector< T >::scale_minimum_maximum | ( | void | ) |
void OpenNN::Vector< T >::scale_minimum_maximum | ( | const Vector< T > & | minimum, |
const Vector< T > & | maximum | ||
) |
void OpenNN::Vector< T >::set | ( | const size_t & | new_size | ) |
void OpenNN::Vector< T >::set | ( | const size_t & | new_size, |
const T & | new_value | ||
) |
void OpenNN::Vector< T >::set | ( | const std::string & | file_name | ) |
void OpenNN::Vector< T >::set | ( | const T & | first, |
const double & | step, | ||
const T & | last | ||
) |
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.
first | Starting value. |
step | Step value. |
last | Finishing value. |
void OpenNN::Vector< T >::set | ( | const Vector< T > & | other_vector | ) |
Vector< T > OpenNN::Vector< T >::take_out | ( | const size_t & | position, |
const size_t & | other_size | ||
) | const |
Matrix< T > OpenNN::Vector< T >::to_column_matrix | ( | void | ) | const |
Matrix< T > OpenNN::Vector< T >::to_matrix | ( | const size_t & | rows_number, |
const size_t & | columns_number | ||
) | const |
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.
rows_number | Number of rows in the new matrix. |
columns_number | Number of columns in the new matrix. |
Matrix< T > OpenNN::Vector< T >::to_row_matrix | ( | void | ) | const |
void OpenNN::Vector< T >::tuck_in | ( | const size_t & | position, |
const Vector< T > & | other_vector | ||
) |
void OpenNN::Vector< T >::unscale_mean_standard_deviation | ( | const Vector< T > & | mean, |
const Vector< T > & | standard_deviation | ||
) |
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.
mean | Mean values. |
standard_deviation | Standard deviation values. |
void OpenNN::Vector< T >::unscale_minimum_maximum | ( | const Vector< T > & | minimum, |
const Vector< T > & | maximum | ||
) |