import junit.framework.*;


public class Tests extends TestCase{



public static void main(String[] args){

		

		boolean t1;

		boolean t2;

		ABMatrix m = new ABMatrix();

		m.matrix = new double[5][5];

		

		for (int i=0; i<5; i++)

			for (int j=0; j<5; j++)

			{

				m.matrix[i][j] = Double.NEGATIVE_INFINITY;

				

			}

	

		m.matrix[1][0] = 5; // x-y >= 2

		m.matrix[0][1] = -10; // -x+y >= -16

		m.matrix[2][4] = 3; // y - z1 >= 3

		m.matrix[3][3] =  6; // x1 + x1 >=6

		m.matrix[4][1] = -2;//z1 -x >= -2

		m.M = 5;

		System.out.print("The following matrix is Unsatisfiable" + "\n");

		

		System.out.print("\t");

		for(int n = 0; n < 5; n++)

		{	

			System.out.print(/* n */  "\t");

		}

		System.out.println("\n");

		for (int i=0; i<5; i++)

	    {  

			System.out.print( /*"Node"*/ " "  /* i*/ +"\t");

			for (int j=0; j<5; j++)

			{

				System.out.print( m.matrix[i][j]  + "\t" );

			}

			System.out.println("\n ");

		}

		CdbTuple t = new CdbTuple(m, new String[] {"x", "y", "z", "x1", "z1"});

		t1 = t.satisfiable();

		System.out.println(t1 + "\n");

		

		//

		ABMatrix o = new ABMatrix();

		o.matrix = new double[5][5];

		

		for (int i=0; i<5; i++)

			for (int j=0; j<5; j++)

			{

				o.matrix[i][j] = Double.NEGATIVE_INFINITY;

				

			}

		o.matrix[1][0] = 5; // x-y >= 5

		o.matrix[0][1] = -10; // -x+y >= -10

		o.matrix[2][1] = -2; // -x1 + x >= -2

		o.matrix[3][2] = 11; //-z+y >=11

		o.matrix[4][3] = -6; //z1 + x1 >=-6

		

		o.M = 5;

		System.out.print("The following matrix is Satisfiable" + "\n");

		System.out.print("\t");

		for(int a = 0; a < 5; a++)

		{	

			System.out.print( "\t");

		}

		System.out.println("\n");

		for (int b=0; b<5; b++)

	    {  

			System.out.print( "\t");

			for (int c=0; c<5; c++)

			{

				System.out.print( o.matrix[b][c]  + "\t" );

			}

			System.out.println("\n ");

		}

	

		

		CdbTuple s = new CdbTuple(o, new String[] {"x", "y", "z", "x1", "z1"});

		t2 = s.satisfiable();

		System.out.println(t2);

	}

		

}
