Identity Matrix

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Identity Matrix

panAxiom
Hi,

is there a command / "shortcut" for creating the identity matrix of a certain size?
Or is it necessary to use the matrix()-command and set all the values on the diagoanl to one and all others to zero?

Would be much easier, if there is something like identitiymatrix(3),
which would make a 3x3 identity-matrix.

any ideas?

TIA,
  pan.

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

Re: Identity Matrix

Ralf Hemmecke-4
If you use SquareMatrix, then it is clear, what the identity matrix is,
namely 1. So one can just create such a matrix and then convert it to
the generic Matrix domain. But maybe, you actually like SquareMatrix
even better.

(1) -> 1$SquareMatrix(3,Integer)::Matrix(Integer)

        +1  0  0+
        |       |
   (1)  |0  1  0|
        |       |
        +0  0  1+
                                                        Type:
Matrix(Integer)

Ralf


On 08/11/2018 07:24 PM, [hidden email] wrote:

> Hi,
>
> is there a command / "shortcut" for creating the identity matrix of a certain size?
> Or is it necessary to use the matrix()-command and set all the values on the diagoanl to one and all others to zero?
>
> Would be much easier, if there is something like identitiymatrix(3),
> which would make a 3x3 identity-matrix.
>
> any ideas?
>
> TIA,
>   pan.
>
> _______________________________________________
> Axiom-math mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/axiom-math
>

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