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
647 B
31 lines
647 B
'use strict'
|
|
|
|
var compareCell = require('compare-cell')
|
|
var compareOrientedCell = require('compare-oriented-cell')
|
|
var orientation = require('cell-orientation')
|
|
|
|
module.exports = reduceCellComplex
|
|
|
|
function reduceCellComplex(cells) {
|
|
cells.sort(compareOrientedCell)
|
|
var n = cells.length
|
|
var ptr = 0
|
|
for(var i=0; i<n; ++i) {
|
|
var c = cells[i]
|
|
var o = orientation(c)
|
|
if(o === 0) {
|
|
continue
|
|
}
|
|
if(ptr > 0) {
|
|
var f = cells[ptr-1]
|
|
if(compareCell(c, f) === 0 &&
|
|
orientation(f) !== o) {
|
|
ptr -= 1
|
|
continue
|
|
}
|
|
}
|
|
cells[ptr++] = c
|
|
}
|
|
cells.length = ptr
|
|
return cells
|
|
}
|
|
|