1,算法原理
挖个坑
备忘
2,算法
Latex 代码,备忘,忽略;
\documentclass{article}
\usepackage[ruled]{algorithm2e} %style 1
%\usepackage[ruled,vlined]{algorithm2e} %style 2
%\usepackage[linesnumbered,boxed]{algorithm2e} %style 3
\title{Householder transformation WY-YT representation}
\begin{document}
\maketitle
\begin{algorithm}[H]
%\SetAlgoNoLine
\caption{QR decomposation with YT representation}
\KwIn{$\mathbf{A, m, n}, \ where\ m >= n$}
\For{$(j=1; <=n; j++)$}
{
$[\beta, \mathbf{v}_j]=house(\mathbf{A}(i:m, j))$\\$ $\\
$N = \parallel \mathbf{v}_j \parallel_2$\\$ $\\
$\mathbf{Y}(:,j)=\mathbf{v}_j/N$\\$ $\\
\eIf{$j==1$}{
$\mathbf{T}(1:n,1:n) = -2*\mathbf{I}_n$\\$ $\\
}
{
$\mathbf{z}_j=-2*\mathbf{T}_{j-1}\mathbf{Y}_{j-1}^T\mathbf{v}_j/N$\\
$ $\\
$\mathbf{T}_j=
\left[
\begin{array}{cc}
\mathbf{T}_{j-1}&\mathbf{z}_j\\
0 & -2 \\
\end{array}
\right]$\\$ $\\
}
$ $\\
$\mathbf{A}(j:m, j:n)=(\mathbf{I}-\beta \mathbf{v v^T}) \mathbf{A}(j:m,j:n)$\\
$ $\\
\If{$j < n$}{
$\mathbf{A}(j+1:m, j) = \mathbf{v}(2:m-j+1)$\\
}$ $\\
}
\end{algorithm}
\end{document}