OpenNN  2.2
Open Neural Networks Library
Public Member Functions | List of all members
OpenNN::Vector< T > Class Template Reference

#include <vector.h>

Inheritance diagram for OpenNN::Vector< T >:

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
 
bool is_binary (void) const
 
bool Lillieforts_normality_test (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_equal_than_indices (const T &) const
 
Vector< size_t > calculate_less_than_indices (const T &) const
 
Vector< size_t > calculate_greater_than_indices (const T &) const
 
Vector< size_t > calculate_total_frequencies (const Vector< Histogram< T > > &) const
 
Vector< size_t > calculate_total_frequencies_missing_values (const Vector< size_t > missing_values, const Vector< Histogram< T > > &) const
 
Vector< double > perform_Box_Cox_transformation (const double &lambda=1) const
 
calculate_minimum (void) const
 
calculate_maximum (void) const
 
Vector< T > calculate_minimum_maximum (void) const
 
calculate_minimum_missing_values (const Vector< size_t > &) const
 
calculate_maximum_missing_values (const Vector< size_t > &) const
 
Vector< T > calculate_minimum_maximum_missing_values (const Vector< size_t > &) const
 
Vector< T > calculate_explained_variance (void) const
 
Histogram< T > calculate_histogram (const size_t &=10) const
 
Histogram< T > calculate_histogram_binary (void) 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
 
calculate_sum (void) const
 
calculate_partial_sum (const Vector< size_t > &) const
 
calculate_sum_missing_values (const Vector< size_t > &) const
 
calculate_product (void) const
 
double calculate_mean (void) const
 
double calculate_variance (void) const
 
double calculate_covariance (const Vector< double > &) const
 
double calculate_standard_deviation (void) const
 
double calculate_asymmetry (void) const
 
double calculate_kurtosis (void) const
 
double calculate_median (void) const
 
Vector< double > calculate_quartiles (void) const
 
Vector< double > calculate_quartiles_missing_values (const Vector< size_t > &) const
 
Vector< double > calculate_mean_standard_deviation (void) const
 
double calculate_mean_missing_values (const Vector< size_t > &) const
 
double calculate_variance_missing_values (const Vector< size_t > &) const
 
double calculate_weighted_mean (const Vector< double > &) const
 
double calculate_standard_deviation_missing_values (const Vector< size_t > &) const
 
double calculate_asymmetry_missing_values (const Vector< size_t > &) const
 
double calculate_kurtosis_missing_values (const Vector< size_t > &) const
 
Statistics< T > calculate_statistics (void) const
 
Statistics< T > calculate_statistics_missing_values (const Vector< size_t > &) const
 
Vector< double > calculate_shape_parameters (void) const
 
Vector< double > calculate_shape_parameters_missing_values (const Vector< size_t > &) const
 
Vector< double > calculate_box_plots (void) const
 
Vector< double > calculate_box_plots_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< T > &) const
 
double calculate_sum_squared_error (const Vector< double > &) const
 
double calculate_sum_squared_error (const Matrix< T > &, const size_t &, const Vector< size_t > &) const
 
double calculate_Minkowski_error (const Vector< double > &, const double &) const
 
double calculate_linear_correlation (const Vector< T > &) const
 
calculate_linear_correlation_missing_values (const Vector< T > &, const Vector< size_t > &) const
 
Vector< double > calculate_autocorrelation (const size_t &=10) const
 
Vector< double > calculate_cross_correlation (const Vector< double > &, const size_t &=10) 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 > sort_less_indices (void) const
 
Vector< size_t > sort_greater_indices (void) const
 
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 &=5) const
 
Matrix< T > to_matrix (const size_t &, const size_t &) const
 

Detailed Description

template<typename T>
class OpenNN::Vector< T >

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.

Definition at line 65 of file vector.h.

Constructor & Destructor Documentation

◆ Vector() [1/4]

template<class T >
OpenNN::Vector< T >::Vector ( const size_t &  new_size)
explicit

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

Parameters
new_sizeSize of vector.

Definition at line 514 of file vector.h.

◆ Vector() [2/4]

template<class T>
OpenNN::Vector< T >::Vector ( const size_t &  new_size,
const T &  value 
)
explicit

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

Parameters
new_sizeSize of Vector.
valueInitialization value of Type.

Definition at line 524 of file vector.h.

◆ Vector() [3/4]

template<class T>
OpenNN::Vector< T >::Vector ( const std::string &  file_name)
explicit

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

Parameters
file_nameName of vector data file.

Definition at line 532 of file vector.h.

◆ Vector() [4/4]

template<class T>
OpenNN::Vector< T >::Vector ( const Vector< T > &  other_vector)

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

Parameters
other_vectorVector to be copied.

Definition at line 556 of file vector.h.

Member Function Documentation

◆ apply_lower_bound() [1/2]

template<class T>
void OpenNN::Vector< T >::apply_lower_bound ( const T &  lower_bound)

Sets the elements of the vector to a given value if they fall below that value.

Parameters
lower_boundLower bound value.

