Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
ArrayTools[ComplexAsFloat] - provide real view of a complex Matrix, Vector, or Array
Calling Sequence
ComplexAsFloat(A)
Parameters
A
-
rectangular storage Matrix, Vector, or Array of data type complex[8] or complex(sfloat)
Description
The ComplexAsFloat(A) command provides a double-size real view of an existing Matrix, Vector, or Array of complex[8] or complex(sfloat) data type. The input Matrix, Vector, or Array must have rectangular (dense) storage.
ComplexAsFloat does not change the underlying data of the input rtable object. Instead, ComplexAsFloat casts it to an rtable object with the same specifications, the corresponding float datatype, and double the size in one of the dimensions of the input rtable. As such, changes to the contents of the view also affect the contents of the original input rtable, and vice-versa.
If the original Matrix, Vector, or Array has been unassigned, it will still exist in the attributes of the real view, but changing the data will only affect the current view.
Important: Use this function with caution. If you remove the table reference from the attributes and unassign the original input object, accessing or changing the data in the view will crash Maple. If a persistent and permanent copy of the data is desired, then this command can be used in combination with copy or ArrayTools:-Copy.
The layout of the output view from ComplexAsFloat is different for C_order and Fortran_order input, as indicated in the following description.
If the input rtable is C_order, then the last dimension of the input is doubled on output, and the real and imaginary parts of the input are interleaved (alternating) with respect to the last dimension. For example, calling ComplexAsFloat with a C_order 3 x 4 Matrix results in a 3 x 8 Matrix where the odd columns contain the real parts of the input Matrix, and the even columns contain the imaginary parts (see the Examples section).
If the input rtable is Fortran_order, then the first dimension of the input is doubled on output, and the real and imaginary parts of the input are interleaved (alternating) with respect to the first dimension. For example, calling ComplexAsFloat with a Fortran_order 3 x 4 Matrix results in a 6 x 4 Matrix where the odd rows contain the real parts of the input Matrix, and the even rows contain the imaginary parts (see the Examples section).
This command can be used in combination with ArrayTools:-Fill to clear or set the real or imaginary parts of a complex Matrix, or can be used in combination with ArrayTools:-Copy to efficiently extract the real or imaginary parts of a complex Matrix.
This function is part of the ArrayTools package, so it can be used in the short form ComplexAsFloat(..) only after executing the command with(ArrayTools). However, it can always be accessed through the long form of the command by using ArrayTools[ComplexAsFloat](..).
Examples
C_order 3 x 4 Matrix
Use the Fill command to clear imaginary part only. Note this affects A and Ar.
Use the Copy command to extract the real part to an existing Matrix.
Fortran_order 3 x 4 Matrix
See Also
ArrayTools, ArrayTools[Copy], ArrayTools[Fill], C_order, copy, Fortran_order, Matrix
Download Help Document