groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generic Givens Rotation Matrix in EQN


From: Tadziu Hoffmann
Subject: Re: Generic Givens Rotation Matrix in EQN
Date: Mon, 1 Mar 2021 01:02:47 +0100
User-agent: Mutt/1.11.4 (2019-03-13)

> Would anybody have a version of this in EQN. I do not mean the
> simple 2x2 matrix but the generic nxn square matrix

This is fairly straightforward with a few suitable eqn
definitions to simplify entering the equation.  The attached
PDF was created with the following code and my own paragraph
and section macros.  (Use "left [" and "right ]" instead of
my bracket macro if you want to use the equation with some
other macro package.)  Note that since I've entered the matrix
column-wise it appears transposed in the text editor display.

  $
  define ...   % roman " . . . " %
  define vdots % roman "\v'-.6m'\z.\v'.5m'\z.\v'.5m'.\v'-.4m'" %
  define ddots % roman "\v'-.6m' .\v'.5m' .\v'.5m' .\v'-.4m' " %
  define Gjj % G sub back 30 jj %
  define Gji % G sub back 30 ji %
  define Gii % G sub back 10 ii %
  define Gij % G sub back 10 ij %
  define Gkk % G sub back 10 kk %
  define | % above %
  $
  .SE
  Givens rotations
  .PP
  A Givens rotation is represented by a matrix of the form
  .EQ
  set column_sep 20
  G ( i, j, theta ) =
  bracket { matrix {
  ccol { 1   | vdots | 0   | vdots | 0   | vdots | 0   }
  ccol { ... | ddots | ... | ""    | ... | ""    | ... }
  ccol { 0   | vdots | c   | vdots | s   | vdots | 0   }
  ccol { ... | ""    | ... | ddots | ... | ""    | ... }
  ccol { 0   | vdots | -s  | vdots | c   | vdots | 0   }
  ccol { ... | ""    | ... | ""    | ... | ddots | ... }
  ccol { 0   | vdots | 0   | vdots | 0   | vdots | 1   }
  } } ,
  .EN
  which is, when $i > j$,
  .EQ
  set column_sep 100
  Gkk = 1 roman "  for  " k != i, j , fwd 100
  Gii =   Gjj =   cos ( theta )     , fwd 100
  Gji = - Gij = - sin ( theta ) .
  .EN
  (See https://en.wikipedia.org/wiki/Givens_rotation.)


Attachment: givensrotation.pdf
Description: Adobe PDF document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]