From 2010e8b2897a5741e211980c9f8ec9177299c939 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 16 Jul 2021 18:23:52 -0400 Subject: Finish links and editing documentation pass --- docs/doc/shape.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/doc/shape.html') diff --git a/docs/doc/shape.html b/docs/doc/shape.html index 5852a698..118353c6 100644 --- a/docs/doc/shape.html +++ b/docs/doc/shape.html @@ -8,7 +8,7 @@

The function Shape () returns an array's shape, and Rank (=) and Length () return properties that can be derived from the shape. BQN's arrays are multidimensional, so that the shape is a list of natural numbers (the length along each axis), while the rank (length of the shape) and length (of the first axis) are numbers. In these functions, an atom is treated as a unit array, which has rank 0 and empty shape. A unit has no first axis, but its length is defined to be 1.

Rank can be defined as while Length can be defined with a fold to be 1´.

Examples

-

The function Reshape () always returns an array of shape 𝕨, so we use it to make an array of shape 1326 in the example below (Take () shares this property).

+

The function Reshape () always returns an array of shape 𝕨, so we use it to make an array of shape 1326 in the example below (Take () shares this property if (𝕨)≤=𝕩).

↗️
     arr  1326  '0'+↕10
 ┌─        
 ┆"012345  
@@ -30,11 +30,11 @@
     = arr  # Rank
 4
 
-

The length is the first element of the shape, and the rank is the length of the shape—the number of axes. For another example, taking the first (and only) cell of arr gives an array with shape 326, length 3, and rank 3, as we can see by applying each function to arr.

+

The length is the first element of the shape, and the rank is the length of the shape—the number of axes. For another example, taking the first (and only) cell of arr gives an array with shape 326, length 3, and rank 3, as we can see by applying each function to arr.

↗️
    = {𝕎𝕩}¨< arr
 ⟨ ⟨ 3 2 6 ⟩ 3 3 ⟩
 
-

Applying Shape and the other two functions to an atom shows a shape of ⟨⟩, the empty list, and a rank of zero and length of 1. The same is true of an enclosed array, which like an atom is a kind of unit.

+

Applying Shape and the other two functions to an atom shows a shape of ⟨⟩ (the empty list), and a rank of zero and length of 1. The same is true of an enclosed array, which like an atom is a kind of unit.

↗️
     5
 ⟨⟩
 
-- 
cgit v1.2.3