halo
This commit is contained in:
parent
ae3b8a086e
commit
6eb4e0e658
@ -46,4 +46,6 @@ int main() {
|
||||
FreeMatrix(f);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//gcc TestMatricOp.c -L. -lmatrixOp -o TestMatricOp
|
11
matrixOp.c
11
matrixOp.c
@ -15,17 +15,6 @@ Matrix* CreateMatrixZero(int rows, int cols) {
|
||||
return m;
|
||||
}
|
||||
|
||||
// Erstellt eine Matrix mit Zufallswerten zwischen -100 und 99
|
||||
Matrix* CreateMatrixRand(int rows, int cols) {
|
||||
srand(time(NULL)); // Initialisiert Zufallszahlengenerator
|
||||
Matrix *m = CreateMatrixZero(rows, cols);
|
||||
for (int i = 0; i < rows; i++) {
|
||||
for (int j = 0; j < cols; j++) {
|
||||
m->data[i][j] = (rand() % 200 - 100) / 1.0; // Werte von -100 bis 99
|
||||
}
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
// Erstellt eine Matrix, deren Einträge mit startValue beginnen und dann hochzählen
|
||||
Matrix* CreateMatrix(int rows, int cols, double startValue) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user