with Ada.Numerics.Generic_Real_Arrays;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with HTML; use HTML;
generic
Dimension : Natural := 3;
package Geometric_Algebra_Generic is
function Get_Dimension return Natural;
type Signature_Type is array (1 .. Dimension) of Integer with
Default_Component_Value => 1;
Base_Dimension : constant Natural := 2**Dimension;
package Real_Arrays is new Ada.Numerics.Generic_Real_Arrays (Float);
subtype Vector_Type is Real_Arrays.Real_Vector (1 .. Get_Dimension);
function Scalar_Product (Left, Right : Vector_Type) return Float;
type Canonic_Base_Element_Type is private;
function "*" (Left : Canonic_Base_Element_Type; Right : Canonic_Base_Element_Type) return Canonic_Base_Element_Type;
type Multi_Vector_Type is private;
Canonic_Base : constant Multi_Vector_Type;
Zero_Multivector : constant Multi_Vector_Type;
One : constant Multi_Vector_Type;
Multi_Vector_not_Inizialised : exception;
procedure Put_Line (Value : Multi_Vector_Type);
procedure Put_Multi_Vector (Value : Multi_Vector_Type);
function "+" (Left : Multi_Vector_Type; Right : Multi_Vector_Type) return Multi_Vector_Type;
function "-" (Left : Multi_Vector_Type; Right : Multi_Vector_Type) return Multi_Vector_Type;
function "*" (Left : Float; Right : Multi_Vector_Type) return Multi_Vector_Type;
function "*" (Left : Multi_Vector_Type; Right : Float) return Multi_Vector_Type;
function "*" (Left : Multi_Vector_Type; Right : Multi_Vector_Type) return Multi_Vector_Type;
function "/" (Left : Multi_Vector_Type; Right : Multi_Vector_Type) return Multi_Vector_Type;
procedure Set_Element (Multi_Vector : in out Multi_Vector_Type; Element : Natural; Value : Float);
function Get_Base_of_Same_Grad (Grade : Natural) return Unbounded_String;
subtype String_Matrix_Type is HTML.String_Matrix_Type;
function Prepare_Base_Name_Table_ASCII return String_Matrix_Type;
function Prepare_Base_Name_Table_HTML return String_Matrix_Type;
function Prepare_Base_Name_Table_LaTex return String_Matrix_Type;
procedure Create_Base_Vector_Table_HTML (File_Name : String := "base_vectors_table.html");
procedure Create_Multipikation_Table_HTML (File_Name : String := "multiplication_table.html");
procedure Create_Multipikation_Table_HTML_Short_Form (File_Name : String := "multiplication_table_short.html");
procedure Create_Base_Vector_Table_LaTex (File_Name : String := "base_vectors_table.lat"; Formular_Elements : Boolean := true);
procedure Create_Multiplication_Table_Latex (File_Name : String := "multiplication_table.lat");
procedure Create_Multiplication_Table_Latex_Short_Form (File_Name : String := "multiplication_table.lat");
type Bit_Type is range 0 .. 1 with
Default_Value => 0;
type Bit_Array_Type is array (1 .. Dimension) of Bit_Type with
Default_Component_Value => 0;
function Signum (Left : Bit_Array_Type; Right : Bit_Array_Type) return Integer;
private
function Create_Canonic_Base return Multi_Vector_Type;
function Create_Zero_Multivector return Multi_Vector_Type;
function Get_Max_Blade_Length return Natural;
type Canonic_Base_Element_Type is record
Value : Float := 0.0;
Base : Bit_Array_Type;
Name : Unbounded_String := Null_Unbounded_String;
HTML_Name : Unbounded_String := Null_Unbounded_String;
Short_Name : Unbounded_String := Null_Unbounded_String;
Latex_Name : Unbounded_String := Null_Unbounded_String;
Grade : Natural := 0;
end record;
type Multi_Vector_Type is array (0 .. Base_Dimension - 1) of Canonic_Base_Element_Type;
Canonic_Base : constant Multi_Vector_Type := Create_Canonic_Base;
One : constant Multi_Vector_Type := Create_Canonic_Base;
Zero_Multivector : constant Multi_Vector_Type := Create_Zero_Multivector;
Max_Blade_Length : constant Natural := Get_Max_Blade_Length;
end Geometric_Algebra_Generic;