Tentatives de modularisation des classes, y a encore deux trois problèmes
This commit is contained in:
parent
3a5c532475
commit
91d3a9ef60
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
*.cmi
|
*.cmi
|
||||||
*.cmx
|
*.cmx
|
||||||
|
*.cmo
|
||||||
*.o
|
*.o
|
||||||
*.a
|
*.a
|
||||||
*.ascii.txt
|
*.ascii.txt
|
||||||
|
|||||||
@ -24,10 +24,13 @@
|
|||||||
|
|
||||||
*)
|
*)
|
||||||
|
|
||||||
#cd "/home/mysaa/Documents/Arbeiten/TIPE2021";;
|
#cd "/home/mysaa/Documents/Arbeiten/TIPE2021/";;
|
||||||
#use "Maths.ml";;
|
#load "Math.cmo";;
|
||||||
|
|
||||||
|
open Math;;
|
||||||
|
|
||||||
(* La bonne structure *)
|
(* La bonne structure *)
|
||||||
type code_lineaire = {klin : int; nlin : int; g : matrice; h : matrice};;
|
type code_lineaire = {klin : int; nlin : int; g : matrice; h : Math.matrice};;
|
||||||
|
|
||||||
(* La super stucture *)
|
(* La super stucture *)
|
||||||
type code_cyclique = {kcyc : int; ncyc: int; pol: polynome};;
|
type code_cyclique = {kcyc : int; ncyc: int; pol: polynome};;
|
||||||
13
Makefile
13
Makefile
@ -7,6 +7,17 @@ ascii: $(shell find textes/ -type f -iname "*.txt" ! -iname "*.ascii.txt" | sed
|
|||||||
%.cmx: %.ml
|
%.cmx: %.ml
|
||||||
ocamlopt -c $<
|
ocamlopt -c $<
|
||||||
|
|
||||||
|
%.cmo: %.ml
|
||||||
|
ocamlc -c $<
|
||||||
|
|
||||||
|
|
||||||
|
Code.cmo: Code.ml Math.cmo
|
||||||
|
mkdir tmp
|
||||||
|
cat Code.ml | sed '/^#/d' > tmp/Code.ml
|
||||||
|
ocamlc -c tmp/Code.ml Math.cmo
|
||||||
|
mv tmp/Code.cmo Code.cmo
|
||||||
|
rm -r tmp
|
||||||
|
|
||||||
tipe: tipe.cmx
|
tipe: tipe.cmx
|
||||||
ocamlopt -o tipe str.cmxa tipe.cmx
|
ocamlopt -o tipe str.cmxa tipe.cmx
|
||||||
|
|
||||||
@ -16,4 +27,4 @@ tipe: tipe.cmx
|
|||||||
runall: $(shell find textes/ -type f -iname "*.txt" ! -iname "*.ascii.txt" | sed "s/\.txt/\.txt\.test/")
|
runall: $(shell find textes/ -type f -iname "*.txt" ! -iname "*.ascii.txt" | sed "s/\.txt/\.txt\.test/")
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf tipe *.cmx *.cmi *.o textes/*.ascii.txt
|
rm -rf tipe *.cmx *.cmi *.cmo *.o textes/*.ascii.txt *.ntl.ml
|
||||||
|
|||||||
8
Test.ml
8
Test.ml
@ -1,10 +1,14 @@
|
|||||||
#cd "/home/mysaa/Documents/Arbeiten/TIPE2021";;
|
#cd "/home/mysaa/Documents/Arbeiten/TIPE2021";;
|
||||||
#use "Codes.ml";;
|
Sys.command "make Math.cmo Code.cmo";;
|
||||||
|
#load "Math.cmo";;
|
||||||
|
#load "Code.cmo";;
|
||||||
|
open Math;;
|
||||||
|
open Code;;
|
||||||
|
|
||||||
(* Test du produit de matrice *)
|
(* Test du produit de matrice *)
|
||||||
let matest = [0b01110; 0b00101; 0b10111];;
|
let matest = [0b01110; 0b00101; 0b10111];;
|
||||||
print_matrice 5 matest;;
|
print_matrice 5 matest;;
|
||||||
produit matest 0b110;; (* -> 0b10010 = 8*)
|
produit matest 0b110;; (* -> 0b10010 = 8 *)
|
||||||
|
|
||||||
(* Tests des polynomes *)
|
(* Tests des polynomes *)
|
||||||
let pol1 = 13 and pol2 = 67;;
|
let pol1 = 13 and pol2 = 67;;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user