My Project
|
#include <iostream>
#include <fstream>
#include <math.h>
#include <chrono>
#include <gtest/gtest.h>
#include "Vec.h"
#include "Mat.h"
Classes | |
struct | World |
Functions | |
void | saveVTI (const World &world, const vector< double > &field) |
void | solveGS (const Mat &mat, vector< double > &x, const vector< double > &b, int max_it=10000, double tol=1e-4) |
int | runTests (int argc, char **args) |
int | main (int argc, char **args) |
int main | ( | int | argc, |
char ** | args | ||
) |
int runTests | ( | int | argc, |
char ** | args | ||
) |
void saveVTI | ( | const World & | world, |
const vector< double > & | field | ||
) |
void solveGS | ( | const Mat & | A, |
vector< double > & | x, | ||
const vector< double > & | b, | ||
int | max_it, | ||
double | tol | ||
) |
Solves A*x=b using GS-SOR method
This function implements the Gauss-Seidel solver for the
linear equation
A | coefficient matrix |
x | vector to hold the solution (output) |
b | right-hand-side vector |
max_it | maximum number of solver iterations, default 10000 |
tol | solver tolerance, default 1e-4 |