Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90392002
CG_Serial.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 1, 06:25
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Nov 3, 06:25 (2 d)
Engine
blob
Format
Raw Data
Handle
22065832
Attached To
R8929 Conjugate Gradient Solver
CG_Serial.hpp
View Options
//
// 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
Log In to Comment