#include #include #include //---------------------------------------------------------------------- // temporary storage of theta values //---------------------------------------------------------------------- class Theta { private: std::vector m_array; public: Theta(){}; ~Theta(){}; // destructor void initTheta() { m_array.clear();} void addTheta(double theta){ m_array.push_back( theta ); } double getTheta(); }; int main() { double x; Theta s; s.initTheta(); for(int i = 0; i < 15 ; ++i ) { x=0.5982; if(i>10) x = x*2.; s.addTheta(x); } std::cout<<" getTheta="< countmax ) { xmax = x; countmax = count; } count = 1.; x = m_array[i]; xsum = x; } if (i == m_array.size()-1 && count > countmax) { xmax = x; } } if( countmax < 5) return -999.; return xmax; }