On Wed, Dec 22, 2010 at 6:53 AM, Simon King <simon.k...@uni-jena.de> wrote:
> Hi!
>
> We have
> sage: v = vector(ZZ,[1,2])
> sage: M = matrix(ZZ,2,2,[1,2,3,4])
> sage: cm = sage.structure.element.get_coercion_model()
> sage: cm.explain(v.parent(),M.parent(),operator.mul)
> Action discovered.
>    Right action by Full MatrixSpace of 2 by 2 dense matrices over
> Integer Ring on Ambient free module of rank 2 over the principal ideal
> domain Integer Ring
> Result lives in Ambient free module of rank 2 over the principal ideal
> domain Integer Ring
> Ambient free module of rank 2 over the principal ideal domain Integer
> Ring
>
> But how does it work? I tried to search v.__mul__, v._acted_upon,
> M._act_on, but didn't find it.

sage: M = matrix(ZZ, 2, 2)
sage: space = M.parent(); space
Full MatrixSpace of 2 by 2 dense matrices over Integer Ring
sage: space.get_act
space.get_action       space.get_action_c     space.get_action_impl
sage: space.get_action??

If get_action (and discover_action) are not overridden, the default is
to look for element._act_on, etc.

- Robert

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to