Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <vector>
- #include <ostream>
- //a*x^n
- struct Term{
- double a;
- unsigned n;
- Term(double a, int n);
- };
- //a+bi
- struct Complex{
- double a, b;
- Complex(double a, double b);
- Complex(double a);
- Complex();
- };
- Complex operator + (Complex A, Complex B);
- Complex operator - (Complex A, Complex B);
- Complex operator * (Complex A, Complex B);
- Complex operator / (Complex A, Complex B);
- bool operator == (Complex A, Complex B);
- Complex pow(Complex c, int n);
- std::ostream& operator << (std::ostream& out, Complex c);
- //temporary construct for the actual solving.
- struct Polynomial{
- std::vector<Term> p;
- Complex eval(Complex x);
- int degree();
- std::vector<Complex> solve();
- };
- std::ostream& operator << (std::ostream& out, Polynomial p);
Advertisement
Add Comment
Please, Sign In to add comment