| Laguerre polynomials
    | 
#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() | 
| 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.
| p | Vector of polynomial coefficients. | 
| alpha | Vector of coefficients. | 
| deg | Degree of the polynomial. | 
| b | Output complex number representing root. | 
| c | Output complex number representing correction. | 
| z | Complex number used for correction. | 
| r | Value used for correction. | 
| conv | Output value indicating convergence status. | 
| berr | Output backward error. | 
| cond | Output condition number. | 
| bool check_nan_inf | ( | std::complex< double > | a | ) | 
Check if a complex number contains NaN or Inf values.
| a | Complex number to check. | 
| void conv_hull | ( | int | n, | 
| std::vector< double > & | a, | ||
| std::vector< int > & | h, | ||
| int & | c ) | 
Calculate the convex hull of a set of points.
| n | Number of points. | 
| a | Vector of doubles representing points' coordinates. | 
| h | Vector to store the convex hull. | 
| c | Number of points in the convex hull. | 
| double cross | ( | std::vector< int > & | h, | 
| std::vector< double > & | a, | ||
| int | c, | ||
| int | i ) | 
Calculate the determinant between two points.
| h | Vector of integers representing points. | 
| a | Vector of doubles representing points' coordinates. | 
| c | Index for the current point. | 
| i | Index for the next point. | 
| 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.
| alpha | Vector of coefficients. | 
| deg | Degree of the polynomial. | 
| roots | Vector to store the estimated roots. | 
| conv | Vector to store convergence status of each root. | 
| nz | Number of zeros. | 
| 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.
| poly | Vector of polynomial coefficients. | 
| deg | Degree of the polynomial. | 
| roots | Vector to store the roots. | 
| berr | Vector to store the backward errors. | 
| cond | Vector to store the condition numbers. | 
| conv | Vector to store convergence status of each root. | 
| itmax | Maximum number of iterations. | 
| 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.
| deg | Degree of the polynomial. | 
| b | Complex number representing root. | 
| c | Complex number representing correction. | 
| z | Complex number used for correction. | 
| j | Index of the root to modify. | 
| roots | Vector of estimated roots. | 
| 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.
| p | Vector of polynomial coefficients. | 
| alpha | Vector of coefficients. | 
| deg | Degree of the polynomial. | 
| b | Output complex number representing root. | 
| c | Output complex number representing correction. | 
| z | Complex number used for correction. | 
| r | Value used for correction. | 
| conv | Output value indicating convergence status. | 
| berr | Output backward error. | 
| cond | Output condition number. | 
| const double big = std::numeric_limits<double>::max() | 
| const double eps = std::numeric_limits<double>::epsilon() | 
| const double small = std::numeric_limits<double>::min() |