Почему в моем псевдокоде в формате IEEE Access вместо фраз «input» и «output» появляются «Require» и «Ensure»?

Почему в моем псевдокоде в формате IEEE Access вместо фраз «input» и «output» появляются «Require» и «Ensure»?

Когда я написал следующий псевдокод в формате \documentclass{article}, я получил фразы "Input" и "Output" после компиляции, но когда я написал тот же код latex в шаблоне IEEE Access, я получил операторы "Require" и "Ensure" как есть, после компиляции. Я думаю, что в первом случае формат статьи каким-то образом преобразует фразы "Require" и "Ensure" в "Input" и "Output", но в формате IEEE Access это преобразование не выполняется.

Может кто-нибудь объяснить мне, как исправить эту проблему? Я бы хотел видеть "Input" и "Output" вместо "Require" и "Ensure" после компиляции.

\documentclass{ieeeaccess}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage[section]{placeins}
\usepackage{algorithm}
 \usepackage{algpseudocode}
 \usepackage{algorithmicx}
 \algdef{SE}[DOWHILE]{Do}{doWhile}{\algorithmicdo}[1]{\algorithmicwhile\ #1}%

\begin{document}
\begin{algorithm}[H]    
    \caption{Algorithm 1}\label{Alg-Decap}
    \begin{algorithmic}[1]
        \Require{$(C,S_k)$}
        \Ensure{ HashSession$(1,\underbar r,C)$ or HashSession$(0,\rho,C))$ }
        \State $c\leftarrow$ Decode$(\underbar c)$  
        \State $c.(3f)\in\mathcal{R}/q$
        \State $e\leftarrow $ (Rounded$(c.(3f))$ mod 3) $\in \mathcal{R}/3$
        \State $e.(1/g)\in\mathcal{R}/3$
        \State $r'\leftarrow$ Lift($e.(1/g)$) $\in\mathcal{R}/q$
        \State $h.r'\in\mathcal{R}/q$
        \State $c'\leftarrow$ Round$(h.r')$
        \State  $\underbar c'\leftarrow$ Encode$(c')$
        \State $C'\leftarrow(\underbar c',$ HashConfirm$(\underbar r',\underbar h))$
        \If{$C'==C$}
        \State \textbf{return} HashSession$(1,\underbar r,C)$
        \Else
        \State \textbf{ return} HashSession$(0,\rho,C))$
        \EndIf
    \end{algorithmic}
\end{algorithm}
\end{document}

решение1

Вы можете сопоставить «Требовать» с «Входом» и «Гарантировать» с «Выходом», используя следующие настройки:

\algrenewcommand\algorithmicrequire{\textbf{Input:}}
\algrenewcommand\algorithmicensure{\textbf{Output:}}

Таким образом, в вашем случае полный код будет выглядеть так:

\documentclass{ieeeaccess}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage[section]{placeins}
\usepackage{algorithm}
 \usepackage{algpseudocode}
 \usepackage{algorithmicx}
 \algdef{SE}[DOWHILE]{Do}{doWhile}{\algorithmicdo}[1]{\algorithmicwhile\ #1}%

\algrenewcommand\algorithmicrequire{\textbf{Input:}}
\algrenewcommand\algorithmicensure{\textbf{Output:}}

\begin{document}
\begin{algorithm}[H]    
    \caption{Algorithm 1}\label{Alg-Decap}
    \begin{algorithmic}[1]
        \Require{$(C,S_k)$}
        \Ensure{ HashSession$(1,\underbar r,C)$ or HashSession$(0,\rho,C))$ }
        \State $c\leftarrow$ Decode$(\underbar c)$  
        \State $c.(3f)\in\mathcal{R}/q$
        \State $e\leftarrow $ (Rounded$(c.(3f))$ mod 3) $\in \mathcal{R}/3$
        \State $e.(1/g)\in\mathcal{R}/3$
        \State $r'\leftarrow$ Lift($e.(1/g)$) $\in\mathcal{R}/q$
        \State $h.r'\in\mathcal{R}/q$
        \State $c'\leftarrow$ Round$(h.r')$
        \State  $\underbar c'\leftarrow$ Encode$(c')$
        \State $C'\leftarrow(\underbar c',$ HashConfirm$(\underbar r',\underbar h))$
        \If{$C'==C$}
        \State \textbf{return} HashSession$(1,\underbar r,C)$
        \Else
        \State \textbf{ return} HashSession$(0,\rho,C))$
        \EndIf
    \end{algorithmic}
\end{algorithm}
\end{document}

Пример изменения Require, Ensure на Input, Output

Связанный контент