/usr/share/doc/racket/math/array.html is in racket-doc 6.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>6 Arrays</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Math Library</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="base.html" class="tocviewlink" data-pltdoc="x">Constants and Elementary Functions</a></td></tr><tr><td align="right">2 </td><td><a href="flonum.html" class="tocviewlink" data-pltdoc="x">Flonums</a></td></tr><tr><td align="right">3 </td><td><a href="special.html" class="tocviewlink" data-pltdoc="x">Special Functions</a></td></tr><tr><td align="right">4 </td><td><a href="number-theory.html" class="tocviewlink" data-pltdoc="x">Number Theory</a></td></tr><tr><td align="right">5 </td><td><a href="bigfloat.html" class="tocviewlink" data-pltdoc="x">Arbitrary-<wbr></wbr>Precision Floating-<wbr></wbr>Point Numbers (<a name="(tech._bigfloat)"></a><span style="font-style: italic">Bigfloats</span>)</a></td></tr><tr><td align="right">6 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Arrays</a></td></tr><tr><td align="right">7 </td><td><a href="matrices.html" class="tocviewlink" data-pltdoc="x">Matrices and Linear Algebra</a></td></tr><tr><td align="right">8 </td><td><a href="stats.html" class="tocviewlink" data-pltdoc="x">Statistics Functions</a></td></tr><tr><td align="right">9 </td><td><a href="dist.html" class="tocviewlink" data-pltdoc="x">Probability Distributions</a></td></tr><tr><td align="right">10 </td><td><a href="utils.html" class="tocviewlink" data-pltdoc="x">Stuff That Doesn’t Belong Anywhere Else</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">▼</a></td><td>6 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Arrays</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">6.1 </td><td><a href="array_quick.html" class="tocviewlink" data-pltdoc="x">Quick Start</a></td></tr><tr><td align="right">6.2 </td><td><a href="array_defs.html" class="tocviewlink" data-pltdoc="x">Definitions</a></td></tr><tr><td align="right">6.3 </td><td><a href="array_broadcasting.html" class="tocviewlink" data-pltdoc="x">Broadcasting</a></td></tr><tr><td align="right">6.4 </td><td><a href="array_slicing.html" class="tocviewlink" data-pltdoc="x">Slicing</a></td></tr><tr><td align="right">6.5 </td><td><a href="array_nonstrict.html" class="tocviewlink" data-pltdoc="x">Nonstrict Arrays</a></td></tr><tr><td align="right">6.6 </td><td><a href="array_types.html" class="tocviewlink" data-pltdoc="x">Types, Predicates and Accessors</a></td></tr><tr><td align="right">6.7 </td><td><a href="array_construct.html" class="tocviewlink" data-pltdoc="x">Construction</a></td></tr><tr><td align="right">6.8 </td><td><a href="array_convert.html" class="tocviewlink" data-pltdoc="x">Conversion</a></td></tr><tr><td align="right">6.9 </td><td><a href="array_sequences.html" class="tocviewlink" data-pltdoc="x">Comprehensions and Sequences</a></td></tr><tr><td align="right">6.10 </td><td><a href="array_pointwise.html" class="tocviewlink" data-pltdoc="x">Pointwise Operations</a></td></tr><tr><td align="right">6.11 </td><td><a href="array_indexing.html" class="tocviewlink" data-pltdoc="x">Indexing and Slicing</a></td></tr><tr><td align="right">6.12 </td><td><a href="array_transform.html" class="tocviewlink" data-pltdoc="x">Transformations</a></td></tr><tr><td align="right">6.13 </td><td><a href="array_fold.html" class="tocviewlink" data-pltdoc="x">Folds, Reductions and Expansions</a></td></tr><tr><td align="right">6.14 </td><td><a href="array_other.html" class="tocviewlink" data-pltdoc="x">Other Array Operations</a></td></tr><tr><td align="right">6.15 </td><td><a href="array_subtypes.html" class="tocviewlink" data-pltdoc="x">Subtypes</a></td></tr><tr><td align="right">6.16 </td><td><a href="array_strict.html" class="tocviewlink" data-pltdoc="x">Strictness</a></td></tr></table></div></div></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.7</span></div><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="bigfloat.html" title="backward to "5 Arbitrary-Precision Floating-Point Numbers (Bigfloats)"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Math Library"" data-pltdoc="x">up</a> <a href="array_quick.html" title="forward to "6.1 Quick Start"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "math/scribblings/math.scrbl")" x-source-pkg="math-doc" x-part-tag=""array"">6<tt> </tt><a name="(part._array)"></a><a name="(mod-path._math/array)"></a>Arrays</h3><div class="SAuthorListBox"><span class="SAuthorList"><p class="author">Neil Toronto <<a href="mailto:ntoronto@racket-lang.org">ntoronto@racket-lang.org</a>></p></span></div><p><span style="font-weight: bold">Performance Warning:</span> Indexing the elements of arrays created in untyped Racket
is currently 25-50 times slower than doing the same in Typed Racket, due to the overhead
of checking higher-order contracts. We are working on it.</p><p>For now, if you need speed, use the <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=index.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">typed/racket</span></a> language.</p><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">math/array</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">math-lib</span></span></td></tr></table></p><p>One of the most common ways to structure data is with an array: a rectangular grid of
homogeneous, independent elements. But an array data type
is usually absent from functional languages’ libraries. This is probably because arrays
are perceived as requiring users to operate on them using destructive updates, write
loops that micromanage array elements, and in general, stray far from the declarative
ideal.</p><p>Normally, they do. However, experience in Python, and more recently Data-Parallel Haskell,
has shown that providing the right data types and a rich collection of whole-array operations
allows working effectively with arrays in a functional, declarative style. As a bonus,
doing so opens the possibility of parallelizing nearly every operation.</p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><a href="array_quick.html" class="toclink" data-pltdoc="x">6.1<span class="hspace"> </span>Quick Start</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_defs.html" class="toclink" data-pltdoc="x">6.2<span class="hspace"> </span>Definitions</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_broadcasting.html" class="toclink" data-pltdoc="x">6.3<span class="hspace"> </span>Broadcasting</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_broadcasting.html#%28part._array~3abroadcasting~3arules%29" class="toclink" data-pltdoc="x">6.3.1<span class="hspace"> </span>Broadcasting Rules</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_broadcasting.html#%28part._array~3abroadcasting~3acontrol%29" class="toclink" data-pltdoc="x">6.3.2<span class="hspace"> </span>Broadcasting Control</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_slicing.html" class="toclink" data-pltdoc="x">6.4<span class="hspace"> </span>Slicing</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_slicing.html#%28part.__.Sequenceof_.Integer___pick_rows%29" class="toclink" data-pltdoc="x">6.4.1<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><span class="RktStxLink">Sequenceof</span></span><span class="stt"> </span><span class="RktSym"><span class="RktStxLink">Integer</span></span><span class="RktPn">)</span>: pick rows</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_slicing.html#%28part._.Slice__pick_rows_in_a_length-aware_way%29" class="toclink" data-pltdoc="x">6.4.2<span class="hspace"> </span><span class="RktSym"><span class="RktStxLink">Slice</span></span>: pick rows in a length-aware way</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_slicing.html#%28part._.Slice-.Dots__preserve_remaining_axes%29" class="toclink" data-pltdoc="x">6.4.3<span class="hspace"> </span><span class="RktSym"><span class="RktStxLink">Slice-Dots</span></span>: preserve remaining axes</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_slicing.html#%28part._.Integer__remove_an_axis%29" class="toclink" data-pltdoc="x">6.4.4<span class="hspace"> </span><span class="RktSym"><span class="RktStxLink">Integer</span></span>: remove an axis</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_slicing.html#%28part._.Slice-.New-.Axis__add_an_axis%29" class="toclink" data-pltdoc="x">6.4.5<span class="hspace"> </span><span class="RktSym"><span class="RktStxLink">Slice-New-Axis</span></span>: add an axis</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_nonstrict.html" class="toclink" data-pltdoc="x">6.5<span class="hspace"> </span>Nonstrict Arrays</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_nonstrict.html#%28part._.Caching_.Nonstrict_.Elements%29" class="toclink" data-pltdoc="x">6.5.1<span class="hspace"> </span>Caching Nonstrict Elements</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_nonstrict.html#%28part._.Performance_.Considerations%29" class="toclink" data-pltdoc="x">6.5.2<span class="hspace"> </span>Performance Considerations</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_types.html" class="toclink" data-pltdoc="x">6.6<span class="hspace"> </span>Types, Predicates and Accessors</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_construct.html" class="toclink" data-pltdoc="x">6.7<span class="hspace"> </span>Construction</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_convert.html" class="toclink" data-pltdoc="x">6.8<span class="hspace"> </span>Conversion</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_convert.html#%28part._array~3aprint%29" class="toclink" data-pltdoc="x">6.8.1<span class="hspace"> </span>Printing</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_sequences.html" class="toclink" data-pltdoc="x">6.9<span class="hspace"> </span>Comprehensions and Sequences</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_pointwise.html" class="toclink" data-pltdoc="x">6.10<span class="hspace"> </span>Pointwise Operations</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_pointwise.html#%28part._.Broadcasting%29" class="toclink" data-pltdoc="x">6.10.1<span class="hspace"> </span>Broadcasting</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_indexing.html" class="toclink" data-pltdoc="x">6.11<span class="hspace"> </span>Indexing and Slicing</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_transform.html" class="toclink" data-pltdoc="x">6.12<span class="hspace"> </span>Transformations</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_fold.html" class="toclink" data-pltdoc="x">6.13<span class="hspace"> </span>Folds, Reductions and Expansions</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_fold.html#%28part._.Axis_.Folds%29" class="toclink" data-pltdoc="x">6.13.1<span class="hspace"> </span>Axis Folds</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_fold.html#%28part._.Whole-.Array_.Folds%29" class="toclink" data-pltdoc="x">6.13.2<span class="hspace"> </span>Whole-Array Folds</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_fold.html#%28part._.General_.Reductions_and_.Expansions%29" class="toclink" data-pltdoc="x">6.13.3<span class="hspace"> </span>General Reductions and Expansions</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_other.html" class="toclink" data-pltdoc="x">6.14<span class="hspace"> </span>Other Array Operations</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_other.html#%28part._.Fast_.Fourier_.Transform%29" class="toclink" data-pltdoc="x">6.14.1<span class="hspace"> </span>Fast Fourier Transform</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_subtypes.html" class="toclink" data-pltdoc="x">6.15<span class="hspace"> </span>Subtypes</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_subtypes.html#%28part._flarray%29" class="toclink" data-pltdoc="x">6.15.1<span class="hspace"> </span>Flonum Arrays</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_subtypes.html#%28part._fcarray%29" class="toclink" data-pltdoc="x">6.15.2<span class="hspace"> </span>Float-Complex Arrays</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="array_strict.html" class="toclink" data-pltdoc="x">6.16<span class="hspace"> </span>Strictness</a></p></td></tr></table><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="bigfloat.html" title="backward to "5 Arbitrary-Precision Floating-Point Numbers (Bigfloats)"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Math Library"" data-pltdoc="x">up</a> <a href="array_quick.html" title="forward to "6.1 Quick Start"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|