This package provides an API for using the PHCpack general-purpose solver for polynomial systems by homotopy continuation.

Package Specification

PHCpack is a general-purpose solver for polynomial systems by homotopy continuation.

The PHCpack software is written in Ada95 language, and a C interface has been implemented by the author, Jan Verschelde. This C interface gives access to the black-box solver of PHCpack, a method which solves the given system without any user interaction.

Using Java Native Interface (JNI), a dynamic library has been implemented to provide the usage of the black-box solver for Java. The phcpack4java API written in Java has been implemented to provide access to this black-box solver.

The dynamic libraries must be accessible and initPHCpack4java() must be called before first using the solver. It is recommended to call initPHCpack4java() during the initialization state of your application to prevent dynamic linking failures in a later state.

USAGE

NOTE: For information about the syntax of polynomials, see PHCpack documentation.
  1. A SystemContainer instance must be instantiated. The number of variables in the system must be specified.
  2. Polynomial instances must be added to the system container.
  3. PHCpack.initPHCpack4java() must be called before first using the solver. This method loads the dynamic libraries.
  4. The PHCpack.solveSystem(...) method solves the system and the solutions of the system are returned in a SolutionContainer instance.
Example code showing usage:
	SystemContainer syscon = new SystemContainer(2);
	syscon.addPolynomial(new Polynomial("x;"));
	syscon.addPolynomial(new Polynomial("x^2 + y^2 - 25;"));

	SolutionContainer solcon = null;
	try {
		PHCpack.initPHCpack4java();
		solcon = PHCpack.solveSystem(syscon);
	} catch (PHCpackException ex) {
		ex.printStackTrace();
	}

	System.out.println(solcon);
	
	
The result is:
	ROOT COUNTS :

	total degree : 2
	general linear-product Bezout number : 2
	  based on the set structure :
		 { x }
		 { x y }{ x y }
	mixed volume : 0
	stable mixed volume : 2
	-------------------------------------------------------------------------------
	SOLUTION #1

	t: 1.0 + 0.0i
	m: 1

	coefficients:
	0.0 + 0.0i
	-5.0 + 0.0i

	err: 0.0
	rco: 0.9447513812154695
	res: 0.0
	-------------------------------------------------------------------------------
	SOLUTION #2

	t: 1.0 + 0.0i
	m: 1

	coefficients:
	0.0 + 0.0i
	5.0 + 0.0i

	err: 0.0
	rco: 0.9447513812154695
	res: 0.0
	-------------------------------------------------------------------------------


Related Documentation

For further information about PHCpack please visit: