Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.4
   Version 1.0.4dev
      Class Index
      File List
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads

polysolver.hpp File Reference

Polynomial solver. More...

#include <stdint.h>

Go to the source code of this file.

Functions

uint32_t solve_quadratic (double a, double b, double c, double *x0, double *x1)
 Solve quadric equation a*x^2 + b*x + c = 0.
uint32_t solve_cubic (double a, double b, double c, double d, double *x0, double *x1, double *x2)
 Solve cubic equation a*x^3 + b*x^2 + c*x + d = 0.
uint32_t solve_quartic (double a, double b, double c, double d, double *x0, double *x1, double *x2, double *x3)
 Solve quartic equation x^4 + a*x^3 + b*x^2 + c*x + d = 0.

Detailed Description

Polynomial solver.


Function Documentation

uint32_t solve_cubic ( double  a,
double  b,
double  c,
double  d,
double *  x0,
double *  x1,
double *  x2 
)

Solve cubic equation a*x^3 + b*x^2 + c*x + d = 0.

Solves the cubic equation. Can also handle lower order polynomials if coefficients are zero. Returns the number of roots found. Roots are filled in ascending order.

uint32_t solve_quadratic ( double  a,
double  b,
double  c,
double *  x0,
double *  x1 
)

Solve quadric equation a*x^2 + b*x + c = 0.

Solves the quadric equation. Can also handle linear case if a is zero. Returns the number of roots found. Roots are filled in ascending order.

uint32_t solve_quartic ( double  a,
double  b,
double  c,
double  d,
double *  x0,
double *  x1,
double *  x2,
double *  x3 
)

Solve quartic equation x^4 + a*x^3 + b*x^2 + c*x + d = 0.

Solves the quartic equation. Returns the number of roots found. Roots are filled in ascending order.


Reference manual for Ion Beam Simulator 1.0.4dev
Generated by Doxygen 1.7.1 on Wed May 18 2011 23:03:49.