Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16782 > unrolled thread

List vs. array in Mathematica

Started byandymhancock@gmail.com
First post2014-04-12 09:15 +0000
Last post2014-04-13 09:26 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  List vs. array in Mathematica andymhancock@gmail.com - 2014-04-12 09:15 +0000
    Re: List vs. array in Mathematica Richard Fateman <fateman@cs.berkeley.edu> - 2014-04-13 09:26 +0000

#16782 — List vs. array in Mathematica

Fromandymhancock@gmail.com
Date2014-04-12 09:15 +0000
SubjectList vs. array in Mathematica
Message-ID<lib06v$i5p$1@smc.vnet.net>
In mathematica, is an array simply a list of uniform depth?  Both terms are used in the documentation, but I haven't run across an explicit explanation of why two terms are needed for the same construct.  So I'm wondering if their relationship is.

[toc] | [next] | [standalone]


#16794

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2014-04-13 09:26 +0000
Message-ID<lidl8s$k3$1@smc.vnet.net>
In reply to#16782
On 4/12/2014 2:15 AM, andymhancock@gmail.com wrote:
> In mathematica, is an array simply a list of uniform depth?
No. An Array is a List. For example,

z=  Array[f,4]   returns{f[1],f[2],f[3],f[4]}
Head[z]  returns List
z[[2]]={1,{2,3}}

is perfectly legal.

Note, there is a program Array[ ]  which can be used to initially
construct Lists.
  Both
> terms are used in the documentation, but I haven't run across an
> explicit explanation of why two terms are needed for the same
> construct.

They aren't.  The term "array" is used in computer science and 
conventional programming languages for a different data structure
with different storage requirements and different access efficiencies.

   So I'm wondering if their relationship is.
>

Their relationship with respect to Mathematica is:  the proprietors
of the program define arrays as lists, ignoring conventions in computer
science.  One can speculate as to why.
See http://en.wikipedia.org/wiki/Hanlon%27s_razor

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web