Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
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
keyboard
LatinIME
Commits
07711c10
Commit
07711c10
authored
12 years ago
by
Ken Wakasa
Browse files
Options
Downloads
Patches
Plain Diff
Tidy up GeometryUtils a bit
Change-Id: I33f4042265c0dcc2530cee43c610f73ec99c6792
parent
997cba7d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
native/jni/src/geometry_utils.h
+6
-5
6 additions, 5 deletions
native/jni/src/geometry_utils.h
with
6 additions
and
5 deletions
native/jni/src/geometry_utils.h
+
6
−
5
View file @
07711c10
...
@@ -54,7 +54,7 @@ static AK_FORCE_INLINE int getDistanceInt(const int x1, const int y1, const int
...
@@ -54,7 +54,7 @@ static AK_FORCE_INLINE int getDistanceInt(const int x1, const int y1, const int
static
AK_FORCE_INLINE
float
getAngle
(
const
int
x1
,
const
int
y1
,
const
int
x2
,
const
int
y2
)
{
static
AK_FORCE_INLINE
float
getAngle
(
const
int
x1
,
const
int
y1
,
const
int
x2
,
const
int
y2
)
{
const
int
dx
=
x1
-
x2
;
const
int
dx
=
x1
-
x2
;
const
int
dy
=
y1
-
y2
;
const
int
dy
=
y1
-
y2
;
if
(
dx
==
0
&&
dy
==
0
)
return
0
;
if
(
dx
==
0
&&
dy
==
0
)
return
0
.0
f
;
return
atan2f
(
static_cast
<
float
>
(
dy
),
static_cast
<
float
>
(
dx
));
return
atan2f
(
static_cast
<
float
>
(
dy
),
static_cast
<
float
>
(
dx
));
}
}
...
@@ -96,6 +96,7 @@ static inline float pointToLineSegSquaredDistanceFloat(const float x, const floa
...
@@ -96,6 +96,7 @@ static inline float pointToLineSegSquaredDistanceFloat(const float x, const floa
// Normal distribution N(u, sigma^2).
// Normal distribution N(u, sigma^2).
struct
NormalDistribution
{
struct
NormalDistribution
{
public:
NormalDistribution
(
const
float
u
,
const
float
sigma
)
NormalDistribution
(
const
float
u
,
const
float
sigma
)
:
mU
(
u
),
mSigma
(
sigma
),
:
mU
(
u
),
mSigma
(
sigma
),
mPreComputedNonExpPart
(
1.0
f
/
sqrtf
(
2.0
f
*
M_PI_F
*
SQUARE_FLOAT
(
sigma
))),
mPreComputedNonExpPart
(
1.0
f
/
sqrtf
(
2.0
f
*
M_PI_F
*
SQUARE_FLOAT
(
sigma
))),
...
@@ -108,10 +109,10 @@ struct NormalDistribution {
...
@@ -108,10 +109,10 @@ struct NormalDistribution {
private
:
private
:
DISALLOW_IMPLICIT_CONSTRUCTORS
(
NormalDistribution
);
DISALLOW_IMPLICIT_CONSTRUCTORS
(
NormalDistribution
);
float
mU
;
// mean value
const
float
mU
;
// mean value
float
mSigma
;
// standard deviation
const
float
mSigma
;
// standard deviation
float
mPreComputedNonExpPart
;
// = 1 / sqrt(2 * PI * sigma^2)
const
float
mPreComputedNonExpPart
;
// = 1 / sqrt(2 * PI * sigma^2)
float
mPreComputedExponentPart
;
// = -1 / (2 * sigma^2)
const
float
mPreComputedExponentPart
;
// = -1 / (2 * sigma^2)
};
// struct NormalDistribution
};
// struct NormalDistribution
}
// namespace latinime
}
// namespace latinime
#endif // LATINIME_GEOMETRY_UTILS_H
#endif // LATINIME_GEOMETRY_UTILS_H
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