Hybrid Query Processing Engine for Coprocessing in Database Systems
HyPE
|
00001 00002 #pragma once 00003 00004 #include <iostream> 00005 #include <string> 00006 #include <vector> 00007 #include <memory> 00008 00009 #include <core/statistical_method.hpp> 00010 #include <core/time_measurement.hpp> 00011 00012 //alglib includes 00013 #include <interpolation.h> 00014 00015 namespace hype{ 00016 namespace core{ 00017 00018 class Least_Squares_Method_2D : public StatisticalMethod_Internal { 00019 00020 public: 00021 Least_Squares_Method_2D(); 00022 00023 virtual const EstimatedTime computeEstimation(const Tuple& input_values); 00024 00025 virtual bool recomuteApproximationFunction(Algorithm& algorithm); 00026 00027 virtual bool inTrainingPhase() const throw(); 00028 00029 virtual void retrain(); 00030 00031 static StatisticalMethod_Internal* create(){ 00032 return new Least_Squares_Method_2D(); 00033 } 00034 00035 virtual ~Least_Squares_Method_2D(); 00036 00037 private: 00038 00039 unsigned int degree_of_polynomial_; 00040 bool polynomial_computed_; 00041 alglib::real_1d_array objHeArray_; 00042 }; 00043 00044 }; //end namespace core 00045 }; //end namespace hype 00046