From e99c921808989b0b242ccfa1aa6edd74871bc213 Mon Sep 17 00:00:00 2001 From: Jasper Date: Mon, 8 Sep 2025 15:47:52 +0200 Subject: Used forward declaration in vector.h Also added tag 'Matrix' to struct 'Matrix'. Makes forwards declaration available for 'Matrix'. Avoids having to import matrix.h in vector.h (and the other way around), when accessing matrix functionality. --- vector.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vector.h') diff --git a/vector.h b/vector.h index c10a765..3df897e 100644 --- a/vector.h +++ b/vector.h @@ -3,8 +3,6 @@ #include -#include "matrix.h" - #define vector_at(v, i) ((v)->xs[(i)]) #define vector_loop(v, i) matrix_loop((v)->mat, i) @@ -15,7 +13,9 @@ #define VECTOR_DIM_MATCH(v1, v2) ((v1)->m == (v2)->m) -typedef struct { +typedef struct Matrix Matrix; + +typedef struct Vector { double *xs; size_t m; Matrix *mat; -- cgit v1.2.3