Definition at line 4075 of file vector.h.

◆ apply_lower_bound() [2/2]

template<class T>
void OpenNN::Vector< T >::apply_lower_bound ( const Vector< T > &  lower_bound)

Sets the elements of the vector to given values if they fall below that values.

Parameters
lower_boundLower bound values.

Definition at line 4092 of file vector.h.

◆ apply_lower_upper_bounds() [1/2]

template<class T>
void OpenNN::Vector< T >::apply_lower_upper_bounds ( const T &  lower_bound,
const T &  upper_bound 
)

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_boundLower bound value.
upper_boundUpper bound value.

Definition at line 4144 of file vector.h.

◆ apply_lower_upper_bounds() [2/2]

template<class T>
void OpenNN::Vector< T >::apply_lower_upper_bounds ( const Vector< T > &  lower_bound,
const Vector< T > &  upper_bound 
)

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_boundLower bound values.
upper_boundUpper bound values.

Definition at line 4166 of file vector.h.

◆ apply_upper_bound() [1/2]

template<class T>
void OpenNN::Vector< T >::apply_upper_bound ( const T &  upper_bound)

Sets the elements of the vector to a given value if they fall above that value.

Parameters
upper_boundUpper bound value.

Definition at line 4108 of file vector.h.

◆ apply_upper_bound() [2/2]

template<class T>
void OpenNN::Vector< T >::apply_upper_bound ( const Vector< T > &  upper_bound)

Sets the elements of the vector to given values if they fall above that values.

Parameters
upper_boundUpper bound values.

Definition at line 4125 of file vector.h.

◆ arrange_diagonal_matrix()

template<class T >
Matrix< T > OpenNN::Vector< T >::arrange_diagonal_matrix ( void  ) const

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.

Todo:

Definition at line 5517 of file vector.h.

◆ arrange_subvector()

template<class T >
Vector< T > OpenNN::Vector< T >::arrange_subvector ( const Vector< size_t > &  indices) const

Returns another vector whose elements are given by some elements of this vector.

Parameters
indicesIndices of this vector whose elements are required.

Definition at line 5536 of file vector.h.

◆ arrange_subvector_first()

template<class T >
Vector< T > OpenNN::Vector< T >::arrange_subvector_first ( const size_t &  elements_number) const

Returns a vector with the first n elements of this vector.

Parameters
elements_numberSize of the new vector.

Definition at line 5575 of file vector.h.

◆ arrange_subvector_last()

template<class T >
Vector< T > OpenNN::Vector< T >::arrange_subvector_last ( const size_t &  elements_number) const

Returns a vector with the last n elements of this vector.

Parameters
elements_numberSize of the new vector.

Definition at line 5610 of file vector.h.

◆ assemble()

template<class T>
Vector< T > OpenNN::Vector< T >::assemble ( const Vector< T > &  other_vector) const

Assemble two vectors.

Parameters
other_vectorVector to be get_assemblyd to this vector.

Definition at line 5919 of file vector.h.

◆ calculate_autocorrelation()

template<class T >
Vector< double > OpenNN::Vector< T >::calculate_autocorrelation ( const size_t &  lags_number = 10) const

Calculates autocorrelation for a given number of maximum lags.

Parameters
lags_numberMaximum lags number.

Definition at line 3653 of file vector.h.

◆ calculate_binary()

template<class T >
Vector< bool > OpenNN::Vector< T >::calculate_binary ( void  ) const

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

Definition at line 2078 of file vector.h.

◆ calculate_box_plots_missing_values()

template<class T >
Vector< double > OpenNN::Vector< T >::calculate_box_plots_missing_values ( const Vector< size_t > &  missing_indices) const

Returns the box and whispers for a vector when there are missing values.

Parameters
missing_indicesVector with the indices of the missing values.

Definition at line 3091 of file vector.h.

◆ calculate_competitive()

template<class T >
Vector< T > OpenNN::Vector< T >::calculate_competitive ( void  ) const

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 2016 of file vector.h.

◆ calculate_cross_correlation()

template<class T >
Vector< double > OpenNN::Vector< T >::calculate_cross_correlation ( const Vector< double > &  other,
const size_t &  maximum_lags_number = 10 
) const

Calculates the cross-correlation between this vector and another given vector.

Parameters
otherOther vector.
maximum_lags_numberMaximum lags for which cross-correlation is calculated.

Definition at line 3695 of file vector.h.

◆ calculate_cumulative()

template<class T >
Vector< T > OpenNN::Vector< T >::calculate_cumulative ( void  ) const

Return the cumulative vector of this vector, where each element is summed up with all the previous ones.

Definition at line 2099 of file vector.h.

◆ calculate_cumulative_index()

template<class T>
size_t OpenNN::Vector< T >::calculate_cumulative_index ( const T &  value) const

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

Parameters
valueValue.

Definition at line 2123 of file vector.h.

◆ calculate_distance()

template<class T>
double OpenNN::Vector< T >::calculate_distance ( const Vector< T > &  other_vector) const

Returns the distance between the elements of this vector and the elements of another vector.

