Page MenuHomec4science

compute_arithmetic.hh
No OneTemporary

File Metadata

Created
Wed, May 29, 16:16

compute_arithmetic.hh

#ifndef COMPUTEARITHMETIC_HPP
#define COMPUTEARITHMETIC_HPP
#include "series.hh"
class ComputeArithmetic : public Series {
public:
//PREVIOUS IMPLEMENTATION:
//double compute(unsigned int N) {
// double result = 0;
// for (int a = 1; a<=N; ++a) {
// result=result+a;
// }
// return result;
//}
double computeValue(int k) {
return 1.*k;
}
double getAnalyticPrediction() {
return 1.*current_index*(current_index+1.)/2.;
}
};
#endif

Event Timeline