Page MenuHomec4science

CG_Serial.hpp
No OneTemporary

File Metadata

Created
Fri, Nov 1, 06:25

CG_Serial.hpp

//
// Created by shernand on 29/05/19.
//
/**
* @file CG_Serial.hpp
* @author Sergio Hernandez
* This file is part of the Conjugate Gradient Project
*
* This class implements the serial version of the Conjugate Gradient
*
*/
#ifndef CG_SERIAL_CG_SERIAL_HPP
#define CG_SERIAL_CG_SERIAL_HPP
#include <tuple>
#include <vector>
#include <string>
class CG_Serial {
public:
CG_Serial(std::vector<double> const &matrixA, std::vector<double> const &vectorB, double const &tol, int const &maxIter);
std::tuple<std::vector<double>,int> computeCG(std::vector<double> &x_0);
std::vector<double> vectorScalarMul(const std::vector<double> &pVector1, const double pScalar);
std::vector<double> vectorVectorSum(const std::vector<double> &pVector1, const std::vector<double> pVector2);
double vectorVectorDot(const std::vector<double> &pVector1, const std::vector<double> pVector2);
std::vector<double> matrixVector(const std::vector<double> &pMatrix, const std::vector<double> pVector);
//Getter and Setters methods
const std::vector<double> &getMatrixA() const;
void setMatrixA(const std::vector<double> &matrixA);
const std::vector<double> &getVectorB() const;
void setVectorB(const std::vector<double> &vectorB);
double getTol() const;
void setTol(double tol);
int getMaxIterations() const;
void setMaxIterations(int maxIterations);
private:
std::vector<double>matrixA;
std::vector<double>vectorB;
double tol;
int max_iterations;
};
#endif //CG_SERIAL_CG_SERIAL_HPP

Event Timeline