Parameters
other_vectorOther vector.

Definition at line 3290 of file vector.h.

◆ calculate_equal_than_indices()

template<class T>
Vector< size_t > OpenNN::Vector< T >::calculate_equal_than_indices ( const T &  value) const

Returns the vector indices at which the vector elements are equal than some given value.

Parameters
valueValue.

Definition at line 1273 of file vector.h.

◆ calculate_explained_variance()

template<class T >
Vector< T > OpenNN::Vector< T >::calculate_explained_variance ( void  ) const

Calculates the explained variance for a given vector (principal components analysis). This method returns a vector whose size is the same as the size of the given vector.

Definition at line 1578 of file vector.h.

◆ calculate_greater_rank()

template<class T >
Vector< size_t > OpenNN::Vector< T >::calculate_greater_rank ( void  ) const

Returns a vector with the rank of the elements of this vector. The smallest element will have rank size-1, and the greatest element will have 0. That is, small values correspond to big ranks.

Definition at line 4289 of file vector.h.

◆ calculate_greater_than_indices()

template<class T>
Vector< size_t > OpenNN::Vector< T >::calculate_greater_than_indices ( const T &  value) const

Returns the vector indices at which the vector elements are greater than some given value.

Parameters
valueValue.

Definition at line 1315 of file vector.h.

◆ calculate_histogram()

template<class T >
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.

Definition at line 1667 of file vector.h.

◆ calculate_histogram_binary()

template<class T >
Histogram< T > OpenNN::Vector< T >::calculate_histogram_binary ( void  ) 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.

Definition at line 1747 of file vector.h.

◆ calculate_histogram_missing_values()

template<class T >
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.

Definition at line 1796 of file vector.h.

◆ calculate_less_rank()

template<class T >
Vector< size_t > OpenNN::Vector< T >::calculate_less_rank ( void  ) const

Returns a vector with the rank of the elements of this vector. The smallest element will have rank 0, and the greatest element will have size-1. That is, small values correspond with small ranks.

Definition at line 4245 of file vector.h.

◆ calculate_less_than_indices()

template<class T>
Vector< size_t > OpenNN::Vector< T >::calculate_less_than_indices ( const T &  value) const

Returns the vector indices at which the vector elements are less than some given value.

Parameters
valueValue.

Definition at line 1294 of file vector.h.

◆ calculate_linear_correlation()

template<class T>
double OpenNN::Vector< T >::calculate_linear_correlation ( const Vector< T > &  other) const

Calculates the linear correlation coefficient (R-value) between another vector and this vector.

Parameters
otherVector for computing the linear correlation with this vector.

Definition at line 3481 of file vector.h.

◆ calculate_linear_correlation_missing_values()

template<class T>
T OpenNN::Vector< T >::calculate_linear_correlation_missing_values ( const Vector< T > &  other,
const Vector< size_t > &  missing_indices 
) const

Calculates the linear correlation coefficient (R-value) between another vector and this vector when there are missing values in the data.

Parameters
otherVector for computing the linear correlation with this vector.
missing_indicesVector with the indices of the missing values.

Definition at line 3581 of file vector.h.

◆ calculate_linear_regression_parameters()

template<class T>
LinearRegressionParameters< T > OpenNN::Vector< T >::calculate_linear_regression_parameters ( const Vector< T > &  other) const

Calculates the linear regression parameters (intercept, slope and correlation) between another vector and this vector. It returns a linear regression parameters structure.

Parameters
otherOther vector for the linear regression analysis.

Definition at line 3756 of file vector.h.

◆ calculate_lower_bounded() [1/2]

template<class T>
Vector< T > OpenNN::Vector< T >::calculate_lower_bounded ( const T &  lower_bound) const

Returns a vector with the bounded elements from below of the current vector.

Parameters
lower_boundLower bound values.

Definition at line 3861 of file vector.h.

◆ calculate_lower_bounded() [2/2]

template<class T>
Vector< T > OpenNN::Vector< T >::calculate_lower_bounded ( const Vector< T > &  lower_bound) const

Returns a vector with the bounded elements from above of the current vector.

Parameters
lower_boundLower bound values.

Definition at line 3884 of file vector.h.

◆ calculate_lower_upper_bounded() [1/2]

template<class T>
Vector< T > OpenNN::Vector< T >::calculate_lower_upper_bounded ( const T &  lower_bound,
const T &  upper_bound 
) const

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

Parameters
lower_boundLower bound value.
upper_boundUpper bound value.

Definition at line 3998 of file vector.h.

◆ calculate_lower_upper_bounded() [2/2]

template<class T>
Vector< T > OpenNN::Vector< T >::calculate_lower_upper_bounded ( const Vector< T > &  lower_bound,
const Vector< T > &  upper_bound 
) const

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

Parameters
lower_boundLower bound values.
upper_boundUpper bound values.

Definition at line 4028 of file vector.h.

◆ calculate_maximal_indices()

template<class T >
Vector< size_t > OpenNN::Vector< T >::calculate_maximal_indices ( const size_t &  number) const

