0
$\begingroup$

If I have an array a of arrays, in many languages they may have different size. Is there a word for an array of arrays where all the arrays have the same length?

Edit: An array of arrays may have the following form:

[ 
  [ 1, 2, 3 ]
  [ 1, 2, 3, 4 ]
  [ 1, 2 ]
]

But in order to convert this to a matrix you would have to assume some default value or trim the arrays. The following array of arrays is possible to convert into a matrix without any asumptions or trimming as all arrays have same length.

[ 
  [ 1, 2, 3, 4 ]
  [ 1, 2, 3, 4 ]
  [ 1, 2, 3, 4 ]
]

Is there some name or classifier for a matrix of this kind?

$\endgroup$
6
  • $\begingroup$ please clearly define your problem. $\endgroup$
    – WaQaR Ali
    Aug 12, 2015 at 10:21
  • 5
    $\begingroup$ a matrix, a table? $\endgroup$
    – A.Schulz
    Aug 12, 2015 at 10:34
  • $\begingroup$ I'm simply wondering if there is a classifier or name for an array of arrays where all the contained arrays are of same length. In for instance C# one may have an array of arrays, and each of the contained arrays may have a different size. An array like that would be possible to convert into a matrix without assuming some default value, but would still be different from a matrix. $\endgroup$
    – tba
    Aug 12, 2015 at 11:24
  • 1
    $\begingroup$ An array of arrays is just, surprise, "an array of arrays". You may also call it a multidimensional array. We cannot make up names for everything, and when a simple expression will do, why bother. How do you call a man who is tall, with curly hair and blue pants? There are probably millions, but no special name. Actually, we create names for new structure with specific properties. It is not really needed in your case. ... Unlike you enjoy reading names of molecules, which can fill a whole line (but there is a reason in that case). $\endgroup$
    – babou
    Aug 12, 2015 at 12:48
  • $\begingroup$ @babou but s/he doesn't need simple "an array of arrays" but "an array of arrays called when all arrays have the same size" $\endgroup$ Sep 5, 2015 at 22:26

4 Answers 4

5
$\begingroup$

In C# world there are 2 kinds of array declarations, and 2 names for it:

  1. Jagged:
[ 
  [ 1, 2, 3 ]
  [ 1, 2, 3, 4 ]
  [ 1, 2 ]
]
  1. Rectangular:
[ 
  [ 1, 2, 3, 4 ]
  [ 1, 2, 3, 4 ]
  [ 1, 2, 4, 4 ]
]
$\endgroup$
1
$\begingroup$

An array of arrays, also known as a multi dimensional array :-)

A Matrix is only one of the structures that can be represented by such an array, when all first level elements are of the same size.

$\endgroup$
0
$\begingroup$

I don't think there is a term for this (a "multidimensional array" may or may not be the same thing) but I'm familiar with a term for the opposite: a "ragged array".

$\endgroup$
0
$\begingroup$

I believe "rectangular array" is the most common term and one people aren't likely to misunderstand.

$\endgroup$
1
  • $\begingroup$ It might be three-dimensional, or even more... and that's not a "rectangle" anymore. $\endgroup$
    – vonbrand
    Aug 12, 2015 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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