Dear all,
I've got a function which involves matrix inversion and is frequently
called in loop. From time to time matrix inversion, however, fails. Thus
I tried to use the catch command similar to this tiny example:
<hansl>
function matrix matI(matrix mat)
return inv(mat)
end function
mat = zeros(2,2)
scalar err = 0
catch mI = matI(mat)
err = $error
if err==0
printf "WORKS \n"
else
printf "FAILS \n"
endif
</hansl>
In this example-script everything works fine. However, in my larger
script involving many different things before function "matI" is called,
gretl stops giving me the error message:
<gretl-output>
Unmatched "endif"
</gretl-output>
and the corresponding terminal output (using latest CVS on ubuntu) is:
<terminal>
gretl_invert_symmetric_matrix: dpotrf failed with info = 2 (n = 2)
dsycon: rcond = 5.47239e-18
gretl_clipboard_get: info = 0 (TARGET_UTF8_STRING)
gretl_clipboard_get: info = 0 (TARGET_UTF8_STRING)
</terminal>
Unfortunately I am not able to reproduce this error in a smaller example
script.
Artur