// Header file matvec.hh ( --> matvec.cc) // matvec.hh // Print vector void PrintVec(const int n, const double x[]); // Read dimension from file, allocate vector, // read vector components from file void ConstructVector(const char filename[], int & n, double * & vec); // Print matrix void PrintMat(const int nrow, const int ncol, const double a[]); // Read dimensions from file, allocate matrix, // read matrix components from file void ConstructMatrix(const char filename[], int & nrow, int & ncol, double * & mat); // Matrix times vector product void MatMul(const int nrow, const int ncol, const double a[], const double u[], double erg[]); //###################################################################### // remaining functions need to be implemented // Get vector of diagonal entries from matrix // (the vector is already allocated) void GetMatrixDiag(const int nrow, const int ncol, const double a[], double diag[]); // Calculate defect (defect vector is already allocated) void GetDefect(const int nrow, const int ncol, const double a[], const double f[], const double u[], double defect[]); // Calculate L2-norm of a vector double L2norm(const int n, const double vec[]); // Print vector to file void PrintVec2File(const int n, const double x[], const char name[]);