Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Analyst WebApp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
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
fidentis
Analyst WebApp
Commits
493c71a2
There was an error fetching the commit references. Please try again later.
Commit
493c71a2
authored
3 years ago
by
Daniel Schramm
Browse files
Options
Downloads
Patches
Plain Diff
Variable renamed
parent
29b865b5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Comparison/src/main/java/cz/fidentis/analyst/visitors/face/WeightedAverageCollector.java
+8
-8
8 additions, 8 deletions
...entis/analyst/visitors/face/WeightedAverageCollector.java
with
8 additions
and
8 deletions
Comparison/src/main/java/cz/fidentis/analyst/visitors/face/WeightedAverageCollector.java
+
8
−
8
View file @
493c71a2
...
...
@@ -68,10 +68,10 @@ public class WeightedAverageCollector<T> implements Collector<T, IntemediateResu
*/
@Override
public
BiConsumer
<
IntemediateResults
,
T
>
accumulator
()
{
return
(
r
esult
,
streamElement
)
->
{
r
esult
.
weightedValSum
+=
valueFunction
.
applyAsDouble
(
streamElement
)
return
(
iR
esult
,
streamElement
)
->
{
iR
esult
.
weightedValSum
+=
valueFunction
.
applyAsDouble
(
streamElement
)
*
weightFunction
.
applyAsDouble
(
streamElement
);
r
esult
.
weightSum
+=
weightFunction
.
applyAsDouble
(
streamElement
);
iR
esult
.
weightSum
+=
weightFunction
.
applyAsDouble
(
streamElement
);
};
}
...
...
@@ -85,11 +85,11 @@ public class WeightedAverageCollector<T> implements Collector<T, IntemediateResu
*/
@Override
public
BinaryOperator
<
IntemediateResults
>
combiner
()
{
return
(
r
esult1
,
r
esult2
)
->
{
r
esult1
.
weightedValSum
+=
r
esult2
.
weightedValSum
;
r
esult1
.
weightSum
+=
r
esult2
.
weightSum
;
return
(
iR
esult1
,
iR
esult2
)
->
{
iR
esult1
.
weightedValSum
+=
iR
esult2
.
weightedValSum
;
iR
esult1
.
weightSum
+=
iR
esult2
.
weightSum
;
return
r
esult1
;
return
iR
esult1
;
};
}
...
...
@@ -108,7 +108,7 @@ public class WeightedAverageCollector<T> implements Collector<T, IntemediateResu
*/
@Override
public
Function
<
IntemediateResults
,
Double
>
finisher
()
{
return
r
esult
->
r
esult
.
weightedValSum
/
r
esult
.
weightSum
;
return
iR
esult
->
iR
esult
.
weightedValSum
/
iR
esult
.
weightSum
;
}
/**
...
...
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