Backend/Database/GAnalysis.cpp
/*!
 * @brief calculates gain loss
 * @details gain loss calculation
 * @param input the stock prices in a vector
 */
@brief calculates gain loss
@details gain loss calculation
@param input the stock prices in a vector
@brief calculates gain loss @details gain loss calculation @param input the stock prices in a vector
std::vector<float> GAnalysis::GainLoss(const std::vector<float>& input)
{
	std::vector<float> gain_loss;
	unsigned int length = input.size();
	for (unsigned int i = 1; i <= length - 1; ++i)
	{
		gain_loss.push_back(input[i] - input[i - 1]);
	}
	return gain_loss;
}
std :: vector < float > GAnalysis :: GainLoss ( const std :: vector < float > & input ) { std :: vector < float > gain_loss ; unsigned int length = input . size ( ) ; for ( unsigned int i = 1 ; i <= length - 1 ; ++ i ) { gain_loss . push_back ( input [ i ] - input [ i - 1 ] ) ; } return gain_loss ; }
@brief calculates gain loss
 @details gain loss calculation
 @param input the stock prices in a vector
@brief calculates gain loss @details gain loss calculation @param input the stock prices in a vector