// Circuit class header file

#ifndef circuit_h

#undef AFX_API
#define AFX_API AFX_EXT_CLASS
#define circuit_h

class CCircuit
{
private:

	int n_qbs;				// number of qbits in the circuit
	int	n_ops;				// number of gates in the circuit
	int input_val;			// input value to circuit 
	bool load_ok;			// ensures that a valid circuit is loaded before execution
	int* oplist;			// ptr to array of gate indices
	int** qbitlist;			// ptr to qbits operated on by each gate

public:

	CCircuit();				// constructor
	~CCircuit();			// destrcutor (needs to ensure that the 
							// gate and qbit lists are reclaimed

	// accessor functions
	int numbits();			// number of qubits in circuit
	int numops();			// number of gates
	int load_okay();		// successful load indicator

	// fuctions
	int getnum(char*, int*);		// gets a number from a string from a pos onwards
									// updates the position pointer
	int getnonedigits(ifstream);	// get none digits
	void setmap();					// sets the string to integer code mapping 
	int loadcircuit(int, THREADPARAMS*);
							// int used to indicate mode:
							// 0 - value input
							// 1 - selective superpos input 
							// 2 - super pos (all bits)
							// return value gives error code (0 if no errors)
							// error codes:
							// 0 - none
							// 1 - input file error
							// 2 - bad selection bits
							// 3 - missing gate data

	int solvecircuit(int, int, THREADPARAMS*, int);	// solves the circuit with input val
							// first arg mode (as above) 
							// val set to zero for superpositioned input
							// third arg for file output
};		

#endif