| 1 |
#ifndef _Roots_h_ |
| 2 |
#define _Roots_h_ |
| 3 |
/* Roots.h |
| 4 |
* |
| 5 |
* Copyright (C) 1993-2025 David Weenink |
| 6 |
* |
| 7 |
* This code is free software; you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation; either version 2 of the License, or (at |
| 10 |
* your option) any later version. |
| 11 |
* |
| 12 |
* This code is distributed in the hope that it will be useful, but |
| 13 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
* General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
/* |
| 22 |
djmw 20020813 GPL header |
| 23 |
*/ |
| 24 |
|
| 25 |
#include "Data.h" |
| 26 |
#include "Graphics.h" |
| 27 |
#include "Polynomial.h" |
| 28 |
#include "WorkvectorPool.h" |
| 29 |
|
| 30 |
#include "Roots_def.h" |
| 31 |
|
| 32 |
|
| 33 |
autoRoots Roots_create (integer numberOfRoots); |
| 34 |
|
| 35 |
void Roots_fixIntoUnitCircle (mutableRoots me); |
| 36 |
|
| 37 |
void Roots_sort (mutableRoots me); |
| 38 |
/* Sort to size of real part a+bi, a-bi*/ |
| 39 |
|
| 40 |
dcomplex Roots_evaluate_z (constRoots me, dcomplex z); |
| 41 |
|
| 42 |
autoRoots Polynomial_to_Roots_ev (constPolynomial me); |
| 43 |
|
| 44 |
integer Roots_getNumberOfRoots (constRoots me); |
| 45 |
|
| 46 |
void Roots_draw (constRoots me, Graphics g, double rmin, double rmax, double imin, double imax, |
| 47 |
conststring32 symbol, double fontSize, bool garnish); |
| 48 |
|
| 49 |
dcomplex Roots_getRoot (constRoots me, integer index); |
| 50 |
|
| 51 |
void Roots_setRoot (mutableRoots me, integer index, double re, double im); |
| 52 |
|
| 53 |
autoRoots Polynomial_to_Roots (constPolynomial me); |
| 54 |
/* Find roots of polynomial and polish them */ |
| 55 |
|
| 56 |
void Roots_Polynomial_polish (mutableRoots me, constPolynomial thee); |
| 57 |
|
| 58 |
autoPolynomial Roots_to_Polynomial (constRoots me, bool rootsAreReal); |
| 59 |
|
| 60 |
/* |
| 61 |
workspace size >= n * n + 2 * n + 11 * n= |
| 62 |
n * n ; for hessenberg matrix |
| 63 |
+ 2 * n ; for real and imaginary parts |
| 64 |
+ 11 * n ; the maximum for dhseqr_ |
| 65 |
*/ |
| 66 |
void Polynomial_into_Roots (constPolynomial me, mutableRoots r, VEC workspace); |
| 67 |
|
| 68 |
#endif /* _Roots_h_ */ |