vector

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

vector

Bertrand Roessli
Hello,

I am really new to axiom, so my question is
naive.
How is it possible to multiply two vectors??

thanks,

B.

--
Dr. Bertrand Roessli
Laboratory for Neutron Scattering
ETHZ and Paul Scherrer Institut
CH-5232 Villigen, PSI


_______________________________________________
Axiom-mail mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/axiom-mail
Reply | Threaded
Open this post in threaded view
|

Re: vector

Gregory Vanuxem
Le mardi 25 octobre 2005 à 11:32 +0200, Bertrand Roessli a écrit :
> Hello,
>
> I am really new to axiom, so my question is
> naive.
> How is it possible to multiply two vectors??

multiplication element by element

a:= vector [1,2,3,5,6]
map(*,a,a)

otherwise use Matrix

a:= matrix [[1,2,3,4,5,6]]
a * transpose a

Cheers,

Greg

>
> thanks,
>
> B.
>




_______________________________________________
Axiom-mail mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/axiom-mail
Reply | Threaded
Open this post in threaded view
|

Re: vector

daly
In reply to this post by Bertrand Roessli
)clear all

-- make three vectors
u : VECTOR INT := new(5,12)
v : VECTOR INT := vector([1,2,3])
w : VECTOR INT := vector([2,3,4])
-- multiply them
cross(v,w)
-- dot product
dot(v,w)
-- ask for the length
#(v)
-- access an element
v.2
-- set an element
v.3 := 99
-- show the vector
v
-- multiply by a constant
5 * v
-- on either side
v * 7
-- add them
v + w
-- substract them
v - w
-- display all possible functions
)show Vector(Integer)



_______________________________________________
Axiom-mail mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/axiom-mail