forked from nikolajk00/Rational_Reckoner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGeneric_Polynomials.ads
28 lines (24 loc) · 1 KB
/
Generic_Polynomials.ads
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
with Generic_CoefficientContainer;
generic
type TCoefficient is digits <>;
package Generic_Polynomials is
type Polynomial is private;
function Create return Polynomial;
function Create (source: Polynomial) return Polynomial;
procedure Destroy(self: Polynomial);
procedure Print(self: Polynomial);
procedure Input(self: Polynomial);
function Minus(self: Polynomial) return Polynomial;
procedure Append(self, subject: Polynomial);
procedure Reduse(self, subject: Polynomial);
function Plus(self, subject: Polynomial) return Polynomial;
function Substract(self, subject: Polynomial) return Polynomial;
function Multiply(self, subject: Polynomial) return Polynomial;
private
package CoefficientContainers is new Generic_CoefficientContainer(TCoefficient);
type CoefficientContainer_pointer is access CoefficientContainers.ICoefficientContainer;
type Polynomial is tagged
record
Coefficients: CoefficientContainer_pointer;
end record;
end Generic_Polynomials;