Quelques tests de recherche de polynôme minimal.
This commit is contained in:
parent
0e86409114
commit
8357410256
@ -59,7 +59,7 @@
|
|||||||
% 2: Samy
|
% 2: Samy
|
||||||
% 3: Victor
|
% 3: Victor
|
||||||
\newcounter{cqd}
|
\newcounter{cqd}
|
||||||
\setcounter{cqd}{3}
|
\setcounter{cqd}{2}
|
||||||
|
|
||||||
\newcommand\lequel[3]{
|
\newcommand\lequel[3]{
|
||||||
|
|
||||||
|
|||||||
@ -9,11 +9,15 @@ all:
|
|||||||
dylan:
|
dylan:
|
||||||
sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{1}/' -i CompteRendu.tex
|
sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{1}/' -i CompteRendu.tex
|
||||||
$(MAKE) build
|
$(MAKE) build
|
||||||
samy:
|
samy: print_output_path.svg
|
||||||
sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{2}/' -i CompteRendu.tex
|
sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{2}/' -i CompteRendu.tex
|
||||||
$(MAKE) build
|
$(MAKE) build
|
||||||
victor:
|
victor: print_output_path.svg
|
||||||
sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{3}/' -i CompteRendu.tex
|
sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{3}/' -i CompteRendu.tex
|
||||||
$(MAKE) build
|
$(MAKE) build
|
||||||
|
|
||||||
|
print_output_path.svg:
|
||||||
|
inkscape --export-plain-svg=print_output_path.svg --export-text-to-path print_output.svg
|
||||||
|
|
||||||
build:
|
build:
|
||||||
pdflatex -synctex=1 -shell-escape -interaction=nonstopmode "CompteRendu".tex
|
pdflatex -synctex=1 -shell-escape -interaction=nonstopmode "CompteRendu".tex
|
||||||
|
|||||||
52
Test.ml
52
Test.ml
@ -484,15 +484,43 @@ let lst = naifostene pol;;
|
|||||||
List.iter (function p -> print_polynome p) lst;;
|
List.iter (function p -> print_polynome p) lst;;
|
||||||
|
|
||||||
print_polynome (List.fold_left polmul 1 lst);;
|
print_polynome (List.fold_left polmul 1 lst);;
|
||||||
|
|
||||||
|
|
||||||
|
(*** Test de recherche du polynome minimal de alpha ***)
|
||||||
|
|
||||||
|
type complexe = float*float;;
|
||||||
|
|
||||||
|
let cmul x y =
|
||||||
|
let (a,b)=x and (c,d)=y in
|
||||||
|
(a*.c-.b*.d,b*.c+.a*.d);;
|
||||||
|
let cadd x y =
|
||||||
|
let (a,b)=x and (c,d)=y in
|
||||||
|
(a+.c,b+.d);;
|
||||||
|
|
||||||
|
let rec polymise p z =
|
||||||
|
if p=0 then (0.,0.)
|
||||||
|
else
|
||||||
|
let a = if p mod 2 = 0 then (0.,0.) else (1.,0.) in
|
||||||
|
let q = p lsr 1 in
|
||||||
|
cadd a (cmul z (polymise q z));;
|
||||||
|
|
||||||
|
let n = 21;;
|
||||||
|
let alpha =
|
||||||
|
let th = 2.*.3.14159265358979/.(float_of_int n) in
|
||||||
|
(cos th,sin th);;
|
||||||
|
|
||||||
|
let isNull z =
|
||||||
|
let epsilon = 0.00001 in
|
||||||
|
let (a,b)=z in
|
||||||
|
-.epsilon<a && a<epsilon && -.epsilon<b && b<epsilon;;
|
||||||
|
|
||||||
|
for p=1 to 2 lsl 21
|
||||||
|
do
|
||||||
|
if isNull (polymise p alpha)
|
||||||
|
then(
|
||||||
|
print_int p;
|
||||||
|
print_polynome p)
|
||||||
|
done;;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user