paper-BagRelationalPDBsAreHard/exact.tex

52 lines
1.2 KiB
TeX

% -*- root: main.tex -*-
\section{Algorithms}
\label{sec:algorithms}
\subsection{Algorithm for $\gIJ$}
\begin{algorithmic}
\ForAll{$\wVec \in \pw$}
\If{$\hashP{\wVec} = \buck$}
%\If{$\polP{\wVec} = 1$}
\State $\polSum \mathrel{+}=\polP{\wVec}$%+= 1$
%\Else
% \State $\gIJ -= 1$
%\EndIf
\EndIf
\EndFor.
\end{algorithmic}
%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}
\subsection{Algorithm for Initialization}
\begin{algorithmic}
\ForAll{$\wVec \in \pw \st \kMapParam{\wVec} = 1$}
\State $\sketchJParam{\hashP{\wVec}} = \polP{\wVec}$
\EndFor.
\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}