#10364: Vector constructor improvements
------------------------------+---------------------------------------------
Reporter: rbeezer | Owner: jason, was
Type: enhancement | Status: needs_info
Priority: minor | Milestone:
Component: linear algebra | Keywords:
Author: Rob Beezer | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------------+---------------------------------------------
Changes (by rbeezer):
* status: needs_review => needs_info
Comment:
Replying to [comment:6 novoselt]:
> I don't quite like error-checking in `zero_vector` because I think that
it belongs to the general vector constructor.
I agree that using the error-checking code from the more general `vector`
constructor would be best. But the `vector()` constructor is so
permissive and accepts such a variety of input, that I think any input to
a new `zero_vector` *must* get scrutinized (and then report the problem).
Here's the example and test:
{{{
def mock_zero_vector(arg0, arg1=None):
if arg1 is None:
arg0, arg1 = sage.rings.integer_ring.IntegerRing(), arg0
return vector(arg0, arg1)
}}}
{{{
sage: v = sage.modules.free_module_element.mock_zero_vector([1,2,3])
sage: v
(1, 2, 3)
}}}
At least one check is being made in the general constructor - seeing if
the proposed degree is negative.
> I guess also that the list in CALL FORMAT has the issue with INPUT right
under it as on #10362.
Yes, I'll get to this with any other changes. Thanks.
Rob
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10364#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.