GivensRotationMatrix - Maple Help

LinearAlgebra

 GivensRotationMatrix
 construct the Matrix for a Givens rotation

 Calling Sequence GivensRotationMatrix(V, i, j, d, cpt, options)

Parameters

 V - Vector; used for constructing the Givens rotation i - non-zero integer; index of an entry in V which is not rotated to zero, but which is used to construct the Givens rotation j - non-zero integer; index of an entry in V which is rotated to zero d - (optional) integer greater than or equal to 2; dimension of the resulting square Matrix cpt - (optional) equation of the form compact=true or false; selects the compact form of the output options - (optional); constructor options for the result object

Description

 • The GivensRotationMatrix(V, i, j) function constructs the square Matrix of a Givens rotation.
 • If G := GivensRotationMatrix(V, i, j) and n is the dimension of V, then G is an n x n Matrix with G[i, i] = G[j, j] = V[i] / (V[i]^2 + V[j]^2)^(1/2), G[i, j] = -G[j, i] = V[j] / (V[i]^2 + V[j]^2)^(1/2), G[m, m] = 1 if m <> i and m <> j, and G[m, n] = 0 otherwise.
 • The GivensRotationMatrix(V, i, j, d) function acts like GivensRotationMatrix(V, i, j) except that a d x d Matrix is returned.
 • If the compact option (cpt) is included in the calling sequence as just the symbol compact or in the form compact=true, then the result is built by using a shape function designed to minimize storage.  If the option is omitted or entered as compact=false, a full rectangular Matrix is constructed.  Generally, if space is not a consideration, the full rectangular form (the default) is more efficient.
 Note:  If the compact form is selected, any datatype specification in the constructor options is silently ignored.  The datatype of any data retrieved from the constructed Matrix is determined by the data used to build the Matrix.
 • The constructor options provide additional information (readonly, shape, storage, order, datatype, and attributes) to the Matrix constructor that builds the result. These options may also be provided in the form outputoptions=[...], where [...] represents a Maple list.  If a constructor option is provided in both the calling sequence directly and in an outputoptions option, the latter takes precedence (regardless of the order).
 • This function is part of the LinearAlgebra package, and so it can be used in the form GivensRotationMatrix(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[GivensRotationMatrix](..).

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $V≔⟨1,2,3,4⟩$
 ${V}{≔}\left[\begin{array}{c}{1}\\ {2}\\ {3}\\ {4}\end{array}\right]$ (1)
 > $M≔\mathrm{GivensRotationMatrix}\left(V,1,3\right)$
 ${M}{≔}\left[\begin{array}{cccc}\frac{\sqrt{{10}}}{{10}}& {0}& \frac{{3}{}\sqrt{{10}}}{{10}}& {0}\\ {0}& {1}& {0}& {0}\\ {-}\frac{{3}{}\sqrt{{10}}}{{10}}& {0}& \frac{\sqrt{{10}}}{{10}}& {0}\\ {0}& {0}& {0}& {1}\end{array}\right]$ (2)
 > $M·V$
 $\left[\begin{array}{c}\sqrt{{10}}\\ {2}\\ {0}\\ {4}\end{array}\right]$ (3)
 > $N≔\mathrm{GivensRotationMatrix}\left(V,4,-2,6\right)$
 ${N}{≔}\left[\begin{array}{cccccc}{1}& {0}& {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}& {0}& {0}\\ {0}& {0}& \frac{{4}}{{5}}& {-}\frac{{3}}{{5}}& {0}& {0}\\ {0}& {0}& \frac{{3}}{{5}}& \frac{{4}}{{5}}& {0}& {0}\\ {0}& {0}& {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {0}& {0}& {1}\end{array}\right]$ (4)
 > $N·\mathrm{Vector}\left(6,V\right)$
 $\left[\begin{array}{c}{1}\\ {2}\\ {0}\\ {5}\\ {0}\\ {0}\end{array}\right]$ (5)