Coder Social home page Coder Social logo

Comments (5)

jverzani avatar jverzani commented on August 11, 2024 1

Implementing this first would likely involve just generalizing printpoly and then figuring out the proper way to call it. I'm not sure how that should be done.

As for the second, I have a new package PolynomialFactors that can factor over the integers modest-sized polynomials. I show the factors in a dictionary so it is clear to a user how to manipulate them, maybe in factored form would be more suitable and not much trouble. But that doesn't really help you, as your polynomials aren't restricted to integer or rational coefficients, so even the act of factoring isn't so easy if multiple roots are common.

from polynomials.jl.

martinholters avatar martinholters commented on August 11, 2024 1

I'd actually like to see printpoly be made part of the public API to be able to show a polynomial (or convert it to a string) without the surrounding Poly(...), and with the possibility to request reverse ordering. (And also an option to appreciate any powers part of the variable, e.g. printpoly(Poly([1,2,3], "z^-1"), collapse_powers=true) should give "1 + 2*z^-1 + 3*z^-2".)

Unless this is considered a bad idea (or someone happens to be working on it already), I'd be willing to tackle it. Should I?

from polynomials.jl.

aytekinar avatar aytekinar commented on August 11, 2024

Correct. In our case, since we are dealing polynomials having real coefficients, we have roots in conjugate pairs. I am planning to keep one of the pairs (in this case, the one with the positive imaginary part, for example). Then, at least, I would not need to care much about pairing them.

As for the first (reversed order printing), I would be more than happy seeing such an option. (Maybe I can also come up with a PR if needed).

from polynomials.jl.

aytekinar avatar aytekinar commented on August 11, 2024

Actually, I would like to have the representation without the Poly(...) surrounding 👍
Reverse ordering also sounds great!

from polynomials.jl.

jverzani avatar jverzani commented on August 11, 2024

The only reason I worked on this was to have the printed output be copy-and-pasteable and to have printing work with some other number types (like the GF(2) example). I'm not sure who is wed to the enclosing Poly or the ordering, though I would think the default should match that expected by the constructor. Looking forward to what you come up with.

from polynomials.jl.

Related Issues (20)

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.