/*************************************************************** 
	The GPDD Sensitivity Project (GPDD_Sens) 
 
	GPDD stands for "Graph-Pair Decision Diagram" 
 
Contributors: 
 
   CHEN, Weiwei			(MS 2007 graduate) 
   MENG, Xiaoxuan		(MS 2009 graduate) 
   ZENG, Mei			(MS 2010 graduate) 
   LI, Ji				(MS 2010 graduate) 
   MA, Diming			(MS 2011 graduate) 
 
   SHI, Guoyong 		(Prof)  shiguoyong@ic.sjtu.edu.cn 
 
   School of Microelectronics 
   Shanghai Jiao Tong University 
   (c) 2005 - 2010 
******************************************************************/ 

/**
	gpdd_global.h
*/

#ifndef GPDD_GLOBAL_H
#define GPDD_GLOBAL_H

#include "utility.h"


#define LINE_INFO   "\n["<<__FILE__<<" : line "<<__LINE__<<" : "<<__FUNCTION__<<"()] - "


#define		SUBGRAPH_PRIME 203311
#define		TAG_PRIME1 2183
#define		TAG_PRIME2 1007
//#define		TPDD_PRIME 218833
//#define		TAG_PRIME1 4093
//#define		TAG_PRIME2 7873

//#define TPDD_PRIME 218833
#define 		GPDD_PRIME 2183
#define 		GPDD_PRIME_LEVEL 1007


#define 	PI 			3.14159265358979323846			

#ifndef DBL_MAX // Li Ji
#define		DBL_MAX		1e20
#endif // DBL_MAX

#define     MAX_APPROX_ORDER  20

// Edge Types.
enum EdgeType	{Y=0, Z, CC, VC, CS, VS};


// G_Value also used in XSPICE. Mainly used by the netlist parser.
typedef union  
{
	int 		iValue;             /* integer or flag valued data */
	double 	rValue;          /* real valued data */
	//Double_Complex cValue;       /* complex valued data */
	char 	*str;           /* string valued data */
	struct {
	    int 		size;       /* length of vector */
	    union {
	        int 		*iVec;      /* pointer to integer vector */
	        double 	*rVec;   /* pointer to real vector */
	        //Double_Complex *cVec;/* pointer to complex vector */
	        char 	**strVec;    /* pointer to string vector */
	    } vec;
	} v;
} G_Value;


// Binary decisions:
#define	SYMBOL_IN		0	// for the INCLUDE operation
#define	SYMBOL_OUT	1	// for the EXCLUDE operation


#define	ODD			1	// odd number
#define	EVEN		0	// even number


#define 	YES		 0	
#define 	OK		 0	// OK means no error

// The following definitions are for "NOT OK":

#define 	ERROR	-1	// Can define more error code using integer numbers
// Error is supposed to be a nonzero number.

//#define FAIL	-1	
/*** The function FAIL() is used in PCCTS. So don't bother it! ***/

#define   NO              	-1
#define	NOPE		-2
#define 	EXIT		-3
#define	STOP		-4	// will quit the program
#define 	NOWAY		-5
#define	BAD			-6
#define 	SKREWED	-7
#define	FAILED		-8
#define	NOTFOUND	-9

#define 	PANIC		-100

//#define FATAL	-10    /** already defined in inc/stddefs.h **/

#endif

