Generic procedure: Ada.Numerics.Generic_Real_Arrays.Generic_Roots

Dependencies

pragma License (Unrestricted);

Description

AI95-00346

Implementation Requirements

The accuracy of these subprograms is implementation defined.

Implementation Permissions

The nongeneric equivalent subprograms may, but need not, be actual instantiations of the generic subprograms for the appropriate predefined type.

Implementation Advice

Implementations should implement these subprograms using established techniques such as Laguerre's method.

The array P defines a polynomial P = P[0] + P[1]*x + P[2]*x**2 +...+ P[n]*x**n where n is P'Last. Constraint_Error is raised if P'First is not zero and if P'Last is not greater than zero. Constraint_Error is also raised if the bounds of the out parameter R are not one and P'Last.

The out parameter Number_Real is the number of roots of the equation P=0 which are real. The components R[1] .. R[Number_Real], if any, are the rool roots of the equation P=0 in some order. The remaining components of R, if any, taken in pairs with adjacent indexes are the real and imaginary parts respectively of the conjugate pairs of complex roots of P=0 in some order.


Header

generic
procedure Ada.Numerics.Generic_Real_Arrays.Generic_Roots
             (P           : in  Real_Vector;
              R           : out Real_Vector;
              Number_Real : out Natural);
pragma Pure (Generic_Roots);