/polynomial

Implementation of algebraic polynomial and arithmetic operations with it

Primary LanguageC++MIT LicenseMIT

MIT License LinkedIn

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Contact
  6. Acknowledgments

About The Project

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 to std::ostream
  • >> - read polynomial from std::istream. The format is following: enter the degree of a polynomial n, enter n + 1 coefficients right to left
  • [i] - return coefficient at x^i

(back to top)

Getting Started

To use this algebraic polynomial implementation, follow the simple steps below.

Installation

  1. Clone the repo git clone https://github.com/MariaMozgunova/polynomial.git
  2. Include program into your code #include "polynomial/polynomial.cpp"

(back to top)

Usage

See main_polynomial.cpp for examples of usage.

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Maria Mozgunova - Twitter - @MariaMozgunova - mariiamozgunova@gmail.com

Project Link: https://github.com/MariaMozgunova/polynomial

(back to top)

Acknowledgments

(back to top)