jscience
  1. jscience
  2. JSCIENCE-153

Create a method to return the neutral element

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: None
    • Component/s: Mathematics
    • Labels:
      None

      Description

      While writing code working with Polynomials<Rational>, one might be faced with the creation of monomials such as

      Variable<Rational> x = new Variable.Local<Rational>("x");
      Polynomial<Rational> p = Polynomial.valueOf(Rational.ONE, x);

      This is fine, but suppose we now want to go generic, that is write something like

      Variable<R> x = new Variable.Local<R>("x");
      Polynomial<R> p = Polynomial.valueOf(R.ONE, x);

      Then we are stuck, because R.ONE does not actually exist!

      I propose to add three methods
      1. To GroupAdditive<G>
      G getZero()

      2. To GroupMultiplicative<G>
      G getOne()

      2. To Ring<R>
      R getOne()

      This would solve the problem.

      Also,

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            celestin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: