Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Julien Lopez
QueryR
Commits
aefbaff2
Commit
aefbaff2
authored
8 years ago
by
stepan
Browse files
Options
Downloads
Patches
Plain Diff
Remove debugging outputs from QuantileSearch
parent
81b03d96
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
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/QuantileSearch.java
+2
-17
2 additions, 17 deletions
.../oracle/truffle/r/runtime/nmath/distr/QuantileSearch.java
with
2 additions
and
17 deletions
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/QuantileSearch.java
+
2
−
17
View file @
aefbaff2
...
...
@@ -72,7 +72,6 @@ public final class QuantileSearch {
z
=
distributionFunc
.
eval
(
initialY
,
true
,
false
);
do
{
oldIncr
=
incr
;
debugPrintf
(
"QSearch step: result=%.12g, p=%.12g, incr=%.12g\n"
,
result
,
p
,
incr
);
result
=
search
(
result
,
p
,
incr
);
incr
=
RMath
.
fmax2
(
1
,
Math
.
floor
(
incr
/
incrDenominator
));
}
while
(
oldIncr
>
1
&&
incr
>
result
*
resultFactor
);
...
...
@@ -92,18 +91,16 @@ public final class QuantileSearch {
// are we to the left or right of the desired value -> move to the right or left to get
// closer
if
(
z
>=
p
)
{
debugPrintf
(
"--- QSearch left incr=%.12g\n"
,
incr
);
while
(
true
)
{
if
(
y
==
0
||
(
z
=
distributionFunc
E
val
(
y
-
incr
))
<
p
)
{
if
(
y
==
0
||
(
z
=
distributionFunc
.
e
val
(
y
-
incr
,
true
,
false
))
<
p
)
{
return
y
;
}
y
=
RMath
.
fmax2
(
0
,
y
-
incr
);
}
}
else
{
debugPrintf
(
"--- QSearch right incr=%.12g\n"
,
incr
);
while
(
true
)
{
y
=
moveRight
(
y
,
incr
);
if
((
rightSearchLimit
>
0
&&
y
==
rightSearchLimit
)
||
(
z
=
distributionFunc
E
val
(
y
))
>=
p
)
{
if
((
rightSearchLimit
>
0
&&
y
==
rightSearchLimit
)
||
(
z
=
distributionFunc
.
e
val
(
y
,
true
,
false
))
>=
p
)
{
return
y
;
}
}
...
...
@@ -118,20 +115,8 @@ public final class QuantileSearch {
}
}
private
double
distributionFuncEval
(
double
y
)
{
debugPrintf
(
"distributionFunc(%.12g) = "
,
y
);
double
result
=
distributionFunc
.
eval
(
y
,
true
,
false
);
debugPrintf
(
"%.12g\n"
,
result
);
return
result
;
}
@FunctionalInterface
public
interface
DistributionFunc
{
double
eval
(
double
quantile
,
boolean
lowerTail
,
boolean
logP
);
}
@SuppressWarnings
(
"unused"
)
private
static
void
debugPrintf
(
String
fmt
,
Object
...
args
)
{
// System.out.printf(fmt, args);
}
}
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