Returns the indices of the largest elements in the vector.

Parameters
numberNumber of maximal indices to be computed.

Definition at line 1941 of file vector.h.

◆ calculate_minimal_indices()

template<class T >
Vector< size_t > OpenNN::Vector< T >::calculate_minimal_indices ( const size_t &  number) const

Returns the indices of the smallest elements in the vector.

Parameters
numberNumber of minimal indices to be computed.

Definition at line 1916 of file vector.h.

◆ calculate_minimal_maximal_index()

template<class T >
Vector< size_t > OpenNN::Vector< T >::calculate_minimal_maximal_index ( void  ) const

Returns a vector with the indices of the smallest and the largest elements in the vector.

Definition at line 1965 of file vector.h.

◆ calculate_minimum_maximum()

template<class T >
Vector< T > OpenNN::Vector< T >::calculate_minimum_maximum ( void  ) const

Returns a vector containing the smallest and the largest elements in the vector.

Definition at line 1453 of file vector.h.

◆ calculate_minimum_maximum_missing_values()

template<class T >
Vector< T > OpenNN::Vector< T >::calculate_minimum_maximum_missing_values ( const Vector< size_t > &  missing_indices) const

Returns a vector containing the smallest and the largest elements in the vector.

Definition at line 1538 of file vector.h.

◆ calculate_Minkowski_error()

template<class T >
double OpenNN::Vector< T >::calculate_Minkowski_error ( const Vector< double > &  other_vector,
const double &  Minkowski_parameter 
) const

Returns the Minkowski squared error between the elements of this vector and the elements of another vector.

Parameters
other_vectorOther vector.
Minkowski_parameterMinkowski exponent.

Definition at line 3419 of file vector.h.

◆ calculate_occurrence_indices()

template<class T>
Vector< size_t > OpenNN::Vector< T >::calculate_occurrence_indices ( const T &  value) const

Returns the vector indices at which the vector elements take some given value.

Parameters
valueValue.

Definition at line 1209 of file vector.h.

◆ calculate_partial_sum()

template<class T >
T OpenNN::Vector< T >::calculate_partial_sum ( const Vector< size_t > &  indices) const

Returns the sum of the elements with the given indices.

Parameters
indicesIndices of the elementes to sum.

Definition at line 2215 of file vector.h.

◆ calculate_pow()

template<class T>
Vector< T > OpenNN::Vector< T >::calculate_pow ( const T &  exponent) const

Returns a vector with the elements of this vector raised to a power exponent.

Parameters
exponentPow exponent.

Definition at line 1998 of file vector.h.

◆ calculate_quartiles_missing_values()

template<class T >
Vector< double > OpenNN::Vector< T >::calculate_quartiles_missing_values ( const Vector< size_t > &  missing_indices) const

Returns the quarters of the elements in the vector when there are missing values.

Parameters
missing_indicesVector with the indices of the missing values.

Definition at line 2609 of file vector.h.

◆ calculate_scaled_mean_standard_deviation()

template<class T>
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.

Parameters
meanMean values.
standard_deviationStandard deviation values.

Definition at line 5205 of file vector.h.

◆ calculate_scaled_minimum_maximum()

template<class T>
Vector< T > OpenNN::Vector< T >::calculate_scaled_minimum_maximum ( const Vector< T > &  minimum,
const Vector< T > &  maximum 
) const

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
minimumMinimum values.
maximumMaximum values.

Definition at line 5137 of file vector.h.

◆ calculate_shape_parameters()

template<class T >
Vector< double > OpenNN::Vector< T >::calculate_shape_parameters ( void  ) const

Returns a vector with the asymmetry and the kurtosis values of the elements in the vector.

Definition at line 3003 of file vector.h.

◆ calculate_shape_parameters_missing_values()

template<class T >
Vector< double > OpenNN::Vector< T >::calculate_shape_parameters_missing_values ( const Vector< size_t > &  missing_values) const

Returns a vector with the asymmetry and the kurtosis values of the elements in the vector.

Definition at line 3037 of file vector.h.

◆ calculate_softmax()

template<class T >
Vector< T > OpenNN::Vector< T >::calculate_softmax ( void  ) const

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

Definition at line 2033 of file vector.h.

◆ calculate_statistics()

template<class T >
Statistics< T > OpenNN::Vector< T >::calculate_statistics ( void  ) const

Returns the minimum, maximum, mean and standard deviation of the elements in the vector.

Definition at line 2929 of file vector.h.

◆ calculate_statistics_missing_values()

template<class T >
Statistics< T > OpenNN::Vector< T >::calculate_statistics_missing_values ( const Vector< size_t > &  missing_indices) const

Returns the minimum, maximum, mean and standard deviation of the elements in the vector.

Definition at line 2965 of file vector.h.

◆ calculate_sum_squared_error() [1/2]

template<class T >
double OpenNN::Vector< T >::calculate_sum_squared_error ( const Vector< double > &  other_vector) const

Returns the sum squared error between the elements of this vector and the elements of another vector.

