Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aevol-eukaryotes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
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
LUISELLI Juliette
aevol-eukaryotes
Commits
03df9fe9
Commit
03df9fe9
authored
5 years ago
by
ROUZAUD-CORNABAS Jonathan
Browse files
Options
Downloads
Patches
Plain Diff
Fix rounding error in Fuzzy
parent
16a72f7d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libaevol/Fuzzy.cpp
+8
-5
8 additions, 5 deletions
src/libaevol/Fuzzy.cpp
src/libaevol/macros.h
+1
-0
1 addition, 0 deletions
src/libaevol/macros.h
with
9 additions
and
5 deletions
src/libaevol/Fuzzy.cpp
+
8
−
5
View file @
03df9fe9
...
...
@@ -107,8 +107,6 @@ ProteinConcentration Fuzzy::x(const Point& p1, const Point& p2, ProteinConcentra
assert
(
p1
.
y
!=
p2
.
y
);
ProteinConcentration
x
=
p1
.
x
+
(
y
-
p1
.
y
)
*
(
p2
.
x
-
p1
.
x
)
/
(
p2
.
y
-
p1
.
y
);
assert
((
p2
.
x
<=
x
and
x
<=
p1
.
x
)
or
(
p1
.
x
<=
x
and
x
<=
p2
.
x
));
return
x
;
}
...
...
@@ -360,9 +358,14 @@ void Fuzzy::clip(clipping_direction direction, ProteinConcentration bound) {
(
p
->
y
>
bound
and
bound
>
next
(
p
)
->
y
)))
{
// ie if p and next(p) are across bound
// insert interpolated point
// *after* p
points_
.
insert
(
next
(
p
),
Point
(
x
(
*
p
,
*
next
(
p
),
bound
),
bound
));
// could now fast forward over created point... TODO?
Point
pt
=
Point
(
x
(
*
p
,
*
next
(
p
),
bound
),
bound
);
if
((
round
(
pt
.
x
*
FUZZY_ROUNDING
)
!=
round
((
*
next
(
p
)).
x
*
FUZZY_ROUNDING
))
&&
(
round
(
pt
.
x
*
FUZZY_ROUNDING
)
!=
round
((
*
p
).
x
*
FUZZY_ROUNDING
)))
{
points_
.
insert
(
next
(
p
),
pt
);
// could now fast forward over created point... TODO?
}
}
if
((
direction
==
clipping_direction
::
min
and
p
->
y
<
bound
)
or
(
direction
==
clipping_direction
::
max
and
p
->
y
>
bound
))
...
...
This diff is collapsed.
Click to expand it.
src/libaevol/macros.h
+
1
−
0
View file @
03df9fe9
...
...
@@ -110,6 +110,7 @@ constexpr double H_MIN = -1.0;
constexpr
double
H_MAX
=
1.0
;
constexpr
double
W_MIN
=
0.0
;
// W_MAX is defined through a parameter
constexpr
double
FUZZY_ROUNDING
=
1000000000000.0
;
constexpr
int8_t
SC_MATCH_BONUS
=
1
;
constexpr
int8_t
SC_MISMATCH_COST
=
2
;
...
...
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