LinearAlgebra
GivensRotationMatrix
construct the Matrix for a Givens rotation
Calling Sequence
Parameters
Description
Examples
GivensRotationMatrix(V, i, j, d, cpt, options)
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
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](..).
with⁡LinearAlgebra:
V≔1,2,3,4
V≔1234
M≔GivensRotationMatrix⁡V,1,3
M≔101003⁢101000100−3⁢10100101000001
M·V
10204
N≔GivensRotationMatrix⁡V,4,−2,6
N≔1000000100000045−350000354500000010000001
N·Vector⁡6,V
120500
See Also
LinearAlgebra[HouseholderMatrix]
LinearAlgebra[MatrixVectorMultiply]
Vector
Download Help Document