RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cmpxpoly.h
Go to the documentation of this file.
1 //
2 // File = cmpxpoly.h
3 //
4 #ifndef _CMPXPOLY_H_
5 #define _CMPXPOLY_H_
6 
7 #include "complex.h"
8 #include <fstream>
9 
11 {
12 public:
13  // default constructor
15 
16  // copy constructor
17  CmplxPolynomial(const CmplxPolynomial& original);
18 
19  // constructor for initializing a binomial
20  CmplxPolynomial(const complex coeff_1, const complex coeff_0);
21 
22  // initializing constructor
23  CmplxPolynomial(const complex* coeff, const int degree);
24 
25  // initializing constructor
26  CmplxPolynomial(const double* coeff, const int degree);
27 
28  // assignment operator
30 
31  // multiply assign operator
33 
34  // divide assign operator
36 
37  // return array of polynomial root values
38  complex* GetRoots(void);
39 
40  // reflect root across the unit circle
41  void ReflectRoot(int root_idx);
42 
43  // dump polynomial to an output stream
44  void DumpToStream(std::ostream* output_stream);
45 
46  // get degree of polynomial
47  int GetDegree(void);
48 
49  // return specified coefficient
50  complex GetCoeff(int k);
51 
52  // return pointer to copy of coefficients
53  void CopyCoeffs(complex*);
54 
55  friend class Polynomial;
56 
57 private:
58  // find roots of the polynomial
59  void FindRoots(void);
60 
61  // build sum of powers coefficients from roots
62  void BuildFromRoots(void);
63 
64  int Degree;
68 };
69 #endif
CmplxPolynomial & operator*=(const CmplxPolynomial &right)
Definition: cmpxpoly.cpp:123
CmplxPolynomial & operator/=(const CmplxPolynomial &divisor)
Definition: cmpxpoly.cpp:158
void FindRoots(void)
Definition: cmpxpoly.cpp:203
complex * Root
Definition: cmpxpoly.h:67
void ReflectRoot(int root_idx)
Definition: cmpxpoly.cpp:277
void BuildFromRoots(void)
Definition: cmpxpoly.cpp:292
void CopyCoeffs(complex *)
Definition: cmpxpoly.cpp:334
complex * Coeff
Definition: cmpxpoly.h:65
CmplxPolynomial & operator=(const CmplxPolynomial &right)
Definition: cmpxpoly.cpp:100
void DumpToStream(std::ostream *output_stream)
Definition: cmpxpoly.cpp:302
int GetDegree(void)
Definition: cmpxpoly.cpp:316
complex * GetRoots(void)
Definition: cmpxpoly.cpp:260
complex GetCoeff(int k)
Definition: cmpxpoly.cpp:325
complex * RemCoeff
Definition: cmpxpoly.h:66