< Ada Programming < Libraries

Ada. Time-tested, safe and secure.
This language feature is only available from Ada 2005 on. Ada.Numerics.Generic_Complex_Arrays is a unit of the Predefined Language Environment since Ada 2005.
Specification
-- Standard Ada library specification -- Copyright (c) 2003-2018 Maxim Reznik <reznikmm@gmail.com> -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual -- -------------------------------------------------------------------------withAda.Numerics.Generic_Real_Arrays;withAda.Numerics.Generic_Complex_Types;genericwithpackageReal_ArraysisnewAda.Numerics.Generic_Real_Arrays (<>);withpackageComplex_TypesisnewAda.Numerics.Generic_Complex_Types (Real_Arrays.Real);packageAda.Numerics.Generic_Complex_ArraysispragmaPure (Generic_Complex_Arrays); -- TypestypeComplex_Vectorisarray(Integerrange<>)ofComplex_Types.Complex;typeComplex_Matrixisarray(Integerrange<>, Integerrange<>)ofComplex_Types.Complex; -- Subprograms for Complex_Vector types -- Complex_Vector selection, conversion and composition operationsfunctionRe (X :inComplex_Vector)returnReal_Arrays.Real_Vector;functionIm (X :inComplex_Vector)returnReal_Arrays.Real_Vector;procedureSet_Re (X :inoutComplex_Vector; Re :inReal_Arrays.Real_Vector);procedureSet_Im (X :inoutComplex_Vector; Im :inReal_Arrays.Real_Vector);functionCompose_From_Cartesian (Re :inReal_Arrays.Real_Vector)returnComplex_Vector;functionCompose_From_Cartesian (Re :inReal_Arrays.Real_Vector; Im :inReal_Arrays.Real_Vector)returnComplex_Vector;functionModulus (X :inComplex_Vector)returnReal_Arrays.Real_Vector;function"abs" (Right :inComplex_Vector)returnReal_Arrays.Real_VectorrenamesModulus;functionArgument (X :inComplex_Vector)returnReal_Arrays.Real_Vector;functionArgument (X :inComplex_Vector; Cycle :inReal_Arrays.Real'Base)returnReal_Arrays.Real_Vector;functionCompose_From_Polar (Modulus :inReal_Arrays.Real_Vector; Argument :inReal_Arrays.Real_Vector)returnComplex_Vector;functionCompose_From_Polar (Modulus :inReal_Arrays.Real_Vector; Argument :inReal_Arrays.Real_Vector; Cycle :inReal_Arrays.Real'Base)returnComplex_Vector; -- Complex_Vector arithmetic operationsfunction"+" (Right :inComplex_Vector)returnComplex_Vector;function"-" (Right :inComplex_Vector)returnComplex_Vector;functionConjugate (X :inComplex_Vector)returnComplex_Vector;function"+" (Left :inComplex_Vector; Right :inComplex_Vector)returnComplex_Vector;function"-" (Left :inComplex_Vector; Right :inComplex_Vector)returnComplex_Vector;function"*" (Left :inComplex_Vector; Right : Complex_Vector)returnComplex_Types.Complex;function"abs" (Right :inComplex_Vector)returnComplex_Types.Complex; -- Mixed Real_Arrays.Real_Vector and Complex_Vector arithmetic operationsfunction"+" (Left :inReal_Arrays.Real_Vector; Right :inComplex_Vector)returnComplex_Vector;function"+" (Left :inComplex_Vector; Right :inReal_Arrays.Real_Vector)returnComplex_Vector;function"-" (Left :inReal_Arrays.Real_Vector; Right :inComplex_Vector)returnComplex_Vector;function"-" (Left :inComplex_Vector; Right :inReal_Arrays.Real_Vector)returnComplex_Vector;function"*" (Left :inReal_Arrays.Real_Vector; Right :inComplex_Vector)returnComplex_Types.Complex;function"*" (Left :inComplex_Vector; Right :inReal_Arrays.Real_Vector)returnComplex_Types.Complex; -- Complex_Vector scaling operationsfunction"*" (Left :inComplex_Types.Complex; Right :inComplex_Vector)returnComplex_Vector;function"*" (Left :inComplex_Vector; Right :inComplex_Types.Complex)returnComplex_Vector;function"/" (Left :inComplex_Vector; Right :inComplex_Types.Complex)returnComplex_Vector;function"*" (Left :inReal_Arrays.Real'Base; Right :inComplex_Vector)returnComplex_Vector;function"*" (Left :inComplex_Vector; Right :inReal_Arrays.Real'Base)returnComplex_Vector;function"/" (Left :inComplex_Vector; Right :inReal_Arrays.Real'Base)returnComplex_Vector; -- Other Complex_Vector operationsfunctionUnit_Vector (Index :inInteger; Order :inPositive; First :inInteger := 1)returnComplex_Vector; -- Subprograms for Complex_Matrix types -- Complex_Matrix selection, conversion and composition operationsfunctionRe (X :inComplex_Matrix)returnReal_Arrays.Real_Matrix;functionIm (X :inComplex_Matrix)returnReal_Arrays.Real_Matrix;procedureSet_Re (X :inoutComplex_Matrix; Re :inReal_Arrays.Real_Matrix);procedureSet_Im (X :inoutComplex_Matrix; Im :inReal_Arrays.Real_Matrix);functionCompose_From_Cartesian (Re :inReal_Arrays.Real_Matrix)returnComplex_Matrix;functionCompose_From_Cartesian (Re :inReal_Arrays.Real_Matrix; Im :inReal_Arrays.Real_Matrix)returnComplex_Matrix;functionModulus (X :inComplex_Matrix)returnReal_Arrays.Real_Matrix;function"abs" (Right :inComplex_Matrix)returnReal_Arrays.Real_MatrixrenamesModulus;functionArgument (X :inComplex_Matrix)returnReal_Arrays.Real_Matrix;functionArgument (X :inComplex_Matrix; Cycle :inReal_Arrays.Real'Base)returnReal_Arrays.Real_Matrix;functionCompose_From_Polar (Modulus :inReal_Arrays.Real_Matrix; Argument :inReal_Arrays.Real_Matrix)returnComplex_Matrix;functionCompose_From_Polar (Modulus :inReal_Arrays.Real_Matrix; Argument :inReal_Arrays.Real_Matrix; Cycle :inReal_Arrays.Real'Base)returnComplex_Matrix; -- Complex_Matrix arithmetic operationsfunction"+" (Right :inComplex_Matrix)returnComplex_Matrix;function"-" (Right :inComplex_Matrix)returnComplex_Matrix;functionConjugate (X :inComplex_Matrix)returnComplex_Matrix;functionTranspose (X :inComplex_Matrix)returnComplex_Matrix;function"+" (Left :inComplex_Matrix; Right :inComplex_Matrix)returnComplex_Matrix;function"-" (Left :inComplex_Matrix; Right :inComplex_Matrix)returnComplex_Matrix;function"*" (Left :inComplex_Matrix; Right :inComplex_Matrix)returnComplex_Matrix;function"*" (Left :inComplex_Vector; Right :inComplex_Vector)returnComplex_Matrix;function"*" (Left :inComplex_Vector; Right :inComplex_Matrix)returnComplex_Vector;function"*" (Left :inComplex_Matrix; Right :inComplex_Vector)returnComplex_Vector; -- Mixed Real_Arrays.Real_Matrix and Complex_Matrix arithmetic operationsfunction"+" (Left :inReal_Arrays.Real_Matrix; Right :inComplex_Matrix)returnComplex_Matrix;function"+" (Left :inComplex_Matrix; Right :inReal_Arrays.Real_Matrix)returnComplex_Matrix;function"-" (Left :inReal_Arrays.Real_Matrix; Right :inComplex_Matrix)returnComplex_Matrix;function"-" (Left :inComplex_Matrix; Right :inReal_Arrays.Real_Matrix)returnComplex_Matrix;function"*" (Left :inReal_Arrays.Real_Matrix; Right :inComplex_Matrix)returnComplex_Matrix;function"*" (Left :inComplex_Matrix; Right :inReal_Arrays.Real_Matrix)returnComplex_Matrix;function"*" (Left :inReal_Arrays.Real_Vector; Right :inComplex_Vector)returnComplex_Matrix;function"*" (Left :inComplex_Vector; Right :inReal_Arrays.Real_Vector)returnComplex_Matrix;function"*" (Left :inReal_Arrays.Real_Vector; Right :inComplex_Matrix)returnComplex_Vector;function"*" (Left :inComplex_Vector; Right :inReal_Arrays.Real_Matrix)returnComplex_Vector;function"*" (Left :inReal_Arrays.Real_Matrix; Right :inComplex_Vector)returnComplex_Vector;function"*" (Left :inComplex_Matrix; Right :inReal_Arrays.Real_Vector)returnComplex_Vector; -- Complex_Matrix scaling operationsfunction"*" (Left :inComplex_Types.Complex; Right :inComplex_Matrix)returnComplex_Matrix;function"*" (Left :inComplex_Matrix; Right :inComplex_Types.Complex)returnComplex_Matrix;function"/" (Left :inComplex_Matrix; Right :inComplex_Types.Complex)returnComplex_Matrix;function"*" (Left :inReal_Arrays.Real'Base; Right :inComplex_Matrix)returnComplex_Matrix;function"*" (Left :inComplex_Matrix; Right :inReal_Arrays.Real'Base)returnComplex_Matrix;function"/" (Left :inComplex_Matrix; Right :inReal_Arrays.Real'Base)returnComplex_Matrix; -- Complex_Matrix inversion and related operationsfunctionSolve (A :inComplex_Matrix; X :inComplex_Vector)returnComplex_Vector;functionSolve (A :inComplex_Matrix; X :inComplex_Matrix)returnComplex_Matrix;functionInverse (A :inComplex_Matrix)returnComplex_Matrix;functionDeterminant (A :inComplex_Matrix)returnComplex_Types.Complex; -- Eigenvalues and vectors of a Hermitian matrixfunctionEigenvalues (A :inComplex_Matrix)returnReal_Arrays.Real_Vector;procedureEigensystem (A :inComplex_Matrix; Values :outReal_Arrays.Real_Vector; Vectors :outComplex_Matrix); -- Other Complex_Matrix operationsfunctionUnit_Matrix (Order :inPositive; First_1 :inInteger := 1; First_2 :inInteger := 1)returnComplex_Matrix;endAda.Numerics.Generic_Complex_Arrays;
See also
Wikibook
External examples
- Search for examples of
Ada.Numerics.Generic_Complex_Arraysin: Rosetta Code, GitHub or this Wikibook. - Search for any post related to
Ada.Numerics.Generic_Complex_Arraysin: Stack Overflow, comp.lang.ada or any Ada related page.
Ada Reference Manual
Ada 2005
Ada 2012
Open-Source Implementations
FSF GNAT
- Specification: a-ngcoar.ads
- Body: a-ngcoar.adb
drake
- Specification: numerics/a-ngcoar.ads
- Body: numerics/a-ngcoar.adb
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.