Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
LinearAlgebra[GetResultDataType] - return the resulting datatype of a Matrix or Vector operation
Calling Sequence
GetResultDataType(t1, t2, h, oper)
Parameters
t1, t2
-
types; Matrix or Vector datatypes
h
either 'true', 'false' or 'deduced'; specify hardware float type
oper
(optional) specific operation by which the two input types are to be mixed
Description
The GetResultDataType(t1, t2, h, oper) function returns a datatype which can be used when constructing a new Matrix or Vector from two other such objects.
This routine can be used within routines that operate on a pair of input Matrices or Vectors to produce a new Matrix or Vector, and that need to set a datatype option on the result. The datatype returned by GetResultDataType is determined by the inputs:
* a hardware float type if all the following are true: either input type is a float type, both input types are numeric, and the h parameter is true or the h parameter is deduced and Digits <= evalhf(Digits).
* a software float type if all the following are true: either input type is a float type, both input types are numeric, and the h parameter is false, or the h parameter is deduced and Digits > evalhf(Digits).
* a complex type if either input type is a complex type
* the "larger" of the input types if neither input type is any kind of float type, according to the ordering hardware integer < integer < rational < numeric < extended_numeric and real < complex, except that numeric is replaced by extended_numeric (and fraction is replaced by rational) in the result type.
The optional parameter oper is used to determine the mixing of types. This parameter may be supplied as any of 'div', 'sqrt' or 'sqrtreal', which respectively represent the operations of division, taking the square root, and taking the real square root. If this parameter is omitted then the default operation of multiplication is assumed.
Not all Maple types are known to this routine, whose principal purpose is to facilitate numerical linear algebra. The known types fit into hierarchical orderings, for each of the known operations.
This function is part of the LinearAlgebra package, and so it can be used in the form GetResultDataType(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[GetResultDataType](..).
Examples
See Also
LinearAlgebra, Matrix, type, UseHardwareFloats, Vector
Download Help Document