Parameters
other_vectorOther vector.

Definition at line 3328 of file vector.h.

◆ calculate_sum_squared_error() [2/2]

template<class T>
double OpenNN::Vector< T >::calculate_sum_squared_error ( const Matrix< T > &  matrix,
const size_t &  row_index,
const Vector< size_t > &  column_indices 
) const

Returns the sum squared error between the elements of this vector and the elements of a row of a matrix.

Parameters
matrixMatrix to compute the error .
row_indexIndex of the row of the matrix.
column_indicesIndices of the columns of the matrix to evaluate.

Definition at line 3372 of file vector.h.

◆ calculate_total_frequencies()

template<class T>
Vector< size_t > OpenNN::Vector< T >::calculate_total_frequencies ( const Vector< Histogram< T > > &  histograms) const

Returns a vector containing the sum of the frequencies of the bins to which this vector belongs.

Parameters
histogramsUsed histograms.

Definition at line 1338 of file vector.h.

◆ calculate_total_frequencies_missing_values()

template<class T>
Vector< size_t > OpenNN::Vector< T >::calculate_total_frequencies_missing_values ( const Vector< size_t >  instance_missing_values,
const Vector< Histogram< T > > &  histograms 
) const

Returns a vector containing the sum of the frequencies of the bins to which this vector blongs.

Parameters
instance_missing_valuesMissing values
histogramsUsed histograms

Definition at line 1361 of file vector.h.

◆ calculate_unscaled_mean_standard_deviation()

template<class T>
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.

Parameters
meanMean values.
standard_deviationStandard deviation values.

Definition at line 5335 of file vector.h.

◆ calculate_unscaled_minimum_maximum()

template<class T>
Vector< T > OpenNN::Vector< T >::calculate_unscaled_minimum_maximum ( const Vector< T > &  minimum,
const Vector< T > &  maximum 
) const

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
minimumMinimum values.
maximumMaximum values.

Definition at line 5269 of file vector.h.

◆ calculate_upper_bounded() [1/2]

template<class T>
Vector< T > OpenNN::Vector< T >::calculate_upper_bounded ( const T &  upper_bound) const

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

Parameters
upper_boundUpper bound value.

Definition at line 3928 of file vector.h.

◆ calculate_upper_bounded() [2/2]

template<class T>
Vector< T > OpenNN::Vector< T >::calculate_upper_bounded ( const Vector< T > &  upper_bound) const

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

Parameters
upper_boundUpper bound values.

Definition at line 3952 of file vector.h.

◆ calculate_weighted_mean()

template<class T >
double OpenNN::Vector< T >::calculate_weighted_mean ( const Vector< double > &  weights) const

Returns the weighted mean of the vector.

Parameters
weightsWeights of the elements of the vector in the mean.

Definition at line 2744 of file vector.h.

◆ contains()

template<class T>
bool OpenNN::Vector< T >::contains ( const Vector< T > &  values) const

Returns true if the vector contains a certain value from a given set, and false otherwise.

Definition at line 1004 of file vector.h.

◆ count_greater_than()

template<class T>
size_t OpenNN::Vector< T >::count_greater_than ( const T &  value) const

Returns the number of elements which are greater than some given value.

Parameters
valueValue.

Definition at line 1233 of file vector.h.

◆ count_less_than()

template<class T>
size_t OpenNN::Vector< T >::count_less_than ( const T &  value) const

Returns the number of elements which are less than some given value.

Parameters
valueValue.

Definition at line 1252 of file vector.h.

◆ direct()

template<class T>
Matrix< T > OpenNN::Vector< T >::direct ( const Vector< T > &  other_vector) const

Outer product vector*vector arithmetic operator.

Parameters
other_vectorvector to be multiplied to this vector.

Definition at line 4624 of file vector.h.

◆ dot() [1/2]

template<class T >
double OpenNN::Vector< T >::dot ( const Vector< double > &  other_vector) const
inline

Dot product vector*vector arithmetic operator.

Parameters
other_vectorvector to be multiplied to this vector.

Definition at line 4581 of file vector.h.

◆ dot() [2/2]

template<class T>
Vector< double > OpenNN::Vector< T >::dot ( const Matrix< T > &  matrix) const

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
matrixmatrix to be multiplied to this vector.

Definition at line 4531 of file vector.h.

◆ initialize()

template<class T>
void OpenNN::Vector< T >::initialize ( const T &  value)

Initializes all the elements of the vector with a given value.

Parameters
valueType value.

Definition at line 802 of file vector.h.

◆ insert_element()

template<class T>
Vector< T > OpenNN::Vector< T >::insert_element ( const size_t &  index,
const T &  value 
) const

Returns a new vector with a new element inserted.

Parameters
indexPosition of the new element.
valueValue of the new element.

Definition at line 5799 of file vector.h.

◆ is_constant()

template<class T >
bool OpenNN::Vector< T >::is_constant ( const double &  tolerance = 0.0) const

Returns true if all the elements have the same value within a defined tolerance , and false otherwise.

Parameters
toleranceTolerance value, so that if abs(max-min) <= tol, then the vector is considered constant.

Definition at line 1052 of file vector.h.

◆ is_crescent()

template<class T >
bool OpenNN::Vector< T >::is_crescent ( void  ) const

Returns true if all the elements in the vector have values which increase with the index, and false otherwise.

Definition at line 1074 of file vector.h.

◆ is_decrescent()

template<class T >
bool OpenNN::Vector< T >::is_decrescent ( void  ) const

Returns true if all the elements in the vector have values which decrease with the index, and false otherwise.

Definition at line 1089 of file vector.h.

◆ is_in()

template<class T>
bool OpenNN::Vector< T >::is_in ( const T &  minimum,
const T &  maximum 
) const

Returns true if the value of all the elements fall in some given range, and false otherwise.

Parameters
minimumMinimum value of the range.
maximumMaximum value of the range.

Definition at line 1032 of file vector.h.

◆ load()

template<class T >
void OpenNN::Vector< T >::load ( const std::string &  file_name)

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
file_nameName of vector file.

Definition at line 5645 of file vector.h.

◆ operator!=()

template<class T>
bool OpenNN::Vector< T >::operator!= ( const T &  value) const

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
valueType value to be compared with.

Definition at line 590 of file vector.h.

◆ operator*() [1/3]

template<class T>
Vector< T > OpenNN::Vector< T >::operator* ( const T &  scalar) const
inline

Product vector*scalar arithmetic operator.

Parameters
scalarScalar value to be multiplied to this vector.

Definition at line 4437 of file vector.h.

◆ operator*() [2/3]

template<class T>
Vector< T > OpenNN::Vector< T >::operator* ( const Vector< T > &  other_vector) const
inline

Element by element product vector*vector arithmetic operator.

Parameters
other_vectorvector to be multiplied to this vector.

Definition at line 4454 of file vector.h.

◆ operator*() [3/3]

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

Element by row product vector*matrix arithmetic operator.

Parameters
matrixmatrix to be multiplied to this vector.

Definition at line 4490 of file vector.h.

◆ operator*=() [1/2]

template<class T>
void OpenNN::Vector< T >::operator*= ( const T &  value)

Scalar product and assignment operator.

Parameters
valueScalar value to be multiplied to this vector.

Definition at line 4800 of file vector.h.

◆ operator*=() [2/2]

template<class T>
void OpenNN::Vector< T >::operator*= ( const Vector< T > &  other_vector)

Vector product and assignment operator.

Parameters
other_vectorVector to be multiplied to this vector.

Definition at line 4813 of file vector.h.

◆ operator+() [1/2]

template<class T>
Vector< T > OpenNN::Vector< T >::operator+ ( const T &  scalar) const
inline

Sum vector+scalar arithmetic operator.

Parameters
scalarScalar value to be added to this vector.

Definition at line 4332 of file vector.h.

◆ operator+() [2/2]

template<class T>
Vector< T > OpenNN::Vector< T >::operator+ ( const Vector< T > &  other_vector) const
inline

Sum vector+vector arithmetic operator.

Parameters
other_vectorVector to be added to this vector.

Definition at line 4349 of file vector.h.

◆ operator+=() [1/2]

template<class T>
void OpenNN::Vector< T >::operator+= ( const T &  value)

Scalar sum and assignment operator.

Parameters
valueScalar value to be added to this vector.

Definition at line 4712 of file vector.h.

◆ operator+=() [2/2]

template<class T>
void OpenNN::Vector< T >::operator+= ( const Vector< T > &  other_vector)

Vector sum and assignment operator.

Parameters
other_vectorVector to be added to this vector.

Definition at line 4725 of file vector.h.

◆ operator-() [1/2]

template<class T>
Vector< T > OpenNN::Vector< T >::operator- ( const T &  scalar) const
inline

Difference vector-scalar arithmetic operator.

Parameters
scalarScalar value to be subtracted to this vector.

Definition at line 4385 of file vector.h.

◆ operator-() [2/2]

template<class T>
Vector< T > OpenNN::Vector< T >::operator- ( const Vector< T > &  other_vector) const
inline

Difference vector-vector arithmetic operator.

Parameters
other_vectorvector to be subtracted to this vector.

Definition at line 4402 of file vector.h.

◆ operator-=() [1/2]

template<class T>
void OpenNN::Vector< T >::operator-= ( const T &  value)

Scalar rest and assignment operator.

Parameters
valueScalar value to be subtracted to this vector.

Definition at line 4756 of file vector.h.

◆ operator-=() [2/2]

template<class T>
void OpenNN::Vector< T >::operator-= ( const Vector< T > &  other_vector)

Vector rest and assignment operator.

Parameters
other_vectorVector to be subtracted to this vector.

Definition at line 4769 of file vector.h.

◆ operator/() [1/2]

template<class T>
Vector< T > OpenNN::Vector< T >::operator/ ( const T &  scalar) const

Cocient vector/scalar arithmetic operator.

Parameters
scalarScalar value to be divided to this vector.

