2019-07-15 11:59:08 -04:00
|
|
|
% -*- root: main.tex -*-
|
2019-07-24 09:00:08 -04:00
|
|
|
\section{Algorithms}
|
|
|
|
\label{sec:algorithms}
|
2019-07-15 11:59:08 -04:00
|
|
|
|
|
|
|
\subsection{Algorithm for $\gIJ$}
|
|
|
|
\begin{algorithmic}
|
2019-07-19 10:41:14 -04:00
|
|
|
\ForAll{$\wVec \in \pw$}
|
|
|
|
\If{$\sketchHashParam{\wVec} = \buck$}
|
2019-07-24 09:00:08 -04:00
|
|
|
%\If{$\sketchPolarParam{\wVec} = 1$}
|
2019-07-24 09:19:05 -04:00
|
|
|
\State $\polSum \mathrel{+}=\sketchPolarParam{\wVec}$%+= 1$
|
2019-07-24 09:00:08 -04:00
|
|
|
%\Else
|
|
|
|
% \State $\gIJ -= 1$
|
|
|
|
%\EndIf
|
2019-07-19 10:41:14 -04:00
|
|
|
\EndIf
|
|
|
|
\EndFor.
|
2019-07-15 15:37:20 -04:00
|
|
|
\end{algorithmic}
|
2019-07-19 10:41:14 -04:00
|
|
|
%Non-general algorithm
|
|
|
|
%\begin{algorithmic}
|
|
|
|
%\If {$\matrixH' \cdot \wVec = j^{(0)}$ is consistent}
|
|
|
|
% \If {$\matrixH' \cdot \wVec = j^{(1)}$ is consistent}
|
|
|
|
% \State $\gIJ = 0$
|
|
|
|
% \Else
|
|
|
|
% \State $\gIJ = 2^{\numTup - computeRank(\matrixH')}$
|
|
|
|
% \EndIf
|
|
|
|
%\ElsIf{$\matrixH' \cdot \wVec = \buck^{(1)}$ is consistent}
|
|
|
|
% \State $\gIJ = 2^{\numTup - computeRank(\matrixH')}$
|
|
|
|
%\Else
|
|
|
|
% \State $\gIJ = 0$
|
|
|
|
%\EndIf.
|
|
|
|
%\end{algorithmic}
|
2019-07-24 09:00:08 -04:00
|
|
|
|
2019-07-15 15:37:20 -04:00
|
|
|
|
2019-07-16 10:42:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\subsection{Algorithm for Initialization}
|
|
|
|
\begin{algorithmic}
|
2019-07-19 10:41:14 -04:00
|
|
|
\ForAll{$\wVec \in \pw \st \kMapParam{\wVec} = 1$}
|
|
|
|
\State $\sketchJParam{\sketchHashParam{\wVec}} = \sketchPolarParam{\wVec}$
|
2019-07-16 10:42:17 -04:00
|
|
|
\EndFor.
|
2019-07-19 10:41:14 -04:00
|
|
|
\end{algorithmic}
|
|
|
|
%Non-generic Algorithm
|
|
|
|
%\begin{algorithmic}
|
|
|
|
%\ForAll{$\wVec \st \kMapParam{\wVec} = 1$}
|
|
|
|
% \State $\buck = \matrixH' \cdot \wVec$
|
|
|
|
% \If{$\buck(\lenB) = 0$}
|
|
|
|
% \State $\sketchIj += 1$
|
|
|
|
% \Else
|
|
|
|
% \State$\sketchIj -= 1$
|
|
|
|
% \EndIf
|
|
|
|
%\EndFor.
|
|
|
|
%\end{algorithmic}
|