LinearAlgebra - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Support : LinearAlgebra/GetResultDataType

LinearAlgebra

  

GetResultDataType

  

return the resulting datatype of a Matrix or Vector operation

 

Calling Sequence

Parameters

Description

Examples

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

withLinearAlgebra&colon;

UseHardwareFloats

deduced

(1)

Digits

10

(2)

GetResultDataTypefloat&comma;float&comma;UseHardwareFloats

float8

(3)

Digits30&colon;

GetResultDataTypefloat&comma;float&comma;UseHardwareFloats

sfloat

(4)

UseHardwareFloatstrue&colon;

GetResultDataTypeinteger&comma;integer&comma;UseHardwareFloats

integer

(5)

GetResultDataTypefloat&lsqb;8&rsqb;&comma;complex&lsqb;8&rsqb;&comma;UseHardwareFloats

complex8

(6)

UseHardwareFloatsfalse&colon;

GetResultDataTyperational&comma;float&comma;UseHardwareFloats

sfloat

(7)

AMatrix2&comma;datatype&equals;&apos;complexinteger&apos;&colon;

BMatrix2&comma;datatype&equals;&apos;float&apos;&colon;

GetResultDataTypeMatrixOptionsA&comma;datatype&comma;MatrixOptionsB&comma;datatype&comma;true

complex8

(8)

GetResultDataTypeinteger&comma;integer&comma;UseHardwareFloats&comma;&apos;div&apos;

rational

(9)

GetResultDataTypeinteger&comma;float&comma;true&comma;sqrtreal

float8

(10)

GetResultDataTypeinteger&comma;float&comma;true&comma;sqrt

complex8

(11)

See Also

LinearAlgebra

Matrix

type

UseHardwareFloats

Vector

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam