-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathhelpers.h
31 lines (26 loc) · 1.15 KB
/
helpers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*----------------------------------------------------------------
* File: helpers.h
*----------------------------------------------------------------
*
* Author: Marek Rychlik ([email protected])
* Date: Sun Sep 22 17:52:09 2024
* Copying: (C) Marek Rychlik, 2020. All rights reserved.
*
*----------------------------------------------------------------*/
#ifndef PRINT_HELPERS_H
#define PRINT_HELPERS_H
#define FLAG_WHOLE 0
#define FLAG_LOWER_PART 1
#define FLAG_UPPER_PART 2
void matrix_times_vector(int n, const double A[n][n], const double x[n], double y[n]);
double norm(const int n, const double x[n]);
double norm_dist(const int n, const double x[n], const double y[n]);
double frobenius_norm(const int n, const double X[n][n]);
double frobenius_norm_dist(const int n, const double X[n][n], const double Y[n][n]);
void print_vector(int n, double x[n]);
void print_matrix(int n, double A[n][n], int flag);
void generate_random_matrix(int n, double matrix[n][n]);
void create_matrix(int n, double (**matrix)[n]);
void destroy_matrix(int n, double (*matrix)[n]);
void copy_matrix(int n, const double A[n][n], double A_copy[n][n]);
#endif