Table of Contents
This project is the implementation of the algebraic polynomial stored as a vector of coefficients. All the operations manipulate coefficients only.
The following operations are available:
=
- copy assignment operator==
,!=
- check whether respective coefficients of two polynomials are (non)equal- unary
+
- return the polynomial itself - binary
+
- add two polynomials - unary
-
- return the polynomial with the changed sign of each coefficient - binary
-
- subtract the second polynomial from the first +=
- add the right polynomial to the left polynomial and assign the result to the left polynomial-=
- subtract the right polynomial from the left polynomial and assign the result to the left polynomial*
,/
,*=
,/=
- multiply or divide each coefficient by a given number<<
- output polinomial tostd::ostream
>>
- read polynomial fromstd::istream
. The format is following: enter the degree of a polynomialn
, entern + 1
coefficients right to left[i]
- return coefficient atx^i
To use this algebraic polynomial implementation, follow the simple steps below.
- Clone the repo
git clone https://github.com/MariaMozgunova/polynomial.git
- Include program into your code
#include "polynomial/polynomial.cpp"
See main_polynomial.cpp
for examples of usage.
Distributed under the MIT License. See LICENSE
for more information.
Maria Mozgunova - Twitter - @MariaMozgunova - mariiamozgunova@gmail.com
Project Link: https://github.com/MariaMozgunova/polynomial