Example #1
0
 private unsafe double Eval(int dataIdx)
 {
     if (!_hasMetric)
         return double.NaN;
     int outLen = 0;
     double[] res = new double[1];
     fixed (double* ptr = res)
         PInvokeException.Check(PInvoke.BoosterGetEval(Handle, dataIdx, ref outLen, ptr),
                                nameof(PInvoke.BoosterGetEval));
     return res[0];
 }