login  home  contents  what's new  discussion  bug reports help  links  subscribe  changes  refresh  edit

# Edit detail for List To Matrix revision 1 of 1

 1 Editor: 127.0.0.1 Time: 2007/11/15 20:14:03 GMT-8 Note: transferred from axiom-developer

changed:
-
Assume that I have a 'List', like:
\begin{axiom}
L := [[- 1,3,- 3,1],[3,- 6,3],[- 3,3],[1]]
\end{axiom}
(which is calculated from some earlier expressions).
How can I convert it into a 'SquareMatrix'.
\begin{axiom}
L2:=[concat([L.i.j for j in 1..#L.i],[0 for j in ((#L.i)+1)..#L]) for i in 1..#L]
\end{axiom}

Namely I want to have a matrix like:
\begin{axiom}
A := matrix L2
\end{axiom}
so that I can do
\begin{axiom}
vp := vector[p0,p1,p2,p3]
\end{axiom}
and
\begin{axiom}
vp * A
\end{axiom}


Assume that I have a List, like:

fricas
L := [[- 1,3,- 3,1],[3,- 6,3],[- 3,3],[1]]
 (1)
Type: List(List(Integer))

(which is calculated from some earlier expressions). How can I convert it into a SquareMatrix.

fricas
L2:=[concat([L.i.j for j in 1..#L.i],[0 for j in ((#L.i)+1)..#L]) for i in 1..#L]
 (2)
Type: List(List(Integer))

Namely I want to have a matrix like:

fricas
A := matrix L2
 (3)
Type: Matrix(Integer)

so that I can do

fricas
vp := vector[p0,p1,p2,p3]
 (4)
Type: Vector(OrderedVariableList([p0,p1,p2,p3]))

and

fricas
vp * A
 (5)
Type: Vector(Polynomial(Integer))