rtable_redim - Maple Help

rtable_redim

change the upper and lower bounds of the dimension(s) of an rtable

 Calling Sequence rtable_redim(A, newDim, ...) rtable_redim(A, subType)

Parameters

 A - rtable object newDim - a new lower bound or lower..upper bound range, one per dimension subType - a new rtable sub-type, such as Matrix or Vector[row]

Description

 • The rtable_redim command changes the lower and upper bounds of each dimension of an Array, Matrix, or Vector.
 If A is a Matrix or Vector, and one or more of the new lower bounds is not 1, A is changed into an Array.
 • Each newDim parameter specifies either a new lower bound for the corresponding dimension, or a range giving both the lower and upper bound for that dimension.
 Because rtable_redim cannot change the size of a dimension, the lower..upper form of newDim is equivalent to specifying just the lower bound. The range form is useful for making the dimensions of one rtable match those of another (see the examples).
 • The number of newDim parameters specified can be at most the number of dimensions of A. If fewer newDims are specified, the remaining dimensions are left unchanged.
 • Instead of a sequence of new dimensions, rtable_redim can be passed a subType argument, which must be one of one of Array, Matrix, Vector[row] or Vector[column]. This changes A to have that rtable sub-type. If the specified sub-type was Matrix, Vector[row] or Vector[column], the dimensions are also changed to have lower bounds of 1.
 • Note that rtable_redim changes the dimensions (and possibly the subtype if A is a Matrix or Vector, or a subType was specified) in place. In other words, the rtable passed in is modified.
 • rtable_redim returns A after modifying it.

 • The rtable_redim command is thread-safe as of Maple 15.

Examples

 > $V≔\mathrm{Vector}\left(\left[x,y,z,w\right]\right)$
 ${V}{≔}\left[\begin{array}{c}{x}\\ {y}\\ {z}\\ {w}\end{array}\right]$ (1)
 > $\mathrm{rtable_redim}\left(V,4\right)$
 > $A≔\mathrm{Array}\left(1..50,1..50,\mathrm{frandom}\left(\right)\right)$
 > $\mathrm{sub1}≔{A}_{6..8,16..18}:$
 > $\mathrm{dims1}≔\mathrm{rtable_dims}\left(\mathrm{sub1}\right)$
 ${\mathrm{dims1}}{≔}{6}{..}{8}{,}{16}{..}{18}$ (2)
 > $\mathrm{sub2}≔{A}_{26..28,36..38}:$
 > $\mathrm{dims2}≔\mathrm{rtable_dims}\left(\mathrm{sub2}\right)$
 ${\mathrm{dims2}}{≔}{26}{..}{28}{,}{36}{..}{38}$ (3)
 > $\mathrm{subadd}≔\mathrm{sub1}+\mathrm{sub2}:$
 > $\mathrm{rtable_redim}\left(\mathrm{sub2},\mathrm{dims1}\right):$
 > $\mathrm{rtable_dims}\left(\mathrm{sub1}\right)$
 ${6}{..}{8}{,}{16}{..}{18}$ (4)
 > $\mathrm{rtable_dims}\left(\mathrm{sub2}\right)$
 ${6}{..}{8}{,}{16}{..}{18}$ (5)
 > $\mathrm{subadd}≔\mathrm{sub1}+\mathrm{sub2}:$
 > $\mathrm{rtable_dims}\left(\mathrm{subadd}\right)$
 ${6}{..}{8}{,}{16}{..}{18}$ (6)
 > $\mathrm{rtable_redim}\left(\mathrm{subadd},\mathrm{Matrix}\right)$
 $\left[\begin{array}{ccc}{0.5316469557}& {0.4579175685}& {0.8732126716}\\ {1.303030942}& {0.4539010670}& {1.239676601}\\ {0.2432761332}& {0.8161181119}& {0.2577136183}\end{array}\right]$ (7)
 > $\mathrm{rtable_dims}\left(\mathrm{subadd}\right)$
 ${1}{..}{3}{,}{1}{..}{3}$ (8)