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.
27 lines
442 B
27 lines
442 B
module.exports = invert
|
|
|
|
/**
|
|
* Inverts a mat2
|
|
*
|
|
* @alias mat2.invert
|
|
* @param {mat2} out the receiving matrix
|
|
* @param {mat2} a the source matrix
|
|
* @returns {mat2} out
|
|
*/
|
|
function invert(out, a) {
|
|
var a0 = a[0]
|
|
var a1 = a[1]
|
|
var a2 = a[2]
|
|
var a3 = a[3]
|
|
var det = a0 * a3 - a2 * a1
|
|
|
|
if (!det) return null
|
|
det = 1.0 / det
|
|
|
|
out[0] = a3 * det
|
|
out[1] = -a1 * det
|
|
out[2] = -a2 * det
|
|
out[3] = a0 * det
|
|
|
|
return out
|
|
}
|
|
|