w05-g02-conjugate-gradient-function
Conjugate Gradient Function
Basics
Before starting with your assignment, please go through the following basic exercises:
- w05-bsc-functions-1 #10 (closed)
- w05-bsc-functions-2 #11 (closed)
Objective
The overall objective of this assignment is to implement the Conjugate Gradient Method in various functions. Specifically, the code needs to be split into meaningful subparts and implemented in functions.
The details of this method is described in the issue w03-g02-conjugate-gradient
.
Implementation
-
Use the file named
conjugate_gradient_function.cpp
as a starting point which is provided in thetehpc/basics/
directory. -
Include the header file "matrices_operations.h" on the top of
conjugate_gradient_function.cpp
. -
Follow the comments given in the file and complete the implememtation of functions based on the corresponding code in
tehpc/basics/conjugate_gradient.cpp
. -
Make sure that your code is well structured and commented.
Notes:
Compile and run your code by:
- going into the
tehpc/build/
folder - copy
tehpc/basics/matrices_operations.h
tobuild
folder - compile with the following command:
g++ -Werror -Wpedantic -g -o conjugate_gradient_function ../basics/conjugate_gradient_function.cpp
- run code with
./conjugate_gradient_function