Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
qparse
qparselib
Commits
fbbef6e4
Commit
fbbef6e4
authored
Aug 04, 2021
by
Florent Jacquemard
Browse files
Distance: type rtu_t
parent
53b145c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/weight/Distance.hpp
View file @
fbbef6e4
...
...
@@ -15,6 +15,7 @@
#include <stdio.h>
#include "trace.hpp"
#include "RTU.hpp"
#include "AlignedInterval.hpp"
#include "Weight.hpp"
#include "TropicalWeight.hpp"
...
...
@@ -31,7 +32,7 @@ class Distance: public TropicalWeight
{
public:
/// defaut = null distance - not unknown
Distance
(
double
d
=
0.0
)
:
TropicalWeight
(
d
)
{
}
Distance
(
rtu_t
d
=
0.0
)
:
TropicalWeight
(
d
)
{
}
/// weight which is the distance defined by alignment for input segment
/// not unknown.
...
...
@@ -45,7 +46,7 @@ public:
virtual
Distance
*
clone
()
const
;
inline
virtual
Weight
make
(
double
v
)
const
inline
virtual
Weight
make
(
rtu_t
v
)
const
{
assert
(
v
>
0
);
return
Weight
(
new
Distance
(
v
));
}
inline
static
Weight
make_zero
()
...
...
@@ -80,17 +81,17 @@ protected:
// vector length
//int _dim;
//vector<
double
> _dist;
//vector<
rtu_t
> _dist;
private:
/// distance to the closest point before j not at the same rdate as j.
double
dist_prev
(
const
InputSegment
*
s
,
size_t
j
);
rtu_t
dist_prev
(
const
InputSegment
*
s
,
size_t
j
);
/// distance to the closest point after j not at the same rdate as j.
double
dist_next
(
const
InputSegment
*
s
,
size_t
j
);
rtu_t
dist_next
(
const
InputSegment
*
s
,
size_t
j
);
/// sum of the 2 above or 1 if sum is null.
double
distcoeff
(
const
InputSegment
*
s
,
size_t
j
);
rtu_t
distcoeff
(
const
InputSegment
*
s
,
size_t
j
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment