public static PolynomialRoots createRootFinder ( RootFinderType type , int maxDegree ) { switch ( type ) { case EVD : return new RootFinderCompanion ( ) ; case STURM : FindRealRootsSturm sturm = new FindRealRootsSturm ( maxDegree , - 1 , 1e-10 , 30 , 20 ) ; return new WrapRealRootsSturm ( sturm ) ; } throw new IllegalArgumentException ( "Unknown type" ) ; }
Creates a generic polynomial root finding class which will return all real or all real and complex roots depending on the algorithm selected .