Definition at line 4661 of file vector.h.

◆ operator/() [2/2]

template<class T>
Vector< T > OpenNN::Vector< T >::operator/ ( const Vector< T > &  other_vector) const

Cocient vector/vector arithmetic operator.

Parameters
other_vectorvector to be divided to this vector.

Definition at line 4678 of file vector.h.

◆ operator/=() [1/2]

template<class T>
void OpenNN::Vector< T >::operator/= ( const T &  value)

Scalar division and assignment operator.

Parameters
valueScalar value to be divided to this vector.

Definition at line 4844 of file vector.h.

◆ operator/=() [2/2]

template<class T>
void OpenNN::Vector< T >::operator/= ( const Vector< T > &  other_vector)

Vector division and assignment operator.

Parameters
other_vectorVector to be divided to this vector.

Definition at line 4857 of file vector.h.

◆ operator<()

template<class T>
bool OpenNN::Vector< T >::operator< ( const T &  value) const

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
valueType value to be compared with.

Definition at line 628 of file vector.h.

◆ operator<=()

template<class T>
bool OpenNN::Vector< T >::operator<= ( const T &  value) const

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
valueType value to be compared with.

Definition at line 668 of file vector.h.

◆ operator==()

template<class T>
bool OpenNN::Vector< T >::operator== ( const T &  value) const

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
valueType value to be compared with.

Definition at line 571 of file vector.h.

◆ operator>()

template<class T>
bool OpenNN::Vector< T >::operator> ( const T &  value) const

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
valueType value to be compared with.

Definition at line 609 of file vector.h.

◆ operator>=()

template<class T>
bool OpenNN::Vector< T >::operator>= ( const T &  value) const

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
valueType value to be compared with.

Definition at line 648 of file vector.h.

◆ parse()

template<class T >
void OpenNN::Vector< T >::parse ( const std::string &  str)

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
strString to be parsed.

Definition at line 6002 of file vector.h.

◆ perform_Box_Cox_transformation()

template<class T >
Vector< double > OpenNN::Vector< T >::perform_Box_Cox_transformation ( const double &  lambda = 1) const

Returns vector with the Box-Cox transformation.

Parameters
lambdaExponent of the Box-Cox transformation.

Definition at line 1384 of file vector.h.

◆ randomize_normal() [1/2]

template<class T >
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.

Parameters
meanMean value of uniform distribution.
standard_deviationStandard deviation value of uniform distribution.

Definition at line 909 of file vector.h.

◆ randomize_normal() [2/2]

template<class T >
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.

Parameters
meanMean values of normal distributions.
standard_deviationStandard deviation values of normal distributions.

Definition at line 943 of file vector.h.

◆ randomize_uniform() [1/2]

template<class T >
void OpenNN::Vector< T >::randomize_uniform ( const double &  minimum = -1.0,
const double &  maximum = 1.0 
)

Assigns a random value comprised between a minimum value and a maximum value to each element in the vector.

Parameters
minimumMinimum initialization value.
maximumMaximum initialization value.

Definition at line 825 of file vector.h.

◆ randomize_uniform() [2/2]

template<class T >
void OpenNN::Vector< T >::randomize_uniform ( const Vector< double > &  minimums,
const Vector< double > &  maximums 
)

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

Parameters
minimumsMinimum initialization values.
maximumsMaximum initialization values.

Definition at line 859 of file vector.h.

◆ remove_element()

template<class T >
Vector< T > OpenNN::Vector< T >::remove_element ( const size_t &  index) const

Returns a new vector which is a copy of this vector but with a given element removed. Therefore, the size of the new vector is the size of this vector minus one.

Parameters
indexIndex of element to be removed.

Definition at line 5843 of file vector.h.

◆ remove_value()

template<class T>
Vector< T > OpenNN::Vector< T >::remove_value ( const T &  value) const

Construct a copy of this vector but without a certain value. Note that the new vector might have a different size than this vector.

Parameters
valueValue of elements to be removed.

Definition at line 5881 of file vector.h.

◆ save()

template<class T >
void OpenNN::Vector< T >::save ( const std::string &  file_name) const

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

Parameters
file_nameName of vector data file.

Definition at line 5686 of file vector.h.

◆ scale_mean_standard_deviation() [1/4]

template<class T>
void OpenNN::Vector< T >::scale_mean_standard_deviation ( const T &  mean,
const T &  standard_deviation 
)

Normalizes the elements of this vector using the mean and standard deviation method.

Parameters
meanMean value for the scaling.
standard_deviationStandard deviation value for the scaling.

Definition at line 4959 of file vector.h.

◆ scale_mean_standard_deviation() [2/4]

template<class T>
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.

Parameters
statisticsStatistics structure, which contains the mean and standard deviation values for the scaling.

Definition at line 4980 of file vector.h.

◆ scale_mean_standard_deviation() [3/4]

template<class T>
Statistics< T > OpenNN::Vector< T >::scale_mean_standard_deviation ( void  )

Normalizes the elements of the vector with the mean and standard deviation method. The values used are those calculated from the vector. It also returns the statistics from the vector.

