summaryrefslogtreecommitdiff
path: root/matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'matrix.c')
-rw-r--r--matrix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/matrix.c b/matrix.c
index d0c2cd4..8ffae72 100644
--- a/matrix.c
+++ b/matrix.c
@@ -280,7 +280,7 @@ Matrix **matrix_LR(const Matrix *A, const Matrix *b)
{
assert(matrix_is_square(A) && "LR decomposition only works for square matrices");
assert(A->n == b->m && "Dimension mismatch");
- assert(b->n == 1 && "Vector b expected");
+ assert(matrix_is_colvec(b) && "Column vector b expected");
Matrix *L = matrix_id(A->n);
Matrix *A_prev = matrix_copy(A);
@@ -321,7 +321,7 @@ Matrix **matrix_LR(const Matrix *A, const Matrix *b)
Matrix *matrix_forwardel(const Matrix *L, const Matrix *b)
{
assert(L->n == b->m && "Dimension mismatch");
- assert(b->n == 1 && "Vector b expected");
+ assert(matrix_is_colvec(b) && "Column vector b expected");
double sum;
Matrix *y = matrix_const(L->n, 1, 0);
@@ -340,7 +340,7 @@ Matrix *matrix_forwardel(const Matrix *L, const Matrix *b)
Matrix *matrix_backsubst(const Matrix *R, const Matrix *y)
{
assert(R->n == y->m && "Dimension mismatch");
- assert(y->n == 1 && "Vector y expected");
+ assert(matrix_is_colvec(y) && "Column vector y expected");
Matrix *x = matrix_const(R->n, 1, 0);
double sum;