1
0
Fork 0

Adde confidence calculation and display to Annex II

master
Mike Gerwitz 2013-08-15 09:41:25 -04:00
parent 46e7db85e6
commit 79e02c44f9
1 changed files with 20 additions and 1 deletions

View File

@ -47,12 +47,13 @@
\newlength\@@subtaskcl \newlength\@@subtaskcl
\newcount\@@hmin \newcount\@@hmax \newcount\@@hdiff \newcount\@@hconf
\newenvironment{@task}[1][]% \newenvironment{@task}[1][]%
{% {%
\def\@@h{#1}% \def\@@h{#1}%
\goodbreak\leavevmode\@margin@sig \goodbreak\leavevmode\@margin@sig
\llap{% \llap{%
\raisebox{-\baselineskip}[0em][0em]{% \raisebox{-1.8\baselineskip}[0em][0em]{%
\shortstack{% \shortstack{%
{\sc\taskname}\space\thesubtaskc {\sc\taskname}\space\thesubtaskc
\\ \\
@ -60,6 +61,12 @@
\ifx\@@h\empty\else \ifx\@@h\empty\else
{\small\@task@h#1||\,h}% {\small\@task@h#1||\,h}%
\fi% \fi%
\\
\vphantom{M}%
\ifx\@@h\empty\else
\@task@setregs#1||%
{\scriptsize \the\@@hconf\% Confidence}%
\fi%
}% }%
\hspace{\the\taskspace}% \hspace{\the\taskspace}%
% adjust width of the subtask text so that the task number lines up % adjust width of the subtask text so that the task number lines up
@ -73,3 +80,15 @@
\def\@task@h#1-#2||{#1--#2} \def\@task@h#1-#2||{#1--#2}
\def\@task@setregs#1-#2||{%
\@@hmin#1\relax
\@@hmax#2\relax
% perform calculation (be sure to multiply by 100 before dividing, otherwise
% we lose everything through integer truncation); the calculation is:
% 100 - ((|N-M|/M)*100)
\@@hdiff#2\relax \advance\@@hdiff-#1\relax
\@@hconf\@@hdiff
\multiply\@@hconf by 100\relax
\divide\@@hconf by-\@@hmax
\advance\@@hconf by 100\relax
}