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


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


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

int main(int Argc, char *Argv[])
{
  T2CPP_RANDOM_TREE     Model;


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

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

  printf("\n* Example #1\n");
  printf("  Domain violations: %d (must be 0)\n", Model.DomCheck());
  printf("  Predicted class:   %d (real 0)\n", Model.Classify());


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

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

  printf("\n* Example #2\n");
  printf("  Domain violations: %d (must be 0)\n", Model.DomCheck());
  printf("  Predicted class:   %d (real 1)\n", Model.Classify());

  return 0;
}
