halo
This commit is contained in:
parent
ae3b8a086e
commit
6eb4e0e658
@ -47,3 +47,5 @@ int main() {
|
|||||||
|
|
||||||
return 0;
|
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;
|
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
|
// Erstellt eine Matrix, deren Einträge mit startValue beginnen und dann hochzählen
|
||||||
Matrix* CreateMatrix(int rows, int cols, double startValue) {
|
Matrix* CreateMatrix(int rows, int cols, double startValue) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user