# [Tex/LaTex] Algorithmcx and array representation

algorithmicxarrays

I'm using package algorithmcx and algpseudocode to describe an algorithm in a paper.
Each function in the algorithm receive an array/list of numerical values, e.g. {x1, x2, ..., xn}.

\documentclass{article}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}

\begin{document}

\begin{algorithm}
\begin{algorithmic}

\Statex
\Function{FUN\_NAME}{$\{x_i^j \,|\, i \in A, j \in B \}$}
....
\EndFunction%
\end{algorithmic}
\end{algorithm}

\end{document}


I don't know if the list of values/variables is represented in the right way.

I've got a look through the Web to see if there was such an accepted convention for representing an array, but I didn't find any example.

How can I represent them?

• brackets (...) : in mathematics, that's the usual way to represent vectors through a coordinate list. Also, together with the square brackets below, it is an accepted notation for matrices. Both vectors and matrices are commonly represented as arrays when it comes to algorithms. On the other hand, they are also sometimes used to denote tuples, which have nothing to do with what you want to achieve;
• square brackets [...] : there are many programming languages in which arrays (or lists) are represented with square brackets. Also, the same argument as above for matrices applies;
• braces \{....\} : you should be careful with those. The usual mathematical meaning conveyed by braces is that they denote a set of element, that is a "pack of unordered elements". However, lists are a common way to represent such data structures in programming languages.