//Setting precision according to the input from main, or by the default value
std::cout << setprecision(prec);
for (UInt i = 0; i <= MaxItr; i+= Freq){std::cout << "Iterations used: " << i << " , The Evaluation: " << srs->Compute(i)<< std::endl;} //Then here the output is according to set precision
// std::cout<< "Final iterated value is " << srs->Compute(i)<<" , analytical value is " << srs->getAnalyticPrediction() << ", the difference is " << srs->Compute(i)-srs->getAnalyticPrediction() << endl;
}
//WriteSeries methods
WriteSeries::WriteSeries(){}
WriteSeries::~WriteSeries(){}
//According to input argument , which is passed to dump method, the filetype is decided. This method will be called within dump method.
ofstream writeobject; //Creating object writeobject, an instance of ofstream
std::string formattype=setSeparator(dlmt); // At this point the method setSeparator is called, and returns string which is given to the formattype variable
writeobject.open(formattype); // Then here formattype variable is used in order to create the file of desired name and format.
srs->current_index=1; // By repeating the value for current index and current value here, we avoid case of these variables changes if the dump from other class has already been called
srs->current_value=0;
for (UInt i=0;i<=MaxItr;i+=Freq){
writeobject << i << dlmt << srs->Compute(i)<<dlmt<< srs->getAnalyticPrediction()<< endl; // Writing iteration number, value and analytical prediction (nan in case of arithmetic series)