Displaying 5 results from an estimated 5 matches for "sexp_fjac".
2017 Feb 09
3
Ancient C /Fortran code linpack error
...u should/could use macro R_FINITE to test each entry of the hessian.
> In package nleqslv I test for a "correct" jacobian like this in file nleqslv.c in function fcnjac:
> for (j = 0; j < *n; j++)
> for (i = 0; i < *n; i++) {
> if( !R_FINITE(REAL(sexp_fjac)[(*n)*j + i]) )
> error("non-finite value(s) returned by jacobian (row=%d,col=%d)",i+1,j+1);
> rjac[(*ldr)*j + i] = REAL(sexp_fjac)[(*n)*j + i];
> }
A minor hint on that: While REAL(.) (or INTEGER(.) ...) is really cheap in
the R sources t...
2017 Feb 10
1
Ancient C /Fortran code linpack error
...est each entry of the hessian.
>>> In package nleqslv I test for a "correct" jacobian like this in file nleqslv.c in function fcnjac:
>>
>>> for (j = 0; j < *n; j++)
>>> for (i = 0; i < *n; i++) {
>>> if( !R_FINITE(REAL(sexp_fjac)[(*n)*j + i]) )
>>> error("non-finite value(s) returned by jacobian (row=%d,col=%d)",i+1,j+1);
>>> rjac[(*ldr)*j + i] = REAL(sexp_fjac)[(*n)*j + i];
>>> }
>>
>> A minor hint on that: While REAL(.) (or INTEGER(.) ....
2017 Feb 09
3
Ancient C /Fortran code linpack error
In my package 'glmmML' I'm using old C code and linpack in the
optimizing procedure. Specifically, one part of the code looks like this:
F77_CALL(dpoco)(*hessian, &bdim, &bdim, &rcond, work, info);
if (*info == 0){
F77_CALL(dpodi)(*hessian, &bdim, &bdim, det, &job);
........
This usually works OK, but with an ill-conditioned data
2017 Feb 10
0
Ancient C /Fortran code linpack error
...acro R_FINITE to test each entry of the hessian.
>> In package nleqslv I test for a "correct" jacobian like this in file nleqslv.c in function fcnjac:
>
>> for (j = 0; j < *n; j++)
>> for (i = 0; i < *n; i++) {
>> if( !R_FINITE(REAL(sexp_fjac)[(*n)*j + i]) )
>> error("non-finite value(s) returned by jacobian (row=%d,col=%d)",i+1,j+1);
>> rjac[(*ldr)*j + i] = REAL(sexp_fjac)[(*n)*j + i];
>> }
>
> A minor hint on that: While REAL(.) (or INTEGER(.) ...) is really che...
2017 Feb 09
0
Ancient C /Fortran code linpack error
...aNs in a vector?
You should/could use macro R_FINITE to test each entry of the hessian.
In package nleqslv I test for a "correct" jacobian like this in file nleqslv.c in function fcnjac:
for (j = 0; j < *n; j++)
for (i = 0; i < *n; i++) {
if( !R_FINITE(REAL(sexp_fjac)[(*n)*j + i]) )
error("non-finite value(s) returned by jacobian (row=%d,col=%d)",i+1,j+1);
rjac[(*ldr)*j + i] = REAL(sexp_fjac)[(*n)*j + i];
}
There may be a more compact way with a macro in the R headers.
I feel that If other code can't handle non...