summaryrefslogtreecommitdiff
path: root/matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'matrix.c')
-rw-r--r--matrix.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/matrix.c b/matrix.c
index 1e1a4dd..4bcbf88 100644
--- a/matrix.c
+++ b/matrix.c
@@ -8,7 +8,7 @@
#include "matrix.h"
#include "utils.h"
-Matrix *matrix_alloc(const size_t m, const size_t n)
+Matrix *matrix_alloc(size_t m, size_t n)
{
double *xs = malloc(m * n * sizeof(double));
assert(xs != NULL && "Allocation of matrix elements failed");
@@ -88,7 +88,7 @@ char *matrix_to_str(const Matrix *mat)
return "TODO";
}
-Matrix *matrix_id(const size_t n)
+Matrix *matrix_id(size_t n)
{
Matrix *tmp = matrix_const(n, n, 0);
@@ -98,7 +98,7 @@ Matrix *matrix_id(const size_t n)
return tmp;
}
-Matrix *matrix_const(const size_t m, const size_t n, const double x)
+Matrix *matrix_const(size_t m, size_t n, double x)
{
Matrix *mat = matrix_alloc(m, n);
for (size_t i = 0; i < mat->m; ++i)
@@ -160,7 +160,7 @@ Matrix *matrix_add(const Matrix *A, const Matrix *B)
return C;
}
-Matrix *matrix_scale(const double x, const Matrix *A)
+Matrix *matrix_scale(double x, const Matrix *A)
{
Matrix *tmp = matrix_alloc(A->m, A->n);
@@ -195,7 +195,7 @@ Matrix *matrix_mult(const Matrix *A, const Matrix *B)
return C;
}
-Matrix *matrix_rand(const size_t m, const size_t n, const int bound_l, const int bound_u, MatrixType type)
+Matrix *matrix_rand(size_t m, size_t n, int bound_l, int bound_u, MatrixType type)
{
assert(bound_l <= bound_u && "Lower bound is expected to be less or equal than upper bound");
@@ -241,7 +241,7 @@ int matrix_is_square(const Matrix *mat)
return mat->m == mat->n;
}
-int matrix_eq(const Matrix *A, const Matrix *B, const double tol)
+int matrix_eq(const Matrix *A, const Matrix *B, double tol)
{
assert(A->m == B->m && A->n == B->n && "Dimension mismatch");
for (size_t i = 0; i < A->m; ++i)