Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
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
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
7fb5dd57
Commit
7fb5dd57
authored
2 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Rename percentile to quantile
parent
6470cdb7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SimoxUtility/math/SoftMinMax.cpp
+8
-8
8 additions, 8 deletions
SimoxUtility/math/SoftMinMax.cpp
SimoxUtility/math/SoftMinMax.h
+8
-8
8 additions, 8 deletions
SimoxUtility/math/SoftMinMax.h
with
16 additions
and
16 deletions
SimoxUtility/math/SoftMinMax.cpp
+
8
−
8
View file @
7fb5dd57
...
...
@@ -13,29 +13,29 @@ namespace simox::math
reset
(
0
,
1
);
}
SoftMinMax
::
SoftMinMax
(
float
perce
ntile
,
std
::
size_t
numValues
)
SoftMinMax
::
SoftMinMax
(
float
qua
ntile
,
std
::
size_t
numValues
)
{
reset
(
perce
ntile
,
numValues
);
reset
(
qua
ntile
,
numValues
);
}
void
SoftMinMax
::
reset
(
float
perce
ntile
,
std
::
size_t
numValues
)
void
SoftMinMax
::
reset
(
float
qua
ntile
,
std
::
size_t
numValues
)
{
minQueue
=
MinQueue
();
maxQueue
=
MaxQueue
();
if
(
perce
ntile
<
0
||
perce
ntile
>
0.5
f
)
if
(
qua
ntile
<
0
||
qua
ntile
>
0.5
f
)
{
std
::
stringstream
msg
;
msg
<<
"
perce
ntile must be in [0, 0.5], but was "
<<
perce
ntile
<<
"."
;
msg
<<
"
The qua
ntile must be in [0, 0.5], but was "
<<
qua
ntile
<<
"."
;
throw
std
::
invalid_argument
(
msg
.
str
());
}
if
(
numValues
==
0
)
{
std
::
stringstream
msg
;
msg
<<
"numValues must be > 0, but was "
<<
numValues
;
msg
<<
"
The
numValues must be > 0, but was "
<<
numValues
;
throw
std
::
invalid_argument
(
msg
.
str
());
}
this
->
perce
ntile
=
perce
ntile
;
this
->
qua
ntile
=
qua
ntile
;
this
->
num_elements
=
numValues
;
allowed_heap_size_cache
=
allowedHeapSize
();
...
...
@@ -99,7 +99,7 @@ namespace simox::math
std
::
size_t
SoftMinMax
::
numOutsideSoftMinMax
()
const
{
return
size_t
(
std
::
ceil
(
perce
ntile
*
num_elements
));
return
size_t
(
std
::
ceil
(
qua
ntile
*
num_elements
));
}
std
::
size_t
SoftMinMax
::
allowedHeapSize
()
const
...
...
This diff is collapsed.
Click to expand it.
SimoxUtility/math/SoftMinMax.h
+
8
−
8
View file @
7fb5dd57
...
...
@@ -11,7 +11,7 @@ namespace simox::math
*
* Soft means that some values are allowed to be >= soft min / <= soft max
* (including the soft min/max), respectively.
* A
perce
ntile ar
gument
in [0..0.5] specifies the p
ercentage
of values
* A
qua
ntile
p
ar
ameter
in [0..0.5] specifies the p
roportion
of values
* which are allowed to excess the soft min/max.
*/
class
SoftMinMax
...
...
@@ -22,16 +22,16 @@ namespace simox::math
SoftMinMax
();
/**
* @brief Constructs a SoftMinMax for given
perce
ntile and number of values.
* @brief Constructs a SoftMinMax for given
qua
ntile and number of values.
*
* @param
perce
ntile
* The p
ercentage
of values that may excess the soft min/max. Must be in [0..0.5].
* @param
qua
ntile
* The p
roportion
of values that may excess the soft min/max. Must be in [0..0.5].
* @param numValues the total number of values that will be added. Must be > 0.
*
* @throws `std::invalid_argument`
* If one of the parameters value does not meet the requirements
*/
SoftMinMax
(
float
perce
ntile
,
std
::
size_t
numValues
);
SoftMinMax
(
float
qua
ntile
,
std
::
size_t
numValues
);
/**
* Reinitializes the SoftMinMax with the given arguments.
...
...
@@ -39,7 +39,7 @@ namespace simox::math
* @throws `std::invalid_argument`
* If one of the parameters value does not meet the requirements.
*/
void
reset
(
float
perce
ntile
,
std
::
size_t
numValues
);
void
reset
(
float
qua
ntile
,
std
::
size_t
numValues
);
/// Add a value to the considered collection.
/// @note Only values excessing the current soft min/max are stored.
...
...
@@ -62,8 +62,8 @@ namespace simox::math
std
::
size_t
allowedHeapSize
()
const
;
/// The
perce
ntile in [0, 0.5].
float
perce
ntile
=
0
;
/// The
qua
ntile in [0, 0.5].
float
qua
ntile
=
0
;
/// The number of elements to be added.
std
::
size_t
num_elements
=
0
;
...
...
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