On 3/10/08, William Stein <[EMAIL PROTECTED]> wrote:
>
> On Sun, Mar 9, 2008 at 3:05 PM, Philippe Saade <[EMAIL PROTECTED]> wrote:
>
>
> First he would guess that "vector" might be the command to
> create a vector, and type vector? into Sage, which would
> yield about 20 examples and extensive documentation.
> Once he has created a vector v, he types v.[tab] to see
> what functions are available for working with vectors. One
> of them is called "norm". He types v.norm? and finds out
> how that works.
>
That's precisely what didn't happen (sage 2.8.?). I'll ask him to try
with a newer version (he wasn't in the notebook but on the command
line).
I reproduced his computation on sagenb.org :
a=vector([1,2])
a*a
(fine !)
but then :
norm(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/server2/sage_notebook/worksheets/psaade/0/code/8.py",
line 4, in <module>
norm(a)
File "/usr/local/sage/local/lib/python2.5/site-packages/sympy/plotting/",
line 1, in <module>
File
"/usr/local/sage/local/lib/python2.5/site-packages/sage/misc/functional.py",
line 669, in norm
return x.norm()
TypeError: norm() takes exactly one argument (0 given)
Of course, a.norm(2) works, but that wasn't explained in norm?.
[Chris : ] About the docs, i agree and that's precisely what i'm
doing. But i'm slow at it because i'm busy with my "regular" job...
:-(
>
> > 2/ how can he easily browse the source to find the "vector" class
> > definition and the methods of that class ?
>
>
> For any given function or method type foo?? for source
> instead of foo? (for docs).
>
> Online: Browse all source code is here:
> http://www.sagemath.org/hg/sage-main/file/59538ebc8f3b/sage/modules/
>
great !!
> From within the Sage notebook you can browse the complete source code
> of theSage library here:
> http://localhost:8000/src/
> where http://localhost:8000 is replaced by the address of the sage server.
>
>
Extra great !
> > 3/ how can he be certain of using the "good/best" method ?
>
>
> He can't.
>
> However, if the code that he writes is very slow, then he may be doing
> something wrong, and should look at the source code of Sage and
> ask here or on irc #sage-devel (on irc.freenode.net).
>
> > Thanks for your answers...
>
> You're welcome.
>
Thanks for that efficient answers
--~--~---------~--~----~------------~-------~--~----~
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-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---