yOn Wed, 23 Feb 2022, Sven Schreiber wrote:
Am 22.02.2022 um 15:38 schrieb Sven Schreiber:
> Am 13.02.2022 um 14:12 schrieb Sven Schreiber:
>> Hi, according to the doc for psdroot(): "If the input matrix is not
>> square an error is flagged".
>>
>> This is true but the error message is a very generic "data error", see
...
> Would it be OK to replace that with the following:
>
> if (gretl_is_null_matrix(a)) {
> return E_DATA;
> } else if (a->rows != a->cols) {
> return E_NONCONF;
>
> }
>
This is now in git such that for simple test cases I get "matrices
not conformable for operation".
The reference to "matrices" (plural) in this case seems to me
clearly wrong. In git I've substituted E_INVARG, so the error
message becomes "Invalid argument". We could substitute a more
specific message, such as
"psdroot: the argument must be square"
or perhaps a more generic version such as
"Expected a square matrix"
which could be attached to a new, reusable error code, E_NONSQUARE.
In each the cost would be a little more work for translators.
(BTW, a point of libgretl C coding style is that we never put white
space after an opening, or before a closing, parenthesis. Jack might
call that a "Taliban" requirement on my part, but it's an iron rule
so long as I'm above ground!)
Allin