Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
372 changes: 266 additions & 106 deletions .idea/workspace.xml

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions AbstractNumericalApproximation.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Created by nicol on 28.11.2017.
//

using namespace std;
#include "AbstractNumericalApproximation.h"

void AbstratcNumericalApproximation :: printWeight (vector<double> weight){

cerr << "The weight found by the approximation function are :"<< endl;
for (int i=0; i< weight.size(); i++) {
std::cerr << weight[i] << " | ";
}
cerr <<endl;

}
42 changes: 42 additions & 0 deletions AbstractNumericalApproximation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// Created by nicol on 28.11.2017.
//

#ifndef PCSC2017_GROUP5_ABSTRACTNUMERICALAPPROXIMATION_H
#define PCSC2017_GROUP5_ABSTRACTNUMERICALAPPROXIMATION_H


/**
* \file AbstractNumericalApproximation.h
* \brief This is the virtual class we will use to implement all the approximations functions
* \class AbstractNumericalApproximation
* This is a pure virtual class
*/

#include readFile.h;
using namespace std;


class AbstractNumericalApproximation {

public:
//Virtual Method that we will implement in the sub-class
//It return a vector of double, the weight we found after apply the function
//It takes Data as a parameter, a structure made of two vector of double and one vector of Gender (Gender is a enum type)
virtual vector<double> approximationFunction(Data data) = 0;

//Function that allows us to print the weight return by the approximation function
void printWeight (vector<double> weight);

private:



};






#endif //PCSC2017_GROUP5_ABSTRACTNUMERICALAPPROXIMATION_H
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(PCSC2017_Group5)

set(CMAKE_CXX_STANDARD 17)

set(SOURCE_FILES main.cpp super_cool_class.h readFile.h readFile.cpp)
set(SOURCE_FILES main.cpp super_cool_class.h readFile.h readFile.cpp AbstractNumericalApproximation.h AbstractNumericalApproximation.cpp LeastSquares.cpp LeastSquares.h)

find_package(Doxygen)
option(BUILD_DOCUMENTATION "Create and install the HTML based API
Expand Down Expand Up @@ -31,4 +31,4 @@ if(BUILD_DOCUMENTATION)

endif()

add_executable(PCSC2017_Group5 ${SOURCE_FILES} super_cool_class.h readFile.h readFile.cpp)
add_executable(PCSC2017_Group5 ${SOURCE_FILES} super_cool_class.h readFile.h readFile.cpp AbstractNumericalApproximation.h AbstractNumericalApproximation.cpp LeastSquares.cpp LeastSquares.h)
12 changes: 12 additions & 0 deletions LeastSquares.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// Created by nicol on 28.11.2017.
//
using namespace std;
#include "LeastSquares.h


virtual vector<double> LeastSquares :: approximationFunction(Data data){
vector<double> a;
vector<double> b;

};
26 changes: 26 additions & 0 deletions LeastSquares.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// Created by nicol on 28.11.2017.
//

#ifndef PCSC2017_GROUP5_LEASTSQUARES_H
#define PCSC2017_GROUP5_LEASTSQUARES_H

/**
* \file AbstractNumericalApproximation.h
* \brief This is the virtual class we will use to implement all the approximations functions
* \class AbstractNumericalApproximation
* This is a pure virtual class
*/
using namespace std;
#include "AbstractNumericalApproximation.h"

class LeastSquares {

public:
virtual vector<double> approximationFunction(Data data);


private:

};
#endif //PCSC2017_GROUP5_LEASTSQUARES_H
6 changes: 1 addition & 5 deletions cmake-build-debug/CMakeFiles/clion-log.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
/Applications/CLion.app/Contents/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/davidcleres/CLionProjects/PCSC2017_Group5
Doxygen build started.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/davidcleres/CLionProjects/PCSC2017_Group5/cmake-build-debug
Environment (MinGW/Cygwin) is not selected
1 change: 1 addition & 0 deletions readFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ReadFile
///@method
std::string getFilename();


private:
///@variable
std::string mFilename;
Expand Down