<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <!--Converted with LaTeX2HTML 96.1-f (May 31, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds --> <HTML> <HEAD> <TITLE>List/Set, Table/Array/Vector/Matrix</TITLE> <META NAME="description" CONTENT="List/Set, Table/Array/Vector/Matrix"> <META NAME="keywords" CONTENT="notes"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <LINK REL=STYLESHEET HREF="notes.css"> </HEAD> <BODY LANG="EN">  <A NAME="tex2html257" HREF="node8.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="http://www.ircam.fr/equipes/analyse-synthese/tassart/icons/latex2html/next_motif.gif"></A> <A NAME="tex2html255" HREF="node2.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="http://www.ircam.fr/equipes/analyse-synthese/tassart/icons/latex2html/up_motif.gif"></A> <A NAME="tex2html251" HREF="node6.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="http://www.ircam.fr/equipes/analyse-synthese/tassart/icons/latex2html/previous_motif.gif"></A> <A NAME="tex2html259" HREF="node31.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="http://www.ircam.fr/equipes/analyse-synthese/tassart/icons/latex2html/contents_motif.gif"></A> <A NAME="tex2html260" HREF="node30.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="http://www.ircam.fr/equipes/analyse-synthese/tassart/icons/latex2html/index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html258" HREF="node8.html">L'interface</A> <B>Up:</B> <A NAME="tex2html256" HREF="node2.html">Les structures de donn&#233;es</A> <B> Previous:</B> <A NAME="tex2html252" HREF="node6.html">Petit exemple</A> <BR> <P> <H2><A NAME="SECTION00025000000000000000">List/Set, Table/Array/Vector/Matrix</A></H2> <P> <H3><A NAME="SECTION00025100000000000000">List vs. Set</A></H3> <P> <A NAME="124">&#160;</A> <A NAME="125">&#160;</A> <A NAME="126">&#160;</A> <UL> <LI>[]: une liste est une collection ordonn&#233;e d'&#233;l&#233;ments. La liste vide est <code>[]</code>. <PRE>      c := [4,23,6];       a := [ op(c), op(c)];</PRE> <LI> Une valeur <code>[[4,3],[2,8]]</code> est &#233;galement du type <code>listlist</code>. <LI>{}: un ensemble est une collection qui ne retient ni l'ordre ni la multiplicit&#233; des &#233;l&#233;ments. L'ensemble vide est {}. <PRE>      evalb({op(c),op(c)} = {op(c)})  -&gt; true</PRE> <LI> <A NAME="130">&#160;</A> <A NAME="131">&#160;</A> <A NAME="132">&#160;</A> les ensembles sont manipul&#233;s par un certain nombre de fonctions telles que <code>union</code>, <code>intersect</code> ou <code>minus</code>. <P> </UL><H3><A NAME="SECTION00025200000000000000">Table vs. Array vs. Matrix vs. Vector</A></H3> <P> <A NAME="matrix_table">&#160;</A> <A NAME="136">&#160;</A> <A NAME="137">&#160;</A> <A NAME="138">&#160;</A> <A NAME="139">&#160;</A> <UL> <LI> Une table est un tableau associatif. <PRE>     COLORS[bleu] := {bleu, blue, blau};      COLORS[rouge] := {rouge, red, rot};      print(COLORS)         table([              bleu  = {bleu, blue, blau},              rouge = {rouge, red, rot}               ]);      for c in entries(COLORS) do print(c) od;</PRE> <LI> Un tableau est une table dont les index sont des entiers. <LI> Une matrice est un tableau avec 2 index. <LI> Un vecteur est un tableau avec 1 index. <LI> On peut convertir les matrices en listes de liste. </UL><BR> <HR> <P><ADDRESS> <I>Stephan Tassart <BR> Fri Feb  7 19:05:53 MET 1997</I> </ADDRESS> </BODY> </HTML> 
