charlie-map / wiki-suggestor-service

A C backend that makes suggestions for the Wikiread extension
0 stars 0 forks source link

Matrix Assertion Failure #12

Open charlie-map opened 2 years ago

charlie-map commented 2 years ago

Currently, when trying to compute the weights for each component in the matrix formula (see #11), the following error occurs:

matrix/vector.c:210: vector_normalize_into: Assertion `norm != 0' failed.

This occurs when I try run the vector_normalize() function:

struct vector* vector_normalize(struct vector* v) {
    struct vector* vnorm = vector_new(v->length);
    double norm = vector_norm(v);
    assert(norm != 0);
    vector_normalize_into(vnorm, v);
    return vnorm;
}

However, interestingly, when I print the norm value before the assertion I get the number:

6.9533393936944218e-310

which is clearly very close to 0. Some research into the numbers that are going into the linear regression formula will have to be done.