Am 07.01.2023 um 19:56 schrieb Sven Schreiber:

in lib/src/gretl_matrix.c inside the real_gretl_dgeev function on line 9797 I'm seeing:

 if (gretl_is_null_matrix(A) || A->rows != A->cols) {
        *err = E_INVARG;
        return NULL;

leading to the user-level generic error message "invalid argument" for example for non-square matrix input into the eigen() function.

Do we have some error other than E_INVARG that we could use here to yield something a little more informative?

First of all, in the subject line of course it should be "error message" instead of error matrix.

OK , what about something like the following:

 if (gretl_is_null_matrix(A)) {
        *err = E_INVARG;

        return NULL;

} else if ( A->rows != A->cols) {

        *err = E_NONCONF;

      return NULL;

}

From what I see in lib/src/gretl_errors.c, this means "Matrices not conformable for operation". Or would it make sense to create a new error type, say E_NONSQ or so, saying that the matrix isn't square?

thanks

sven