//---------------------------------------------------------------------------
#ifndef coverH
  #define coverH
//---------------------------------------------------------------------------
class TPfnct;
//---------------------------------------------------------------------------

struct Cov_Opts {
  int DECOMP_COVenable; // 1 = enable cover decomposition
  double DECOMP_COV_force;      // decomposition force for cover
  double DECOMP_COV_loadforce;  // decomposition cover load penalty
  int DFT_COVenable;
  double DFT_COV_force; // DFT force for cover
  int COV_type;         // 0=LCMC, 1=Contrib_add, 2=contrib, 3=exact
  int COV_substDC;      // 1 = substitute output DCs by 0s
};

struct TCovs
{
  TPfnct * fn; // covered ON-set term pointer
  int index;
  int var; // covered output variable
  TCovs * next;
};
//---------------------------------------------------------------------------
struct CovLink
{
  TPfnct * term;
  int index;
  CovLink * prev;
  CovLink * next;
  double contrib;
  unsigned long * vct;
  int count;
};
//---------------------------------------------------------------------------
struct CovSol
{
  int solcost;
  CovLink * sol;
};
//---------------------------------------------------------------------------
class TBoolFnct;
//---------------------------------------------------------------------------
struct CovMatrix
{
  TBoolFnct * fn;
  int cols;
  int origrows;
  int rows;
  CovLink * col;
  CovLink * row;
  char * * matrix;
  int covs;
  CovLink * sol;
  int solcost;
  int dact;
  int cleancheck;
  int block;
  int sparsing;
};
//---------------------------------------------------------------------------
TBoolFnct * Cover( TBoolFnct * fn, struct TGauge gauge, Cov_Opts * covopts );
TBoolFnct * SOCover( TBoolFnct * fn, Cov_Opts * covopts, TGauge gauge );
TBoolFnct * BlockCover( TBoolFnct * fn, Cov_Opts * covopts, struct TGauge gauge, int blocks );
void FindCover( TBoolFnct * fn, struct TGauge gauge );
void SparseOutput( TBoolFnct * fn, Cov_Opts * covopts, TGauge gauge );
//---------------------------------------------------------------------------
#endif
