LinearAlgebra - Maple Programming Help

Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Constructors : LinearAlgebra/Copy

LinearAlgebra

 Copy
 construct a copy of a Matrix or Vector

 Calling Sequence Copy(MV)

Parameters

 MV - Matrix or Vector to copy

Description

 • The Copy(MV) command returns an identical copy of its argument, MV.  Because this copy is not simply another reference to MV, changes to MV or to the copy do not affect the other.

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $v≔\mathrm{Vector}[\mathrm{row}]\left(\left[1,2,3\right],\mathrm{datatype}=\mathrm{float}[8],\mathrm{attributes}=\left[\mathrm{blue}\right]\right)$
 ${v}{≔}\left[\begin{array}{ccc}{1.}& {2.}& {3.}\end{array}\right]$ (1)
 > $w≔\mathrm{Copy}\left(v\right)$
 ${w}{≔}\left[\begin{array}{ccc}{1.}& {2.}& {3.}\end{array}\right]$ (2)
 > $\mathrm{attributes}\left(w\right)$
 ${\mathrm{blue}}$ (3)
 > ${w}_{1}≔10:$
 > ${v}_{1}$
 ${1.}$ (4)
 > $M≔\mathrm{Matrix}\left(\left[\left[1,2,3\right],\left[4,5\right],\left[6\right]\right],\mathrm{scan}={\mathrm{triangular}}_{\mathrm{upper}},\mathrm{shape}={\mathrm{triangular}}_{\mathrm{upper}}\right)$
 ${M}{≔}\left[\begin{array}{rrr}{1}& {2}& {3}\\ {0}& {4}& {5}\\ {0}& {0}& {6}\end{array}\right]$ (5)
 > $N≔\mathrm{Matrix}\left(M\right)$
 ${N}{≔}\left[\begin{array}{rrr}{1}& {2}& {3}\\ {0}& {4}& {5}\\ {0}& {0}& {6}\end{array}\right]$ (6)
 > $\mathrm{MatrixOptions}\left(M\right)$
 ${\mathrm{shape}}{=}\left[{{\mathrm{triangular}}}_{{\mathrm{upper}}}\right]{,}{\mathrm{datatype}}{=}{\mathrm{anything}}{,}{\mathrm{storage}}{=}{{\mathrm{triangular}}}_{{\mathrm{upper}}}{,}{\mathrm{order}}{=}{\mathrm{Fortran_order}}$ (7)
 > $\mathrm{MatrixOptions}\left(N\right)$
 ${\mathrm{shape}}{=}\left[{}\right]{,}{\mathrm{datatype}}{=}{\mathrm{anything}}{,}{\mathrm{storage}}{=}{\mathrm{rectangular}}{,}{\mathrm{order}}{=}{\mathrm{Fortran_order}}$ (8)
 > $P≔\mathrm{Copy}\left(M\right)$
 ${P}{≔}\left[\begin{array}{rrr}{1}& {2}& {3}\\ {0}& {4}& {5}\\ {0}& {0}& {6}\end{array}\right]$ (9)
 > $\mathrm{MatrixOptions}\left(P\right)$
 ${\mathrm{shape}}{=}\left[{{\mathrm{triangular}}}_{{\mathrm{upper}}}\right]{,}{\mathrm{datatype}}{=}{\mathrm{anything}}{,}{\mathrm{storage}}{=}{{\mathrm{triangular}}}_{{\mathrm{upper}}}{,}{\mathrm{order}}{=}{\mathrm{Fortran_order}}$ (10)