Giter Site home page Giter Site logo

quarticrootsflocke's Introduction

quarticRootsFlocke Build Status

Polynomial Roots Solver

Port to C++ of Jenkins-Traub real polynomial root finder and the algorithm of Norbert Flocke for polynoms up to degree 4.

Doxygen documentation: http://ebertolazzi.github.io/quarticRootsFlocke/

Repository: https://github.com/ebertolazzi/quarticRootsFlocke

Usage

  #include "PolynomialRoots.hh"
  ....

  double coeffs[] = { 8, -8, 16,-16, 8,-8 }; // polynomial coeffs

  double zeror[5], zeroi[5];
  int    info[5];
  int    degree = 5;

  int ok = PolynomialRoots::roots( coeffs, degree, zeror, zeroi ); // ok < 0 failed
  cout << " ok = " << ok << '\n' ;
  for ( int i = 0 ; i < degree ; ++i )
    cout << zeror[i] << " + I* " << zeroi[i] << '\n';

To solve quadratic, cubic or quartic use specialized classes

  Quadratic qsolve(a,b,c);
  qsolve.info(cout);

  Cubic csolve(a,b,c,d);
  csolve.info(cout);

  Quartic q4(a,b,c,d,e);
  q4.info(cout);

look at the class definition to see how to access the computed roots.

References

  • Algorithm 954: An Accurate and Efficient Cubic and Quartic Equation Solver for Physical Applications, ACM TOMS, vol 41, n.4, 2015

  • A Three-Stage Algorithm for Real Polynomials Using Quadratic Iteration M. A. Jenkins and J. F. Traub SIAM Journal on Numerical Analysis, Vol. 7, No. 4 (Dec., 1970), pp. 545-566

Author

Enrico Bertolazzi
Dipartimento di Ingegneria Industriale
Universita` degli Studi di Trento
email: [email protected]

quarticrootsflocke's People

Contributors

ebertolazzi avatar mbeutel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.