Assume that I have a List
, like:
fricas
L := [[- 1,3,- 3,1],[3,- 6,3],[- 3,3],[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]
Type: List(List(Integer))
Namely I want to have a matrix like:
fricas
A := matrix L2
Type: Matrix(Integer)
so that I can do
fricas
vp := vector[p0,p1,p2,p3]
Type: Vector(OrderedVariableList
?([p0,
p1,p2,p3]))
and
fricas
vp * A
Type: Vector(Polynomial(Integer))