ArrayTools
SuggestedSubtype
suggest rtable subtype for an operation on two rtables
Calling Sequence
Parameters
Description
Examples
Compatibility
SuggestedSubtype(X,Y,ndims)
X, Y
-
Array, hardware float, or general expression
ndims
(optional) number of dimensions of result
SuggestedSubtype(X,Y) accepts two rtables, X and Y, and suggests a subtype to use for a result involving an operation between X and Y.
The number of dimensions of the result of the operation can be passed as optional third argument ndims. If omitted, the number of dimensions is assumed to be the sum of the number of dimensions of X and Y.
If X or Y is a Vector or Matrix, and the number of dimensions of the result is 1 or 2, the suggested subtype will be a Vector or Matrix.
If neither X nor Y is a Vector or Matrix, or the number of dimensions of the result is 0 or more than 2, the suggested subtype will be Array.
This function is part of the ArrayTools package, so it can be used in the short form SuggestedSubtype(..) only after executing the command with(ArrayTools). However, it can always be accessed through the long form of the command by using ArrayTools[SuggestedSubtype](..).
with⁡ArrayTools:
M1≔Matrix⁡1,2,3,4
M1≔1234
SuggestedSubtype⁡M1,x
Matrix
V1≔Vectorcolumn⁡5,6
V1≔56
SuggestedSubtype⁡M1,V1
Array
SuggestedSubtype⁡M1,V1,1
Vectorcolumn
SuggestedSubtype⁡M1,V1,2
The ArrayTools[SuggestedSubtype] command was introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
See Also
ArrayTools[SuggestedDatatype]
ArrayTools[SuggestedOrder]
Download Help Document