-
-
Notifications
You must be signed in to change notification settings - Fork 696
Replaced all instances of <RingElement> with <Element> #40648
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4553,7 +4553,7 @@ cdef class FreeModuleElement_generic_dense(FreeModuleElement): | |
| """ | ||
| cdef list a = left._entries | ||
| cdef list b = (<FreeModuleElement_generic_dense>right)._entries | ||
| v = [(<RingElement> a[i])._add_(<RingElement> b[i]) for i in range(left._degree)] | ||
| v = [(<Element> a[i])._add_(<Element> b[i]) for i in range(left._degree)] | ||
| return left._new_c(v) | ||
|
|
||
| @cython.boundscheck(False) | ||
|
|
@@ -4573,7 +4573,7 @@ cdef class FreeModuleElement_generic_dense(FreeModuleElement): | |
| """ | ||
| cdef list a = left._entries | ||
| cdef list b = (<FreeModuleElement_generic_dense>right)._entries | ||
| v = [(<RingElement> a[i])._sub_(<RingElement> b[i]) for i in range(left._degree)] | ||
| v = [(<Element> a[i])._sub_(<Element> b[i]) for i in range(left._degree)] | ||
| return left._new_c(v) | ||
|
|
||
| cpdef _rmul_(self, Element left): | ||
|
|
@@ -4594,7 +4594,7 @@ cdef class FreeModuleElement_generic_dense(FreeModuleElement): | |
| (1, x^4) | ||
| """ | ||
| if left._parent is self._parent.coordinate_ring(): | ||
| v = [left._mul_(<RingElement>x) for x in self._entries] | ||
| v = [left._mul_(<Element>x) for x in self._entries] | ||
| else: | ||
| v = [left * x for x in self._entries] | ||
| return self._new_c(v) | ||
|
|
@@ -4617,9 +4617,16 @@ cdef class FreeModuleElement_generic_dense(FreeModuleElement): | |
| sage: M = span([[x, x^2+1], [1/x, x^3]], R) | ||
| sage: M.basis()[0] * x | ||
| (1, x^4) | ||
|
|
||
| Check :issue:`40611` is fixed:: | ||
|
|
||
| sage: R = cartesian_product([ZZ, ZZ]) | ||
| sage: assert R in CommutativeRings() | ||
| sage: matrix(1, 1, [R.zero()]) * vector([R.zero()]) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by lmul/rmul you likely mean testing multiply the matrix on left/right side. Calling the internal method explicitly is fine, but not possible if the method is cdef only.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method being tested is |
||
| ((0, 0)) | ||
| """ | ||
| if right._parent is self._parent.coordinate_ring(): | ||
| v = [(<RingElement>x)._mul_(right) for x in self._entries] | ||
| v = [(<Element>x)._mul_(right) for x in self._entries] | ||
| else: | ||
| v = [x * right for x in self._entries] | ||
| return self._new_c(v) | ||
|
|
@@ -4641,7 +4648,7 @@ cdef class FreeModuleElement_generic_dense(FreeModuleElement): | |
| right = left.parent().ambient_module()(right) | ||
| cdef list a = left._entries | ||
| cdef list b = (<FreeModuleElement_generic_dense>right)._entries | ||
| v = [(<RingElement> a[i])._mul_(<RingElement> b[i]) for i in range(left._degree)] | ||
| v = [(<Element> a[i])._mul_(<Element> b[i]) for i in range(left._degree)] | ||
| return left._new_c(v) | ||
|
|
||
| def __reduce__(self): | ||
|
|
@@ -5029,7 +5036,7 @@ cdef class FreeModuleElement_generic_sparse(FreeModuleElement): | |
| cdef dict v = dict((<FreeModuleElement_generic_sparse>right)._entries) | ||
| for i, a in left._entries.iteritems(): | ||
| if i in v: | ||
| sum = (<RingElement>a)._add_(<RingElement> v[i]) | ||
| sum = (<Element>a)._add_(<Element> v[i]) | ||
| if sum: | ||
| v[i] = sum | ||
| else: | ||
|
|
@@ -5049,7 +5056,7 @@ cdef class FreeModuleElement_generic_sparse(FreeModuleElement): | |
| cdef dict v = dict(left._entries) # dict to make a copy | ||
| for i, a in (<FreeModuleElement_generic_sparse>right)._entries.iteritems(): | ||
| if i in v: | ||
| diff = (<RingElement> v[i])._sub_(<RingElement>a) | ||
| diff = (<Element> v[i])._sub_(<Element>a) | ||
| if diff: | ||
| v[i] = diff | ||
| else: | ||
|
|
@@ -5069,7 +5076,7 @@ cdef class FreeModuleElement_generic_sparse(FreeModuleElement): | |
| cdef dict v = {} | ||
| if right: | ||
| for i, a in self._entries.iteritems(): | ||
| prod = (<RingElement>a)._mul_(right) | ||
| prod = (<Element>a)._mul_(right) | ||
| if prod: | ||
| v[i] = prod | ||
| return self._new_c(v) | ||
|
|
@@ -5155,7 +5162,7 @@ cdef class FreeModuleElement_generic_sparse(FreeModuleElement): | |
| cdef dict v = {} | ||
| for i, a in left._entries.iteritems(): | ||
| if i in e: | ||
| prod = (<RingElement>a)._mul_(<RingElement> e[i]) | ||
| prod = (<Element>a)._mul_(<Element> e[i]) | ||
| if prod: | ||
| v[i] = prod | ||
| return left._new_c(v) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test for
v + vshould be added as well, probably similarly other operations can also be tested for.