3
$\begingroup$

Is there a generally accepted formal notation for denoting the number of columns a matrix has (e.g to use in pseudocode/algorithm environment in LaTeX)? Something I could use in the description of an algorithm like:

if horizontaldim(V) > x then
end if

or

if size(V,2) > x then 
end if

or should I just use a description like

if number of columns in V > x then
end if
$\endgroup$
1
  • $\begingroup$ I've got the case where I need the number of rows and columns of several matrices quite often in one figure. Furthermore, I don't have much space for operator names like rows and cols. Sometimes $\#$ is used for the number of elements of a set. Applied to a matrix it could also denote the number of elements. What elements? One could adopt the syntax of the size-operator and write $\#_1 V$ for the number of rows and $\#_2 V$ for the number of columns. This notation would also work for multi-dimensional arrays with $\#_i V$ where $i$ is the index position. In the matrix case $i=1$ or $2$. $\endgroup$
    – Tobias
    Jul 13, 2017 at 19:51

1 Answer 1

5
$\begingroup$

None that I know of, but I've seen numerical linear algebra books (e.g. Golub and Van Loan) just say something like $V\in\mathbb{R}^{m\times n}$ for a matrix V with m rows and n columns, and then use m and n in the following algorithm description.

MATLAB notation, which some other people use, just says rows(V) and columns(V).

$\endgroup$
1
  • 2
    $\begingroup$ Might be obvious, but for completeness' sake: if V is a complex matrix, then it should be $V\in\mathbb{C}^{m\times n}$ . $\endgroup$ Aug 15, 2010 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.