long TarD;
long RecurNum;
long FoundNG;

long TotalItems;
long InputFileTotalPatents ;
char sourcePath[300];
double AvgUniqueTerms;
int ThreadTerminationCount ;

long *IDFValue;
long **IDFValue_Part;
long Patent_QRelevance_Count;

double AveragePatentLength ;
double Parameter_Value;

int CriticalSection ;
long CollEx ;

int GlobalPartitionNumber ;
typedef struct str_thdata
{
    long Local_GlobalPostingAge;
	long ThreadNumber;
	long QueryPatentNumber;
    
} thdata;

int PPS;


char topic_File[300];
int total_topic_File;
char Qrel_File[300];
int Recall_cutoff;
int Precision_cutoff;
char LowHigh_Labels[300];
char offline_Cluster_File[300];
char Term_Posting_File[300];
char J48Rules[300];

long *ComponentLabel;
/*--------------------------- Inverted Index Variables ------------------------------------- */

struct InvertedItemsArray
{
		double Score;
		double TFScore;
		long DocumentNumber;
		struct InvertedItemsArray *nextPtr;


};
struct InvertedItemsArray **InvertedItemsNumbers,*tempInvertedVariable;
long *InvertedItemsNumbersCount;
long *fullPatentLength;
long *fullPatentLength_RetrievalProbability;

double *doc_avg_dl;

long *fullPatentLength_AllOver;
long *fullPatentUniqueItems;
	double **surface_features;

long *longQueries_TotalQueries;
long *longQueries_Find;


//ThreadVariables
double **PostingScore;
double **PostingTFScore;
long **PostingQueryTermsPresence;
long **PostingAge;
long ***TermPresence;
long **FoundPatents;
double **FoundPatentsScore;
double **PatentRMScore;
double **FoundPatentsTFScore;
long FoundPatentsCount[200];

long QueryItemArray[200][4000];
long QueryItemArray_Freq[200][4000];
long QueryItemCount[200];

long Qrel[200][2000];
long QrelCount[200];
long ComponentQrel[200][200];


long TotalFoundHighFindableDocuments[200];
long TotalFoundLowFindableDocuments[200];










long GlobalPostingAge;


int fileNumber;


double**b_prefFoundQP;
long **b_prefTotalQP;


double**MAPFoundQP;
long **MAPTotalQP;


double**RecallFoundQP;
long **RecallTotalQP;


double**PrecisionFoundQP;
long **PrecisionTotalQP;

double **MRRFoundQP;
long **MRRTotalQP;


int RSType ;
long *TermCollectionSum;
long CollectionModel;
long CollectionModle;




long *rd_score;
double *hat_rd_score;
long *DocID;


double ComponentMRR[200];
double ComponentRecall[100][15];
double ComponentPrecision[100][15];
double ComponentMAP[100][15];
double Componentb_pref[100][15];

double AllRecall[100];
double AllPrecision[100];
double AllMRR;
double AllMAP[100];
double Allb_pref[100];

int Know_Item_Search_Flag;






