//---------------------------------------------------------------------------
#ifndef boomH
  #define boomH
//---------------------------------------------------------------------------
/* tracking: 1 = CD-S 2 = reduction 4 = Cover */
  #define trck 0
  #define mintrck 0
  #define GAUGES 3

struct MyGauge
{
  char desc[100];
  int max;
  int val;
};

struct TGauge
{
  int( * NewGauge ) ( char * name, int max, int context );
  void( * CloseGauge ) ();
  int( * GaugeStep ) ( int val, int context );
  void * info;
  int exec_stop;
  int gauges;
  MyGauge mgauge[GAUGES];
};
//---------------------------------------------------------------------------
struct DecompositionOptions;
//---------------------------------------------------------------------------
struct MinimizeOptions
{
  // CD-S
  int CD_no;            // 1=no CD-S
  int CD_mutations;     // mutation ratio
  int CD_weights;       // 1 = weights
  // IE
  int IE_type;          // 0=SQ, 1=distrib_multi, 2=distrib_EXH, 3=multi, 4=EXH
  // dominance
  int DOM_type;         // 0=none, 1=duplicity, 2=dominance
  // IR
  int IR_no;            // 1=no IR
  int IR_mutations;     // mutations
  // cover
  int COV_end;          // 1 = endcover only
  int COV_type;         // 0=LCMC, 1=Contrib_add, 2=contrib, 3=exact
  int COV_somin;        // 1 = single-output minimization
  int COV_substDC;      // 1 = substitute output DCs by 0s

  int OR_no;            // 1 = no OR
  // IC
  int IC_type;          // 0=compare, 1=tree
  int IC_memory;        // 1=implicant check memory

  int STOP_time;
  float STOP_maxtime;
  int STOP_iterations;
  int STOP_maxiterations;
  int STOP_improvement;
  int STOP_improvementint;
  int STOP_optimization;
  int STOP_optimizationval;

  int OPT_crit;

  int DECOMP_enable;    // 1 = enable decomposition
  int DECOMP_CDenable;  // 1 = enable CD-S decomposition
  int DECOMP_COVenable; // 1 = enable cover decomposition
  double DECOMP_CD_force;       // decomposition force for CD-D
  double DECOMP_CD_loadforce;   // decomposition CD-D load penalty
  double DECOMP_COV_force;      // decomposition force for cover
  double DECOMP_COV_loadforce;  // decomposition cover load penalty
  DecompositionOptions * dopts;           // decomposition options

  int DFT_enable;
  int DFT_CDenable;
  int DFT_COVenable;

  double DFT_CD_force;  // DFT force for CD-S
  double DFT_COV_force; // DFT force for cover

  int FC_DF_dir;        // 0 = 1:x, 1 = x:1, 2 = scatter
  int FC_DF;

  int CD_FC;            // 0 = CD-S only, 100 = FC-Min only
};
//---------------------------------------------------------------------------
struct GeneralOptions
{
  // notation
  char NOT_multiply[5]; // multiply delimiter
  char NOT_add[5];      // addition delimiter
  char NOT_neg[5];      // negation symbol
  int NOT_postneg;      // 0=negate before, 1=after
  int NOT_savevarnames; // 0 = don't save names of variables
  int timer;            // 0 = CPU time, 1 = real time
};
//---------------------------------------------------------------------------
struct MinInfo
{
  int cyc;
  float tm;
  float CPUtm;
  int F_hits;
  int tries;
};

//---------------------------------------------------------------------------
class TBuffers;

class Boom
{
public:
    MinimizeOptions * mo;
    GeneralOptions * go;
    TGauge gauge;
    MinInfo info;

    Boom();
    ~Boom();
    class TBoolFnct * Minimize( TBoolFnct * srcf );

private:
    TBuffers * buffers;

    TBoolFnct * OneMinStep( TBoolFnct * srcf, TBoolFnct * allf );
    TBoolFnct * OneFCMinStep( TBoolFnct * srcf, TBoolFnct * allf );
};

#endif
