chore(cleanup): replace legacy Matvei project with updated Linux-based version
- Removed obsolete Matvei source files (tasks 01–04, array/matrix/io_status modules, Makefile) - Introduced new Linux-compatible structure in Linux/Matvei - Updated build logic via new Makefile - Adjusted .gitignore to exclude new artifacts
This commit is contained in:
parent
f44d7a9a6b
commit
2d77179904
67 changed files with 4581 additions and 2 deletions
40
2025.03.21/dist/Windows/array_io.c
vendored
Normal file
40
2025.03.21/dist/Windows/array_io.c
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include <stdio.h>
|
||||
#include "array_io.h"
|
||||
|
||||
io_status read_matrix(double *a, int n, int m, const char *name)
|
||||
{
|
||||
int i, j;
|
||||
FILE *fp;
|
||||
if (!(fp = fopen(name, "r"))) return ERROR_OPEN;
|
||||
for (i = 0; i < n; i++)
|
||||
for (j = 0; j < m; j++)
|
||||
if (fscanf(fp, "%lf", a + i * m + j) != 1)
|
||||
{fclose(fp); return ERROR_READ;}
|
||||
fclose(fp);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
void print_matrix(const double *a, int n, int m, int p)
|
||||
{
|
||||
int np = (n > p ? p : n);
|
||||
int mp = (m > p ? p : m);
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < np; i++)
|
||||
{
|
||||
for (j = 0; j < mp; j++)
|
||||
printf(" %10.3e", a[i * m + j]);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void init_matrix(double *a, int n, int m, int k)
|
||||
{
|
||||
double (*q)(int, int, int, int);
|
||||
double (*f[])(int, int, int, int) = {f1, f2, f3, f4};
|
||||
int i, j;
|
||||
q = f[k-1];
|
||||
for (i = 0; i < n; i++)
|
||||
for (j = 0; j < m; j++)
|
||||
a[i * m + j] = q(n, m, i+1, j+1);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue