
/*******************************************
****             C example              ****
**** (c) 2017-2019, Alessandro Pedretti ****
*******************************************/


#include <stdio.h>
#include "random_tree_dll.h"


/**** Main code ****/

int main(int Argc, char *Argv[])
{
  T2C_RANDOM_TREE_INPUT     Input;


  /**** Prediction example 1 ****/

  Input.Angles       = 325.0f;
  Input.Atoms        = 176.0f;
  Input.Bonds        = 185.0f;
  Input.ChiralAtms   = 18.0f;
  Input.Dipole       = 8.4205f;
  Input.EzBnds       = 0.0f;
  Input.FG_CON2      = 0;
  Input.FG_COOH      = 1;
  Input.FG_COOR      = 0;
  Input.FG_F         = 0;
  Input.FG_PhOH      = 1;
  Input.FlexTorsions = 12.0f;
  Input.Gyrrad       = 7.364614f;
  Input.HbAcc        = 26.0f;
  Input.HbDon        = 21.0f;
  Input.HeavyAtoms   = 101.0f;
  Input.Lipole       = 0.858332f;
  Input.Mass         = 1449.254f;
  Input.Ovality      = 2.463538f;
  Input.Psa          = 498.9334f;
  Input.Rings        = 10.0f;
  Input.Sas          = 1573.201f;
  Input.Sav          = 3197.086f;
  Input.Sdiam        = 20.67702f;
  Input.Torsions     = 94.0f;
  Input.Vdiam        = 13.17372f;
  Input.VirtualLogP  = 0.346624f;

  printf("\n* Example #1\n");
  printf("  Domain violations: %d (must be 0)\n", T2C_RANDOM_TREE_DomCheck(&Input));
  printf("  Predicted class:   %d (real 0)\n", T2C_RANDOM_TREE_Classify(&Input));


  /**** Prediction example 2 ****/

  Input.Angles       = 298.0f;
  Input.Atoms        = 152.0f;
  Input.Bonds        = 159.0f;
  Input.ChiralAtms   = 25.0f;
  Input.Dipole       = 7.189289f;
  Input.EzBnds       = 0.0f;
  Input.FG_CON2      = 0;
  Input.FG_COOH      = 0;
  Input.FG_COOR      = 0;
  Input.FG_F         = 0;
  Input.FG_PhOH      = 1;
  Input.FlexTorsions = 15.0f;
  Input.Gyrrad       = 8.992547f;
  Input.HbAcc        = 24.0f;
  Input.HbDon        = 11.0f;
  Input.HeavyAtoms   = 76.0f;
  Input.Lipole       = 0.810682f;
  Input.Mass         = 1085.146f;
  Input.Ovality      = 2.443584f;
  Input.Psa          = 362.2158f;
  Input.Rings        = 8.0f;
  Input.Sas          = 1451.669f;
  Input.Sav          = 2739.57f;
  Input.Sdiam        = 19.1786f;
  Input.Torsions     = 72.0f;
  Input.Vdiam        = 12.26883f;
  Input.VirtualLogP  = 0.76864f;

  printf("\n* Example #2\n");
  printf("  Domain violations: %d (must be 0)\n", T2C_RANDOM_TREE_DomCheck(&Input));
  printf("  Predicted class:   %d (real 1)\n", T2C_RANDOM_TREE_Classify(&Input));

  return 0;
}