Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
triangles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BERTOT Yves
triangles
Commits
c352f1eb
Commit
c352f1eb
authored
5 years ago
by
BERTOT Yves
Browse files
Options
Downloads
Patches
Plain Diff
separates computations to make functions available in the polynomial ring
parent
e158ace5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
triangulation_algorithm.v
+40
-16
40 additions, 16 deletions
triangulation_algorithm.v
with
40 additions
and
16 deletions
triangulation_algorithm.v
+
40
−
16
View file @
c352f1eb
...
@@ -8,11 +8,46 @@ Set Implicit Arguments.
...
@@ -8,11 +8,46 @@ Set Implicit Arguments.
Unset
Strict
Implicit
.
Unset
Strict
Implicit
.
Unset
Printing
Implicit
Defensive
.
Unset
Printing
Implicit
Defensive
.
Section
num_computations
.
Variable
P
:
Type
.
Variable
R
:
unitRingType
.
Variables
coords
:
P
->
R
*
R
.
Definition
mkf3
(
T
:
Type
)
(
a
b
c
:
T
)
:=
[
ffun
i
:
'
I_3
=>
if
val
i
==
0
then
a
else
if
val
i
==
1
then
b
else
c
].
Notation
"<< a ; b ; c >>"
:=
(
mkf3
a
b
c
).
Definition
project_p
(
p
:
R
*
R
)
:
R
^
3
:=
[
ffun
i
=>
if
val
i
==
0
then
1
%
R
else
if
val
i
==
1
then
p
.1
else
p
.2
].
Definition
surface_mx
(
t
:
(
R
*
R
)
%
type
^
3
)
:=
(
\
matrix_
(
i
<
3
,
j
<
3
)
project_p
(
t
i
)
j
)
%
R
.
End
num_computations
.
Section
num_computations_comparison
.
Variable
P
:
Type
.
Variable
R
:
realDomainType
.
Variable
coords
:
P
->
R
*
R
.
Definition
ccw0
(
a
b
c
:
R
*
R
)
:=
(
0
<
\
det
(
surface_mx
(
mkf3
a
b
c
)))
%
R
.
Definition
ccw
(
a
b
c
:
P
)
:=
ccw0
(
coords
a
)
(
coords
b
)
(
coords
c
).
End
num_computations_comparison
.
Section
abstract_over_types
.
Section
abstract_over_types
.
Variable
P
:
finType
.
Variable
P
:
finType
.
Variable
R
:
num
DomainType
.
Variable
R
:
real
DomainType
.
Variable
coords
:
P
->
R
*
R
.
Variable
coords
:
P
->
R
*
R
.
...
@@ -22,20 +57,9 @@ Variable pick_set : {set P} -> option P.
...
@@ -22,20 +57,9 @@ Variable pick_set : {set P} -> option P.
Variable
pick_triangle
:
{
set
{
set
P
}}
->
P
->
option
{
set
P
}
.
Variable
pick_triangle
:
{
set
{
set
P
}}
->
P
->
option
{
set
P
}
.
Definition
mkf3
(
T
:
Type
)
(
a
b
c
:
T
)
:=
[
ffun
i
:
'
I_3
=>
if
val
i
==
0
then
a
else
if
val
i
==
1
then
b
else
c
].
Notation
"<< a ; b ; c >>"
:=
(
mkf3
a
b
c
).
Notation
"<< a ; b ; c >>"
:=
(
mkf3
a
b
c
).
Definition
project_p
(
p
:
P
)
:
R
^
3
:=
Notation
ccw
:=
(
ccw
coords
).
[
ffun
i
=>
if
val
i
==
0
then
1
%
R
else
if
val
i
==
1
then
(
coords
p
)
.1
else
(
coords
p
)
.2
].
Definition
surface_mx
(
t
:
P
^
3
)
:=
(
\
matrix_
(
i
<
3
,
j
<
3
)
project_p
(
t
i
)
j
)
%
R
.
Definition
ccw
(
a
b
c
:
P
)
:=
(
0
<
\
det
(
surface_mx
<<
a
;
b
;
c
>>
))
%
R
.
Definition
separated
(
t
:
{
set
P
}
)
(
q
p
:
P
)
:=
Definition
separated
(
t
:
{
set
P
}
)
(
q
p
:
P
)
:=
(
q
\
in
t
)
&&
(
q
\
in
t
)
&&
...
@@ -280,15 +304,15 @@ Definition naive_triangulate' (s : {set P}) := naive_triangulate #|s| s.
...
@@ -280,15 +304,15 @@ Definition naive_triangulate' (s : {set P}) := naive_triangulate #|s| s.
Definition
flip_edge
(
t1
t2
:
{
set
P
}
)
:=
Definition
flip_edge
(
t1
t2
:
{
set
P
}
)
:=
[
set
x
|:
(
t1
:
\
:
t2
)
:|:
(
t2
:
\
:
t1
)
|
x
in
t1
:&:
t2
].
[
set
x
|:
(
t1
:
\
:
t2
)
:|:
(
t2
:
\
:
t1
)
|
x
in
t1
:&:
t2
].
Definition
in_circle_l
(
p
:
P
)
:
R
^
4
:=
Definition
in_circle_l
(
p
:
R
*
R
)
:
R
^
4
:=
[
ffun
i
:
'
I_4
=>
[
ffun
i
:
'
I_4
=>
if
val
i
<
3
then
if
val
i
<
3
then
project_p
p
(
inord
i
)
project_p
p
(
inord
i
)
else
else
(
(
coords
p
)
.1
^+
2
+
(
coords
p
)
.2
^+
2
)
%
R
].
(
p
.1
^+
2
+
p
.2
^+
2
)
%
R
].
Definition
in_circle_mx
(
t
:
P
^
4
)
:=
Definition
in_circle_mx
(
t
:
P
^
4
)
:=
(
\
matrix_
(
i
<
4
,
j
<
4
)
in_circle_l
(
t
i
)
j
)
%
R
.
(
\
matrix_
(
i
<
4
,
j
<
4
)
in_circle_l
(
coords
(
t
i
)
)
j
)
%
R
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment