Laguerre polynomials
Loading...
Searching...
No Matches
L18_or.h File Reference
#include <complex>
#include <vector>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <limits>
#include "ExtendedFunctions.h"

Go to the source code of this file.

Functions

double cross (std::vector< int > &h, std::vector< double > &a, int c, int i)
 Calculate the determinant between two points.
 
void conv_hull (int n, std::vector< double > &a, std::vector< int > &h, int &c)
 Calculate the convex hull of a set of points.
 
void estimates (std::vector< double > &alpha, int deg, std::vector< std::complex< double > > &roots, std::vector< int > &conv, int &nz)
 Estimate roots of a polynomial.
 
bool check_nan_inf (std::complex< double > a)
 Check if a complex number contains NaN or Inf values.
 
void rcheck_lag (std::vector< double > &p, std::vector< double > &alpha, int deg, std::complex< double > &b, std::complex< double > &c, std::complex< double > z, double r, int &conv, double &berr, double &cond)
 Perform Laguerre correction, compute backward error, and condition.
 
void check_lag (std::vector< double > &p, std::vector< double > &alpha, int deg, std::complex< double > &b, std::complex< double > &c, std::complex< double > z, double r, int &conv, double &berr, double &cond)
 Perform Laguerre correction, compute backward error, and condition.
 
void modify_lag (int deg, std::complex< double > &b, std::complex< double > &c, std::complex< double > z, int j, std::vector< std::complex< double > > &roots)
 Modify Laguerre correction based on Aberth's method.
 
void laguerre (std::vector< double > &poly, int deg, std::vector< std::complex< double > > &roots, std::vector< int > &conv, int itmax)
 Find the roots of a polynomial using Laguerre's method.
 

Variables

const double eps = std::numeric_limits<double>::epsilon()
 
const double big = std::numeric_limits<double>::max()
 
const double small = std::numeric_limits<double>::min()
 

Function Documentation

◆ check_lag()

void check_lag ( std::vector< double > & p,
std::vector< double > & alpha,
int deg,
std::complex< double > & b,
std::complex< double > & c,
std::complex< double > z,
double r,
int & conv,
double & berr,
double & cond )

Perform Laguerre correction, compute backward error, and condition.

Parameters
pVector of polynomial coefficients.
alphaVector of coefficients.
degDegree of the polynomial.
bOutput complex number representing root.
cOutput complex number representing correction.
zComplex number used for correction.
rValue used for correction.
convOutput value indicating convergence status.
berrOutput backward error.
condOutput condition number.

◆ check_nan_inf()

bool check_nan_inf ( std::complex< double > a)

Check if a complex number contains NaN or Inf values.

Parameters
aComplex number to check.
Returns
bool True if NaN or Inf is found, false otherwise.

◆ conv_hull()

void conv_hull ( int n,
std::vector< double > & a,
std::vector< int > & h,
int & c )

Calculate the convex hull of a set of points.

Parameters
nNumber of points.
aVector of doubles representing points' coordinates.
hVector to store the convex hull.
cNumber of points in the convex hull.

◆ cross()

double cross ( std::vector< int > & h,
std::vector< double > & a,
int c,
int i )

Calculate the determinant between two points.

Parameters
hVector of integers representing points.
aVector of doubles representing points' coordinates.
cIndex for the current point.
iIndex for the next point.
Returns
double Determinant between two points.

◆ estimates()

void estimates ( std::vector< double > & alpha,
int deg,
std::vector< std::complex< double > > & roots,
std::vector< int > & conv,
int & nz )

Estimate roots of a polynomial.

Parameters
alphaVector of coefficients.
degDegree of the polynomial.
rootsVector to store the estimated roots.
convVector to store convergence status of each root.
nzNumber of zeros.

◆ laguerre()

void laguerre ( std::vector< double > & poly,
int deg,
std::vector< std::complex< double > > & roots,
std::vector< int > & conv,
int itmax )

Find the roots of a polynomial using Laguerre's method.

Parameters
polyVector of polynomial coefficients.
degDegree of the polynomial.
rootsVector to store the roots.
berrVector to store the backward errors.
condVector to store the condition numbers.
convVector to store convergence status of each root.
itmaxMaximum number of iterations.

◆ modify_lag()

void modify_lag ( int deg,
std::complex< double > & b,
std::complex< double > & c,
std::complex< double > z,
int j,
std::vector< std::complex< double > > & roots )

Modify Laguerre correction based on Aberth's method.

Parameters
degDegree of the polynomial.
bComplex number representing root.
cComplex number representing correction.
zComplex number used for correction.
jIndex of the root to modify.
rootsVector of estimated roots.

◆ rcheck_lag()

void rcheck_lag ( std::vector< double > & p,
std::vector< double > & alpha,
int deg,
std::complex< double > & b,
std::complex< double > & c,
std::complex< double > z,
double r,
int & conv,
double & berr,
double & cond )

Perform Laguerre correction, compute backward error, and condition.

Parameters
pVector of polynomial coefficients.
alphaVector of coefficients.
degDegree of the polynomial.
bOutput complex number representing root.
cOutput complex number representing correction.
zComplex number used for correction.
rValue used for correction.
convOutput value indicating convergence status.
berrOutput backward error.
condOutput condition number.

Variable Documentation

◆ big

const double big = std::numeric_limits<double>::max()

◆ eps

const double eps = std::numeric_limits<double>::epsilon()

◆ small

const double small = std::numeric_limits<double>::min()