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)$
 $\left[{x}{,}{y}{,}{z}{,}{w}{,}{\text{⋯ 4 .. 7 Array}}\right]$ (2)
 > $A≔\mathrm{Array}\left(1..50,1..50,\mathrm{frandom}\left(\right)\right)$
 ${A}{≔}\begin{array}{c}\left[\begin{array}{ccccccccccc}{0.611237130774301307}& {0.558565491802885616}& {0.804520877458731132}& {0.652519960748294103}& {0.243647912616784756}& {0.190902853244491189}& {0.864622012533552975}& {0.466201833790635956}& {0.631930797977457104}& {0.475785626569532605}& {\dots }\\ {0.425496828002626670}& {0.850678902590102926}& {0.524740163941994853}& {0.277611122264388333}& {0.237868792007306373}& {0.123500832319800580}& {0.651269264764942291}& {0.0506464976705434111}& {0.401883398008085591}& {0.248949470039808052}& {\dots }\\ {0.501903419153743702}& {0.557292680689928766}& {0.739479504887486816}& {0.498227929455355878}& {0.0923984579238296133}& {0.131830665475512365}& {0.637151222525224714}& {0.848596675479548979}& {0.860098876854160643}& {0.675861618952774301}& {\dots }\\ {0.776992905706028747}& {0.679904685523418650}& {0.366833407852286686}& {0.920790107998704643}& {0.788891319657008760}& {0.689637840074108999}& {0.581093227578491467}& {0.978563885159977942}& {0.643698049421404739}& {0.827209084946654905}& {\dots }\\ {0.696714852649721661}& {0.214512246163991005}& {0.511106370942859822}& {0.837840690870234273}& {0.136007388620089653}& {0.260511507083546090}& {0.0681804368270345629}& {0.113930638678425900}& {0.972305555688457002}& {0.203698875185622130}& {\dots }\\ {0.737072654586588771}& {0.700042669529619466}& {0.0833159448238721678}& {0.515765653195914386}& {0.0692789725680013069}& {0.747196944130713026}& {0.926294268197950021}& {0.783265937404036272}& {0.973704902674983996}& {0.991187788329792818}& {\dots }\\ {0.183528195527839944}& {0.753200532708854231}& {0.346501990563077400}& {0.112462378383286432}& {0.0702135239869583483}& {0.908525898848374647}& {0.179914878504240150}& {0.603296375815348451}& {0.375471662697547393}& {0.614739550216399588}& {\dots }\\ {0.0687981711037166654}& {0.0303890236611513709}& {0.801441737777534691}& {0.600838938434792413}& {0.617850587139278762}& {0.903664526363539888}& {0.294302626846237203}& {0.755914120907961173}& {0.702236632667890381}& {0.862057298433146157}& {\dots }\\ {0.887030732228013097}& {0.461737838368131315}& {0.292831555968534829}& {0.233373768071567289}& {0.796245350725845236}& {0.675375318416594705}& {0.0143621439459857836}& {0.444330358699234651}& {0.236879783226054741}& {0.402554392063122490}& {\dots }\\ {0.758194529715416121}& {0.0831558967534599125}& {0.0347767400997466281}& {0.795954985556126871}& {0.114030034515655854}& {0.279039187274614853}& {0.877573934307659842}& {0.880066259726056233}& {0.159047554722394513}& {0.290462491547268109}& {\dots }\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {}\end{array}\right]\\ \hfill {\text{50 × 50 Array}}\end{array}$ (3)
 > $\mathrm{sub1}≔A\left[6..8,16..18\right]:$
 > $\mathrm{dims1}≔\mathrm{rtable_dims}\left(\mathrm{sub1}\right)$
 ${\mathrm{dims1}}{≔}{6}{..}{8}{,}{16}{..}{18}$ (4)
 > $\mathrm{sub2}≔A\left[26..28,36..38\right]:$
 > $\mathrm{dims2}≔\mathrm{rtable_dims}\left(\mathrm{sub2}\right)$
 ${\mathrm{dims2}}{≔}{26}{..}{28}{,}{36}{..}{38}$ (5)
 > $\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}$ (6)
 > $\mathrm{rtable_dims}\left(\mathrm{sub2}\right)$
 ${6}{..}{8}{,}{16}{..}{18}$ (7)
 > $\mathrm{subadd}≔\mathrm{sub1}+\mathrm{sub2}:$
 > $\mathrm{rtable_dims}\left(\mathrm{subadd}\right)$
 ${6}{..}{8}{,}{16}{..}{18}$ (8)
 > $\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]$ (9)
 > $\mathrm{rtable_dims}\left(\mathrm{subadd}\right)$
 ${1}{..}{3}{,}{1}{..}{3}$ (10)