
/*******************************************
****    File generated by Tree2C V1.0   ****
**** (c) 2017-2019, Alessandro Pedretti ****
********************************************/


#include "random_tree_cpp.h"


/**** Classification method ****/

/*
 * Return the class code
 */

int T2CPP_RANDOM_TREE::Classify()
{
  int     Res;

  if (HbDon < 0.5000f) {
    if (Sas < 756.1100f) {
      if (FG_COOR == T2CPP_RANDOM_TREE_FG_COOR_YES) {
        if (Angles < 106.5000f) {
          if (Atoms < 48.0000f) {
            Res = T2CPP_RANDOM_TREE_TRUE;
          } else {
            if (Atoms < 51.0000f) {
              Res = T2CPP_RANDOM_TREE_FALSE;
            } else {
              Res = T2CPP_RANDOM_TREE_TRUE;
            }
          }
        } else {
          Res = T2CPP_RANDOM_TREE_FALSE;
        }
      } else {
        if (HeavyAtoms < 13.5000f) {
          if (Gyrrad < 2.8500f) {
            Res = T2CPP_RANDOM_TREE_TRUE;
          } else {
            Res = T2CPP_RANDOM_TREE_FALSE;
          }
        } else {
          Res = T2CPP_RANDOM_TREE_TRUE;
        }
      }
    } else {
      Res = T2CPP_RANDOM_TREE_FALSE;
    }
  } else {
    if (Angles < 92.5000f) {
      if (Gyrrad < 3.6800f) {
        if (Torsions < 17.5000f) {
          if (Sas < 283.4200f) {
            Res = T2CPP_RANDOM_TREE_TRUE;
          } else {
            if (FlexTorsions < 0.5000f) {
              if (Sas < 301.9000f) {
                Res = T2CPP_RANDOM_TREE_FALSE;
              } else {
                Res = T2CPP_RANDOM_TREE_TRUE;
              }
            } else {
              if (FG_CON2 == T2CPP_RANDOM_TREE_FG_CON2_YES) {
                if (Lipole < 2.1200f) {
                  Res = T2CPP_RANDOM_TREE_TRUE;
                } else {
                  Res = T2CPP_RANDOM_TREE_FALSE;
                }
              } else {
                if (HbAcc < 2.5000f) {
                  if (Rings < 1.5000f) {
                    if (Sav < 575.0000f) {
                      Res = T2CPP_RANDOM_TREE_TRUE;
                    } else {
                      if (Sdiam < 8.5700f) {
                        Res = T2CPP_RANDOM_TREE_FALSE;
                      } else {
                        Res = T2CPP_RANDOM_TREE_TRUE;
                      }
                    }
                  } else {
                    if (Torsions < 15.5000f) {
                      Res = T2CPP_RANDOM_TREE_FALSE;
                    } else {
                      if (HeavyAtoms < 15.5000f) {
                        Res = T2CPP_RANDOM_TREE_TRUE;
                      } else {
                        Res = T2CPP_RANDOM_TREE_FALSE;
                      }
                    }
                  }
                } else {
                  if (HeavyAtoms < 12.5000f) {
                    Res = T2CPP_RANDOM_TREE_FALSE;
                  } else {
                    if (Angles < 39.5000f) {
                      Res = T2CPP_RANDOM_TREE_TRUE;
                    } else {
                      if (Torsions < 14.5000f) {
                        Res = T2CPP_RANDOM_TREE_FALSE;
                      } else {
                        if (HeavyAtoms < 16.5000f) {
                          if (ChiralAtms < 1.5000f) {
                            Res = T2CPP_RANDOM_TREE_FALSE;
                          } else {
                            Res = T2CPP_RANDOM_TREE_TRUE;
                          }
                        } else {
                          Res = T2CPP_RANDOM_TREE_TRUE;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        } else {
          if (Vdiam < 7.3000f) {
            Res = T2CPP_RANDOM_TREE_FALSE;
          } else {
            if (Sas < 561.9500f) {
              if (HeavyAtoms < 19.5000f) {
                if (Torsions < 19.5000f) {
                  if (FG_COOH == T2CPP_RANDOM_TREE_FG_COOH_YES) {
                    Res = T2CPP_RANDOM_TREE_FALSE;
                  } else {
                    Res = T2CPP_RANDOM_TREE_TRUE;
                  }
                } else {
                  Res = T2CPP_RANDOM_TREE_TRUE;
                }
              } else {
                Res = T2CPP_RANDOM_TREE_TRUE;
              }
            } else {
              Res = T2CPP_RANDOM_TREE_FALSE;
            }
          }
        }
      } else {
        if (Ovality < 1.6900f) {
          if (HbAcc < 3.5000f) {
            if (Rings < 1.5000f) {
              Res = T2CPP_RANDOM_TREE_FALSE;
            } else {
              if (Mass < 303.4100f) {
                if (Ovality < 1.5900f) {
                  Res = T2CPP_RANDOM_TREE_FALSE;
                } else {
                  Res = T2CPP_RANDOM_TREE_TRUE;
                }
              } else {
                Res = T2CPP_RANDOM_TREE_FALSE;
              }
            }
          } else {
            if (Mass < 356.3800f) {
              Res = T2CPP_RANDOM_TREE_FALSE;
            } else {
              if (EzBnds < 0.5000f) {
                Res = T2CPP_RANDOM_TREE_FALSE;
              } else {
                if (Mass < 362.3900f) {
                  Res = T2CPP_RANDOM_TREE_TRUE;
                } else {
                  Res = T2CPP_RANDOM_TREE_FALSE;
                }
              }
            }
          }
        } else {
          if (Sdiam < 10.9700f) {
            if (Lipole < 2.3800f) {
              if (HbAcc < 3.5000f) {
                Res = T2CPP_RANDOM_TREE_TRUE;
              } else {
                Res = T2CPP_RANDOM_TREE_FALSE;
              }
            } else {
              Res = T2CPP_RANDOM_TREE_FALSE;
            }
          } else {
            if (VirtualLogP < 3.4100f) {
              if (Dipole < 2.8300f) {
                Res = T2CPP_RANDOM_TREE_FALSE;
              } else {
                Res = T2CPP_RANDOM_TREE_TRUE;
              }
            } else {
              Res = T2CPP_RANDOM_TREE_TRUE;
            }
          }
        }
      }
    } else {
      if (FlexTorsions < 1.0000f) {
        Res = T2CPP_RANDOM_TREE_TRUE;
      } else {
        if (Ovality < 1.7300f) {
          Res = T2CPP_RANDOM_TREE_FALSE;
        } else {
          if (Psa < 59.6600f) {
            if (HeavyAtoms < 31.0000f) {
              if (Bonds < 51.5000f) {
                Res = T2CPP_RANDOM_TREE_FALSE;
              } else {
                Res = T2CPP_RANDOM_TREE_TRUE;
              }
            } else {
              if (FlexTorsions < 9.0000f) {
                Res = T2CPP_RANDOM_TREE_FALSE;
              } else {
                Res = T2CPP_RANDOM_TREE_TRUE;
              }
            }
          } else {
            if (FG_PhOH == T2CPP_RANDOM_TREE_FG_PHOH_YES) {
              if (Angles < 119.5000f) {
                Res = T2CPP_RANDOM_TREE_TRUE;
              } else {
                if (Angles < 230.0000f) {
                  Res = T2CPP_RANDOM_TREE_FALSE;
                } else {
                  if (ChiralAtms < 21.5000f) {
                    Res = T2CPP_RANDOM_TREE_FALSE;
                  } else {
                    Res = T2CPP_RANDOM_TREE_TRUE;
                  }
                }
              }
            } else {
              if (FG_F == T2CPP_RANDOM_TREE_FG_F_YES) {
                if (ChiralAtms < 1.5000f) {
                  Res = T2CPP_RANDOM_TREE_TRUE;
                } else {
                  if (Vdiam < 9.0700f) {
                    Res = T2CPP_RANDOM_TREE_FALSE;
                  } else {
                    Res = T2CPP_RANDOM_TREE_TRUE;
                  }
                }
              } else {
                if (Lipole < 2.3100f) {
                  if (FlexTorsions < 8.5000f) {
                    if (Sas < 977.1200f) {
                      if (EzBnds < 0.5000f) {
                        if (ChiralAtms < 0.5000f) {
                          if (Mass < 441.2400f) {
                            Res = T2CPP_RANDOM_TREE_TRUE;
                          } else {
                            Res = T2CPP_RANDOM_TREE_FALSE;
                          }
                        } else {
                          Res = T2CPP_RANDOM_TREE_FALSE;
                        }
                      } else {
                        if (Bonds < 59.0000f) {
                          Res = T2CPP_RANDOM_TREE_FALSE;
                        } else {
                          Res = T2CPP_RANDOM_TREE_TRUE;
                        }
                      }
                    } else {
                      Res = T2CPP_RANDOM_TREE_TRUE;
                    }
                  } else {
                    Res = T2CPP_RANDOM_TREE_FALSE;
                  }
                } else {
                  Res = T2CPP_RANDOM_TREE_FALSE;
                }
              }
            }
          }
        }
      }
    }
  }

  return Res;
}


/**** Domain method ****/

/*
 * Return the number of domain violations
 */

int T2CPP_RANDOM_TREE::DomCheck()
{
  int     Violations = 0;

  if ((Angles < 6.00000000f) || (Angles > 374.00000000f)) ++Violations;
  if ((Atoms < 5.00000000f) || (Atoms > 203.00000000f)) ++Violations;
  if ((Bonds < 4.00000000f) || (Bonds > 206.00000000f)) ++Violations;
  if ((ChiralAtms < 0.00000000f) || (ChiralAtms > 25.00000000f)) ++Violations;
  if ((Dipole < 0.00001200f) || (Dipole > 22.36607000f)) ++Violations;
  if ((EzBnds < 0.00000000f) || (EzBnds > 7.00000000f)) ++Violations;
  if ((FlexTorsions < 0.00000000f) || (FlexTorsions > 28.00000000f)) ++Violations;
  if ((Gyrrad < 1.41856400f) || (Gyrrad > 10.56297000f)) ++Violations;
  if ((HbAcc < 0.00000000f) || (HbAcc > 26.00000000f)) ++Violations;
  if ((HbDon < 0.00000000f) || (HbDon > 21.00000000f)) ++Violations;
  if ((HeavyAtoms < 3.00000000f) || (HeavyAtoms > 101.00000000f)) ++Violations;
  if ((Lipole < 0.00000300f) || (Lipole > 6.34667600f)) ++Violations;
  if ((Mass < 70.08984000f) || (Mass > 1449.25400000f)) ++Violations;
  if ((Ovality < 1.16274900f) || (Ovality > 2.74024100f)) ++Violations;
  if ((Psa < 0.00000000f) || (Psa > 544.81690000f)) ++Violations;
  if ((Rings < 0.00000000f) || (Rings > 10.00000000f)) ++Violations;
  if ((Sas < 203.40610000f) || (Sas > 2006.11400000f)) ++Violations;
  if ((Sav < 252.97150000f) || (Sav > 3811.29900000f)) ++Violations;
  if ((Sdiam < 5.14906200f) || (Sdiam > 22.48208000f)) ++Violations;
  if ((Torsions < 0.00000000f) || (Torsions > 94.00000000f)) ++Violations;
  if ((Vdiam < 4.77512900f) || (Vdiam > 13.58132000f)) ++Violations;
  if ((VirtualLogP < -7.13032600f) || (VirtualLogP > 9.48374900f)) ++Violations;

  return Violations;
}
