Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add adjoin trick to add identity to pseduo-rings #47

Closed
johnynek opened this issue Dec 6, 2012 · 0 comments
Closed

Add adjoin trick to add identity to pseduo-rings #47

johnynek opened this issue Dec 6, 2012 · 0 comments

Comments

@johnynek
Copy link
Collaborator

johnynek commented Dec 6, 2012

http://en.wikipedia.org/wiki/Pseudo-ring#Adjoining_an_identity_element

What we want is something like:

// in Ring object:
  def adjoinOne[T](implicit pseudoring: Ring[T]): Ring[(BigInt, T)] = new Ring[(BigInt,T)] {
    lazy val one = (BigInt(1), pseudoring.zero)
    lazy val zero = (BigInt(0), pseudoring.zero)
   // and follow the rules above.
  }

This would allow us to use a Map as a true ring, not a pseudo-ring, which could be useful in Matrix.scala (but honestly, this is mostly a correctness issue, I don't think matrix.scala often assumes ring.one exists).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant