summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper2025-09-08 12:12:09 +0200
committerJasper2025-09-08 12:12:09 +0200
commitf8d2ae65bba18ae79695111960a74507cdda0132 (patch)
tree8e926f4a6053ed728d7c653dad32268487f1a06a
parentf8ec4383f4bdfd9e0d582c2ece55fe22ce08d61c (diff)
Reordered includes
-rw-r--r--matrix.c7
-rw-r--r--tests.c4
-rw-r--r--utils.c2
-rw-r--r--utils.h2
-rw-r--r--vector.c7
5 files changed, 14 insertions, 8 deletions
diff --git a/matrix.c b/matrix.c
index 2a5cff1..af68ad8 100644
--- a/matrix.c
+++ b/matrix.c
@@ -1,3 +1,7 @@
+#include "matrix.h"
+
+#include "utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
@@ -5,9 +9,6 @@
#include <math.h>
#include <time.h>
-#include "matrix.h"
-#include "utils.h"
-
Matrix *matrix_alloc(size_t m, size_t n)
{
double *xs = calloc(m * n, sizeof(double));
diff --git a/tests.c b/tests.c
index 9b2a4dc..416abcd 100644
--- a/tests.c
+++ b/tests.c
@@ -1,9 +1,9 @@
#include "tests.h"
-#include <assert.h>
-
#include "matrix.h"
+#include <assert.h>
+
void test_LR()
{
Matrix *A = matrix_from_str("[2 3 1;4 1 -5;-1 2 3]");
diff --git a/utils.c b/utils.c
index dff3b3f..5e1ced3 100644
--- a/utils.c
+++ b/utils.c
@@ -1,3 +1,5 @@
+#include "utils.h"
+
#include <string.h>
#include <assert.h>
#include <stdlib.h>
diff --git a/utils.h b/utils.h
index 8aecde3..d7688c7 100644
--- a/utils.h
+++ b/utils.h
@@ -1,6 +1,8 @@
#ifndef UTIL_H
#define UTIL_H
+#include <stddef.h>
+
#define ABS(x) ((x) >= 0 ? (x) : -(x))
char *str_delete_at(const char *str, const int pos);
diff --git a/vector.c b/vector.c
index bc2fa2f..0ea8152 100644
--- a/vector.c
+++ b/vector.c
@@ -1,12 +1,13 @@
+#include "vector.h"
+
+#include "utils.h"
+
#include <math.h>
#include <stddef.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
-#include "utils.h"
-#include "vector.h"
-
Vector *vector_alloc(size_t m)
{
Vector *v = malloc(sizeof(Vector));