#ifndef BSP_5_2_LIB_H_INCLUDED
#define BSP_5_2_LIB_H_INCLUDED

#include <iostream>
#include <omp.h>
#include <vector>


/** \brief Funktion zur Berechnung des arithmetischen, geometrischen und harmonischen Mittels und der Standardabweichung aus den Eintraegen eines gegebenen Vektors
 *
 * \param[in,out]   x   Vektor mit Eintraegen
 * \param[in,out]   a   arithmetisches Mittel
 * \param[in,out]   g   geometrisches Mittel
 * \param[in,out]   h   harmonisches Mittel
 * \param[in,out]   d   Standardabweichung (deviation)
 * \return
 *
 */
void meandevvec(std::vector<int> x, float &a, float &g, float &h, float &d);


/**	Calculating the minimal and maximal element of a given vector with openMP (parallel)
 * @param[in,out]	x	vector
 * @param[in,out]	minv	minimal entry of x
 * @param[in,out]	maxv	maximal entry of x
 * 
 */
void minmaxvec(std::vector<int> &x, int &minv, int &maxv);

/** Calculating the arithmetic, geometric and harmonic mean value of a given vector as well as the standard deviation and the minimal and maximal element with execution policies
 *
 * \param[in,out]   x   vector
 * \param[in,out]   a   arithmetic mean
 * \param[in,out]   g   geometric mean
 * \param[in,out]   h   harmonic mean
 * \param[in,out]   d   standard deviation
 * @param[in,out]	minv	minimal entry of x
 * @param[in,out]	maxv	maximal entry of x
 * 
 */ 
void meandevmaxminvec(std::vector<int> &x, float &a, float &g, float &h, float &d, float &minv, float &maxv);

void fill_vector(std::istream& istr, std::vector<int>& v);

void read_vector_from_file(const std::string& file_name, std::vector<int>& v);

void write_vector_to_file(const std::string& file_name, const std::vector<float>& v);

#endif // BSP_5_2_LIB_H_INCLUDED
