fnlogbeta.gms : Test correctness of logbeta intrinsic


Small Model of Type : GAMS

Category : GAMS Test library

Main file : fnlogbeta.gms

$TITLE 'Test correctness of logbeta intrinsic' (FNLOGBETA,SEQ=732)

$include fnset_xy.inc

$gdxin fnlogbeta
$load aeps reps reps1 reps2 T data

data(T,'fyx_') = data(T,'fxy_');

loop {T,
  data(T,  'f')  = logbeta.value(   data(T,'x'),data(T,'y'));
  data(T, 'fx')  = logbeta.grad(1:  data(T,'x'),data(T,'y'));
  data(T, 'fy')  = logbeta.grad(2:  data(T,'x'),data(T,'y'));
  data(T,'fxx')  = logbeta.hess(1:1:data(T,'x'),data(T,'y'));
  data(T,'fxy')  = logbeta.hess(1:2:data(T,'x'),data(T,'y'));
  data(T,'fyx')  = logbeta.hess(2:1:data(T,'x'),data(T,'y'));
  data(T,'fyy')  = logbeta.hess(2:2:data(T,'x'),data(T,'y'));
  data(T, 'rc')  = mathlastrc;
  data(T, 'ec')  = mathlastec;

* the data set may contain some singular values
abort$[execerror < 6] 'Should get execution errors evaluating logbeta.XXXX(x,y) for exceptional x,y';
execerror = 0;

$include fntest_xy.inc