: calculate-column-major-index ( seq shape -- i )
1 [ * ] accumulate nip vdot ;
+: get-shaped-row-major ( seq shaped -- elt )
+ shaped-bounds-check [ shape calculate-row-major-index ] [ underlying>> ] bi nth ;
+
: set-shaped-row-major ( obj seq shaped -- )
shaped-bounds-check [ shape calculate-row-major-index ] [ underlying>> ] bi set-nth ;
+: get-shaped-column-major ( seq shaped -- elt )
+ shaped-bounds-check [ shape calculate-column-major-index ] [ underlying>> ] bi nth ;
+
: set-shaped-column-major ( obj seq shaped -- )
shaped-bounds-check [ shape calculate-column-major-index ] [ underlying>> ] bi set-nth ;