#ifndef SPHIERSTRUCT_H_

#include "Array.h"
//#include "LinkedList.h"
#include "Node.h"
#include <multimap.h>
//#include <pair.h>
#include <string>
#include <map>
#include <algorithm>
#include <fstream>
#include <iostream>
//#include "mpi.h"

using namespace std;

class SphierStruct
{
   
public:
      
     
     int staticLayer;
	 void setPositionBary(int layer);
     char* fname;
	 unsigned int ID0;
	 unsigned int ID1;
	 int rows,cols;
	 int rowt,colt;
	 double threshold;
     bool improvement;
     map <int,int> table[2];
     Array<Node> node0Array;
	 Array<Node> node1Array;
	 SphierStruct();
	 SphierStruct(int rows, int cols, double threshold, 
	 				int rowt, int colt, char * fname);
	 ~SphierStruct();
	 void addNode(Node& node);
	 void addNode(string name, int Layer);
     Node* findNode(Node* node);
	 Node* findNode(int ID, int layer);
     void adjustNodePositions(int layer);
	 int invertStaticLayer();
	 void setPositionBary();
	 void printStruct();
	 void printMatrix();
	 char* itoa( int value, char* result, int base);
	 void findBiclusters( int algo);
	 double evaluate(double num, int func);
	 double evalGrad(double num, int func);
	 double calculateBD(double fp, double fq, double p, double q, double fqd);

};



#define SPHIERSTRUCT_H_

#endif /*SPHIERSTRUCT_H_*/
