StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
549 B
31 lines
549 B
/**
|
|
* Looping function for any framesize.
|
|
* Like fmod.
|
|
*
|
|
* @module mumath/loop
|
|
*
|
|
*/
|
|
|
|
'use strict';
|
|
module.exports = function (value, left, right) {
|
|
//detect single-arg case, like mod-loop or fmod
|
|
if (right === undefined) {
|
|
right = left;
|
|
left = 0;
|
|
}
|
|
|
|
//swap frame order
|
|
if (left > right) {
|
|
var tmp = right;
|
|
right = left;
|
|
left = tmp;
|
|
}
|
|
|
|
var frame = right - left;
|
|
|
|
value = ((value + left) % frame) - left;
|
|
if (value < left) value += frame;
|
|
if (value > right) value -= frame;
|
|
|
|
return value;
|
|
};
|
|
|