Giter Site home page Giter Site logo

multivariate-polynomial's People

Contributors

scarlet06 avatar

Watchers

 avatar

multivariate-polynomial's Issues

polynomial type management

When working with only one polynomial type everything work just as expected (until when other bugs will be found)
But when combing more types everything works

The structure

Every Polynomial type is in a different file
The Base class is MultyPolynomial m that handles multiple variative polynomial
SinglePolynomial s handles polynomial with only one variable and inherits from the Base class
ComplexMultyPolynomial cm handles multiple variative polynomial with complex coefficients and inherits from the Base class too
ComplexSinglePolynomial sm handles single variable polynomial with complex coefficients and inherits from both SinglePolynomial and ComplexMultyPolynomial

  graph TD;
      A[MultyPolynomial]-->B[ComplexMultyPolynomial];
      A-->C[SinglePolynomial];
      C-->D[ComplexSinglePolynomial];
      B-->D;

Every type has a method that let itself convert into a "farther" type and has single variable can handle operation with multiple but not the other way arounf

What is expected

For math operations, where I could, I inherited the methods, for standard examples everything looked good. E.g. by doing cm+m what I got was still a cm as wanted, but I didn't noticed that for obvious reasons, doing m+cm what is returned is a m instead of cm

THE PROBLEM

Having all the class in different files is not possible to do a simple conversione, 'couse I would need to a circular import.
Furthermore I'm trying to avoid not necessaries conversions.
there are many think I'd like to got it right in this project:

  1. cm + s = s + cm -> cm
  2. cs + cm = cm + cs -> cm
  3. cs + s = s + cs -> cs
  4. cs + m = m + cs -> cm
  5. s + m = m + s -> m
  6. cm + m = m + cm -> cm

First I think It would be important to handle the operations like (3) and (6)
So it would be easier to handle (2) and (5)
In the end, the harder problem would be (1) and (4) 'couse right not there are missing direct transformation between these types

EDIT

Adding a little table for the actual results for all the operations trying to find a working pattern. I hope it would help anyway

LEFT RIGHT RESULT NO ERROR EXPECTED RIGHT WORKS
m m m m Y
m cm m cm N
m s m m N
m cs m cm N
cm m cm cm Y
cm cm cm cm Y
cm s cm cm N
cm cs cm cm N
s m m m Y
s cm m cm N
s s s s Y
s cs s cs N
cs m m cm N
cs cm m cm N
cs s cs cs Y
cs cs cs cs Y

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.