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.
22 lines
692 B
22 lines
692 B
module.exports = equals
|
|
|
|
var EPSILON = require('./epsilon')
|
|
|
|
/**
|
|
* Returns whether or not the vectors have approximately the same elements in the same position.
|
|
*
|
|
* @param {vec3} a The first vector.
|
|
* @param {vec3} b The second vector.
|
|
* @returns {Boolean} True if the vectors are equal, false otherwise.
|
|
*/
|
|
function equals(a, b) {
|
|
var a0 = a[0]
|
|
var a1 = a[1]
|
|
var a2 = a[2]
|
|
var b0 = b[0]
|
|
var b1 = b[1]
|
|
var b2 = b[2]
|
|
return (Math.abs(a0 - b0) <= EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&
|
|
Math.abs(a1 - b1) <= EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&
|
|
Math.abs(a2 - b2) <= EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)))
|
|
}
|
|
|