#ifndef _EXTREME_ML_H_
#define _EXTREME_ML_H_

typedef struct {
  int id;
  int outlier;
  long int offset;
  int strand;
  int banded;
  int start_diagonal;
  int stop_diagonal;
  char *name;
  float score;
  float length;
  float pvalue;
	fpos_t fpos;
}
SCORE;


double SolveForL ( SCORE *data, int N  );
double LFunc( double L, SCORE *data, int N  );
void LSums( double L, SCORE *data, int N, int *M, double *mean, double *sum0, double *sum1, double *sum2 );
void ExtremeStderr( double L, double K, int M, double sum0, double sum1, double sum2, double *L_stderr, double *K_stderr );
int FindPvalues( SCORE *score_data, int N, double *K, double *L );
int ScoreCmp( const void *a, const void *b );

int TruncatedFindPvalues( SCORE *score_data, int N, double *K, double *L );

#endif
