33(* I define the image of a path, a [Compact] subset of the plane. *)
44(* Finally, plot a hi-res Circle *)
55
6- Require Import Plot RasterQ Qmetric.
6+ From CoRN Require Import Plot RasterQ Qmetric.
77Require Import CoRN.reals.fast.Interval.
88Require Import CoRN.metric2.MetricMorphisms.
99Require Import CoRN.reals.faster.ARArith.
10- Require Import ARplot.
10+ From CoRN Require Import ARplot.
1111Require Import CoRN.reals.faster.ARcos
1212 CoRN.reals.faster.ARsin
1313 CoRN.reals.faster.ARexp
1414 CoRN.reals.faster.ARbigD
1515 CoRN.reals.faster.ARinterval.
1616Require Import CoRN.reals.fast.CRtrans.
17- Require Import CoRN.dump.theories.Loader .
17+ Require Import CoRN.write_image.WritePPM .
1818
1919Local Open Scope uc_scope.
2020
@@ -47,21 +47,19 @@ Definition Cos_faster : sparse_raster _ _
4747
4848End PlotCirclePath.
4949
50- (* 6 seconds *)
51- Time Definition Circle_bigD : sparse_raster _ _
52- := Eval vm_compute in
53- @Circle_faster bigD _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ bigD_appRat.
50+ Definition Circle_bigD : sparse_raster _ _
51+ := @Circle_faster bigD _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ bigD_appRat.
5452
55- DumpGrayMap Circle_bigD.
56- (* Now have a look at plot.pgm *)
53+ (* 3.7s on Apple M1 - this is mostly the creation of the sparse raster *)
54+ Time Elpi WritePPM "Circle.ppm" ( Circle_bigD ).
55+ (* Now have a look at Circle.ppm *)
5756
58- Time Definition Cos_bigD : sparse_raster _ _
59- := Eval vm_compute in
60- @Cos_faster bigD _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ bigD_appRat.
61-
62- DumpGrayMap Cos_bigD.
63- (* Now have a look at plot.pgm *)
57+ Definition Cos_bigD : sparse_raster _ _
58+ := @Cos_faster bigD _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ bigD_appRat.
6459
60+ (* 3.1s on Apple M1 *)
61+ Time Elpi WritePPM "Cos.ppm" ( Cos_bigD ).
62+ (* Now have a look at Cos.ppm *)
6563
6664Definition CircleFunction_aux
6765 : ProductMS Q_as_MetricSpace Q_as_MetricSpace --> ProductMS CR CR
@@ -70,20 +68,18 @@ Definition CircleFunction_aux
7068Definition CirclePath : Q_as_MetricSpace --> Complete Q2:=
7169 (uc_compose (uc_compose Couple CircleFunction_aux) (diag Q_as_MetricSpace)).
7270(* The following hangs:
71+ TODO this does not even compile
7372Definition CirclePath': UCFunction Q R2:=
74- ucFunction (fun q:Q => Couple (cos_uc q, sin_uc q)). *)
73+ ucFunction (fun q:Q => Couple (cos_uc q, sin_uc q)). *)
7574
7675
77- (* 20 seconds *)
78- (* The raster must be evaluated before being plotted by DumpGrayMap,
79- here with vm_compute. *)
80- Time Definition Circle : sparse_raster _ _
81- := Eval vm_compute in
82- (let (_,r) := Plot.PlotPath 0 7 (-(1)) 1 (reflexivity _)
76+ Definition Circle : sparse_raster _ _
77+ := (let (_,r) := Plot.PlotPath 0 7 (-(1)) 1 (reflexivity _)
8378 (-(1)) 1 (reflexivity _) 200 CirclePath
8479 in r).
8580
86- DumpGrayMap Circle.
87- (* Now have a look at plot.pgm *)
81+ (* 16.3 seconds on Apple M1 *)
82+ Time Elpi WritePPM "Circle2.ppm" ( Circle ).
83+ (* Now have a look at Circle2.ppm *)
8884
8985
0 commit comments