Definition at line 4992 of file vector.h.

◆ scale_mean_standard_deviation() [4/4]

template<class T>
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.

Parameters
meanMean values.
standard_deviationStandard deviation values.

Definition at line 5074 of file vector.h.

◆ scale_minimum_maximum() [1/4]

template<class T>
void OpenNN::Vector< T >::scale_minimum_maximum ( const T &  minimum,
const T &  maximum 
)

Normalizes the elements of this vector using the minimum and maximum method.

Parameters
minimumMinimum value for the scaling.
maximumMaximum value for the scaling.

Definition at line 4914 of file vector.h.

◆ scale_minimum_maximum() [2/4]

template<class T>
void OpenNN::Vector< T >::scale_minimum_maximum ( const Statistics< T > &  statistics)

Normalizes the elements of this vector using the minimum and maximum method.

Parameters
statisticsStatistics structure, which contains the minimum and maximum values for the scaling.

Definition at line 4933 of file vector.h.

◆ scale_minimum_maximum() [3/4]

template<class T>
Statistics< T > OpenNN::Vector< T >::scale_minimum_maximum ( void  )

Normalizes the elements of the vector with the minimum and maximum method. The minimum and maximum values used are those calculated from the vector. It also returns the statistics from the vector.

Definition at line 4943 of file vector.h.

◆ scale_minimum_maximum() [4/4]

template<class T>
void OpenNN::Vector< T >::scale_minimum_maximum ( const Vector< T > &  minimum,
const Vector< T > &  maximum 
)

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
minimumMinimum values.
maximumMaximum values.

Definition at line 5010 of file vector.h.

◆ set() [1/5]

template<class T >
void OpenNN::Vector< T >::set ( const size_t &  new_size)

Sets a new size to the vector. It does not initialize the data.

Parameters
new_sizeSize for the vector.

Definition at line 693 of file vector.h.

◆ set() [2/5]

template<class T>
void OpenNN::Vector< T >::set ( const size_t &  new_size,
const T &  new_value 
)

Sets a new size to the vector and initializes all its elements with a given value.

Parameters
new_sizeSize for the vector.
new_valueValue for all the elements.

Definition at line 705 of file vector.h.

◆ set() [3/5]

template<class T>
void OpenNN::Vector< T >::set ( const std::string &  file_name)

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

Parameters
file_nameName of vector data file.

Definition at line 717 of file vector.h.

◆ set() [4/5]

template<class T>
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.

Parameters
firstStarting value.
stepStep value.
lastFinishing value.

Definition at line 732 of file vector.h.

◆ set() [5/5]

template<class T>
void OpenNN::Vector< T >::set ( const Vector< T > &  other_vector)

Sets the members of this object with the values of another vector.

Parameters
other_vectorObject to set this vector.

Definition at line 753 of file vector.h.

◆ take_out()

template<class T >
Vector< T > OpenNN::Vector< T >::take_out ( const size_t &  position,
const size_t &  other_size 
) const

Extract a vector of a given size from a given position

Parameters
positionExtraction position.
other_sizeSize of vector to be extracted.

Definition at line 5761 of file vector.h.

◆ to_column_matrix()

template<class T >
Matrix< T > OpenNN::Vector< T >::to_column_matrix ( void  ) const

Returns a column matrix with number of rows equal to the size of this vector and number of columns equal to one.

Definition at line 5984 of file vector.h.

◆ to_matrix()

template<class T >
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.

Parameters
rows_numberNumber of rows in the new matrix.
columns_numberNumber of columns in the new matrix.

Definition at line 6109 of file vector.h.

◆ to_row_matrix()

template<class T >
Matrix< T > OpenNN::Vector< T >::to_row_matrix ( void  ) const

Returns a row matrix with number of rows equal to one and number of columns equal to the size of this vector.

Definition at line 5967 of file vector.h.

◆ to_text()

template<class T >
std::string OpenNN::Vector< T >::to_text ( ) const

Returns a string representation of this vector which can be inserted in a text.

Definition at line 6054 of file vector.h.

◆ tuck_in()

template<class T>
void OpenNN::Vector< T >::tuck_in ( const size_t &  position,
const Vector< T > &  other_vector 
)

Insert another vector starting from a given position.

Parameters
positionInsertion position.
other_vectorVector to be inserted.

Definition at line 5728 of file vector.h.

◆ unscale_mean_standard_deviation()

template<class T>
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.

Parameters
meanMean values.
standard_deviationStandard deviation values.

Definition at line 5461 of file vector.h.

◆ unscale_minimum_maximum()

template<class T>
void OpenNN::Vector< T >::unscale_minimum_maximum ( const Vector< T > &  minimum,
const Vector< T > &  maximum 
)

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
minimumMinimum values.
maximumMaximum deviation values.

Definition at line 5399 of file vector.h.

◆ write_string_vector()

template<class T >
Vector< std::string > OpenNN::Vector< T >::write_string_vector ( const size_t &  precision = 5) const

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 6082 of file vector.h.


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