Skip to content

Instantly share code, notes, and snippets.

@drewxa
Last active January 20, 2018 18:30
Show Gist options
  • Save drewxa/49f8f1fc59c9c3efe87fa5c0fd153d9d to your computer and use it in GitHub Desktop.
Save drewxa/49f8f1fc59c9c3efe87fa5c0fd153d9d to your computer and use it in GitHub Desktop.
#pragma once
#include <vector>
template <class T>
class Polynom
{
Polynom();
~Polynom();
Polynom(const std::vector<T>& coef);
T& operator[](size_t);
const T& operator[](size_t) const;
size_t Degree() const;
bool operator == (const Polynom&) const;
Polynom& operator += (const Polynom&);
Polynom& operator -= (const Polynom&);
Polynom& operator *= (const Polynom&);
template <class CONST>
Polynom& operator *= (CONST c);
Polynom& operator /= (const Polynom&);
Polynom& operator %= (const Polynom&);
T operator()(const T&) const;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment