#ifndef HEADER_INCLUDED__model_tools_H
#define HEADER_INCLUDED__model_tools_H

namespace model_tools
{
	//---------------------------------------------------------------------
	// Calculate Nash-Sutcliff efficiency
	double			CalcEfficiency(double *obs, double *sim, int size);
	//---------------------------------------------------------------------

	//---------------------------------------------------------------------
	// Produce a random number within the given lower and upper bound
	// Don't forget to initialize the random function before calling
	// this function with: srand((unsigned) time(NULL)); // using time.h
	// include 'stdlib.h' and 'time.h' in the calling program
	double			Random_double(double lb, double ub);
	//---------------------------------------------------------------------

	//---------------------------------------------------------------------
	// Returns true if the year is a leap year
	bool			LeapYear(int year);
	//---------------------------------------------------------------------

	//---------------------------------------------------------------------
	// This function receives an array of doubles and
	// returns the indices of the lowest values.
	// array	= array of doubles
	// size		= number of values in array
	// TopIndex = array of indices = return values
	// top		= number of lowest values which indices will be stored in TopIndex
	void			FindLowestIndices(double* array, int size, int* TopIndex, int top);
	//---------------------------------------------------------------------

	//---------------------------------------------------------------------
	// This function receives an array of doubles and
	// returns the indices of the highest values.
	// array	= array of doubles
	// size		= number of values in array
	// TopIndex = array of indices = return values
	// top		= number of highest values which indices will be stored in TopIndex
	// min		= minimum
	void			FindHighestIndices(double* array, int size, int* TopIndex, int top, double min);
	//---------------------------------------------------------------------

};


#endif /* HEADER_INCLUDED__model_tools_H */
