Skip to content
Snippets Groups Projects
cluster_main.cpp 3.64 KiB
#include <sstream>
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <cmath>
#include <complex>
#include <ctime>
#include <stdlib.h>
#include <float.h>
#include <random>
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_min.h>
#include <gsl/gsl_multimin.h>


#define PI  (3.14159265359)
#define TIMING 0

using namespace std;

#if TIMING == 1
#include <chrono>
using namespace std::chrono;
#endif

/*
 * define a struct
 * that contains
 * the file information:
 * 	- file name length in characters
 * 	- file name
 * 	- length of file in lines
 */
struct input_file
{
	const char* 	filename;
	int		nbr_lines;
};


/* 
 * define a struct 
 * that contains 
 * the sequence information:
 * 	- length
 * 	- amount of IPs
 * 	- frequency prior
 * 	- protein concentration 
 * 		(multiple of c_0)
 * 	- actual sequence encoded 
 * 		in numbers from 0 to 3
 */
struct sequence 
{
	int	length;
	int	amt;
	double 	freq;
	int	*seq;
}; 


/*
 * defines a struct
 * that contains 
 * the current state of the parameters
 * subject to the EM algorithm
 */