Coder Social home page Coder Social logo

polynomial's Introduction

polynomial Build Status

Some code for representing and manipulating polynomials. Could use a better README.

polynomial's People

Contributors

aavogt avatar dequbed avatar mokus0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

polynomial's Issues

Can we move the support window towards more modern GHC versions?

Currently the package claims to be tested with GHC 7.8.4 — 8.1.* (whatever that asterisk means).

Is it reasonable to maintain such far-reaching backwards compatibility, considering that this is not an infrastructure package?

I propose that we instead test against 8.0.2, 8.2.2, 8.4.4, 8.6.4 and 8.6.5. For the future, I propose that we pin the support window to some well known package, such as haskell-CI.

If there is consensus, I can try my hand at making the required changes.

compile failure with ghc-7.8 (roles)

The instances in src/Data/VectorSpace/WrappedNum.hs do not compile, with the error involving the second type argument of ‘U.MVector’ has role Nominal

Tests fail

$ ./dist/build/polynomial-test/polynomial-test --test-seed 1421927705 -t chebyshevFit
Math.Polynomial.Chebyshev:
  chebyshevFit:
    sane (Double): [OK, passed 100 tests]
    sane (Float): [Failed]
*** Failed! Falsifiable (after 97 tests):
NonNegative {getNonNegative = 16}
<function>
(used seed 1421927705)

         Properties  Total
 Passed  1           1
 Failed  1           1
 Total   2           2

Compile issue with ghc 7.10 (pretty vs prettyclass)

Since version 1.1.2.0 pretty provides the same class as prettyclass does so later is no longer required. Simple removal of prettyclass does the trick for ghc 7.10, better constraints might be required to support earlier versions.

Is this package still maintained?

This package (e.g. the currently published version on hackage, 0.7.3-r1) does not support compilation with newer GHC and base versions. This should be fixed. Merging PRs #12, #16 would probably fix most of it.

It seems that this package isn't really maintained anymore, as no change occured since 2019 (and no substantial changes occured since 2017).

add polyPowerMod

I think it would be helpful to add a polyPowerMod function to Math.Polynomial. It comes in handy, for instance, when working with Galois fields.

As for a signature, probably mirroring the one for powerMod in arithmoi would work well:

polyPowerMod base exponent modulus

doesn't build with GHC 8

I am running The Glorious Glasgow Haskell Compilation System, version 8.0.1 on Mac OS 10.12
I ran cabal install polynomial and it failed. Log file is below.

cabal: Entering directory '/var/folders/sr/jktws8p56m58qw9h6k53dbfr0000gn/T/cabal-tmp-2327/polynomial-0.7.2'
Configuring polynomial-0.7.2...
Building polynomial-0.7.2...
Preprocessing library polynomial-0.7.2...
[ 1 of 15] Compiling Data.List.ZipSum ( src/Data/List/ZipSum.hs, dist/build/Data/List/ZipSum.o )

on the commandline: warning: [-Wunsafe]
    ‘Data.List.ZipSum’ has been inferred as unsafe!
    Reason:
        src/Data/List/ZipSum.hs:3:1: error:
            Data.AdditiveGroup: Can't be safely imported!
            The module itself isn't safe.
[ 2 of 15] Compiling Data.VectorSpace.WrappedNum ( src/Data/VectorSpace/WrappedNum.hs, dist/build/Data/VectorSpace/WrappedNum.o )

src/Data/VectorSpace/WrappedNum.hs:22:18: error:
    • Not in scope: type variable ‘a’
    • In the Template Haskell quotation
        [t| (U.Unbox a) => WrappedNum a -> a |]

src/Data/VectorSpace/WrappedNum.hs:22:35: error:
    • Not in scope: type variable ‘a’
    • In the Template Haskell quotation
        [t| (U.Unbox a) => WrappedNum a -> a |]

src/Data/VectorSpace/WrappedNum.hs:22:40: error:
    • Not in scope: type variable ‘a’
    • In the Template Haskell quotation
        [t| (U.Unbox a) => WrappedNum a -> a |]
cabal: Leaving directory '/var/folders/sr/jktws8p56m58qw9h6k53dbfr0000gn/T/cabal-tmp-2327/polynomial-0.7.2'

Eq context for evalPoly

I'm wondering if it would make sense to supply an alternate version of evalPoly at type (Num a) => Poly a -> a -> a instead of (Num a, Eq a) => Poly a -> a -> a.

It looks like the current version uses the Eq context to check if the argument is zero before evaluating the polynomial, presumably either for efficiency or to be sure to get the exact result.

However this context requirement is a burden when the polynomial is over an abstract domain like an Ivory IDouble which doesn't supply an Eq context.

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.