Column-oriented GPU-accelerated Database Management System
CoGaDB
/home/sebastian/gpudbms/trunk/hype-library/include/core/offline_algorithm.hpp
Go to the documentation of this file.
00001 /***********************************************************************************************************
00002 Copyright (c) 2012, Sebastian Breß, Otto-von-Guericke University of Magdeburg, Germany. All rights reserved.
00003 
00004 This program and accompanying materials are made available under the terms of the 
00005 GNU LESSER GENERAL PUBLIC LICENSE - Version 3, http://www.gnu.org/licenses/lgpl-3.0.txt
00006 ***********************************************************************************************************/
00007 
00008 #pragma once
00009 
00010 #include <iostream>
00011 #include <fstream>
00012 #include <string>
00013 #include <vector>
00014 #include <numeric>
00015 
00016 #include <config/exports.hpp>
00017 #include <config/global_definitions.hpp>
00018 #include <core/specification.hpp>
00019 #include <core/time_measurement.hpp>
00020 #include <core/measurementpair.hpp>
00021 
00022 /* temporarily disable warnings because of missing STL DLL interface */
00023 #ifdef _MSC_VER
00024 #  pragma warning(push)
00025 #  pragma warning(disable: 4251)
00026 #endif
00027 
00028 namespace hype{
00029         namespace core{
00030 
00031 
00032 class HYPE_EXPORT Offline_Algorithm{
00033         public:                 
00034         const std::string& getAlgorithmName() const throw();
00035         
00036         const std::string& getOperationName() const throw();
00037         
00038         DeviceSpecification getDeviceSpecification() const throw();
00039 
00040         unsigned int getNumberOfMeasurementPairs() const throw();
00041 
00042         Offline_Algorithm(DeviceSpecification device,std::string algorithm_name, std::string opname, std::string filepath);
00043 
00044         core::MeasurementPair getNext();
00045         
00046         bool hasNext();
00047         
00048         void reset();
00049         
00050         //the first line of a file determines, how many feature values are expected: for n values, the first n-1 values are considered feature Values and the remaining 1 value is considered the measured execution time
00051         void loadMeasurementpairsfromFile(std::string filepath);
00052 
00053         void storeInFile(const std::string& file_name);
00054 
00055         void printstoredMeasurementpairs();
00056 
00057         static std::vector<Offline_Algorithm> randomize_dataset_of_offline_algorithms(std::vector<Offline_Algorithm> offline_algorithms);
00058 
00059         private:
00060         std::vector<core::MeasurementPair> offline_mesurement_pairs_;
00061         DeviceSpecification device_;
00062         std::string name_;
00063         std::string operation_name_;
00064         unsigned int current_mesurementpair_index_;
00065         std::string filepath_;
00066 };
00067 
00068         }; //end namespace core
00069 }; //end namespace hype
00070 
00071 #ifdef _MSC_VER
00072 #  pragma warning(pop)
00073 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines