LJ/www/build/clmtrackr.js

15326 lines
1.6 MiB
JavaScript
Raw Normal View History

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.clm = factory());
}(this, (function () { 'use strict';
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var numeric1_2_6 = createCommonjsModule(function (module, exports) {
"use strict";
var numeric = exports;
if(typeof commonjsGlobal !== "undefined") { commonjsGlobal.numeric = numeric; }
numeric.version = "1.2.6";
// 1. Utility functions
numeric.bench = function bench (f,interval) {
var t1,t2,n,i;
if(typeof interval === "undefined") { interval = 15; }
n = 0.5;
t1 = new Date();
while(1) {
n*=2;
for(i=n;i>3;i-=4) { f(); f(); f(); f(); }
while(i>0) { f(); i--; }
t2 = new Date();
if(t2-t1 > interval) break;
}
for(i=n;i>3;i-=4) { f(); f(); f(); f(); }
while(i>0) { f(); i--; }
t2 = new Date();
return 1000*(3*n-1)/(t2-t1);
};
numeric._myIndexOf = (function _myIndexOf(w) {
var n = this.length,k;
for(k=0;k<n;++k) if(this[k]===w) return k;
return -1;
});
numeric.myIndexOf = (Array.prototype.indexOf)?Array.prototype.indexOf:numeric._myIndexOf;
numeric.Function = Function;
numeric.precision = 4;
numeric.largeArray = 50;
numeric.prettyPrint = function prettyPrint(x) {
function fmtnum(x) {
if(x === 0) { return '0'; }
if(isNaN(x)) { return 'NaN'; }
if(x<0) { return '-'+fmtnum(-x); }
if(isFinite(x)) {
var scale = Math.floor(Math.log(x) / Math.log(10));
var normalized = x / Math.pow(10,scale);
var basic = normalized.toPrecision(numeric.precision);
if(parseFloat(basic) === 10) { scale++; normalized = 1; basic = normalized.toPrecision(numeric.precision); }
return parseFloat(basic).toString()+'e'+scale.toString();
}
return 'Infinity';
}
var ret = [];
function foo(x) {
var k;
if(typeof x === "undefined") { ret.push(Array(numeric.precision+8).join(' ')); return false; }
if(typeof x === "string") { ret.push('"'+x+'"'); return false; }
if(typeof x === "boolean") { ret.push(x.toString()); return false; }
if(typeof x === "number") {
var a = fmtnum(x);
var b = x.toPrecision(numeric.precision);
var c = parseFloat(x.toString()).toString();
var d = [a,b,c,parseFloat(b).toString(),parseFloat(c).toString()];
for(k=1;k<d.length;k++) { if(d[k].length < a.length) a = d[k]; }
ret.push(Array(numeric.precision+8-a.length).join(' ')+a);
return false;
}
if(x === null) { ret.push("null"); return false; }
if(typeof x === "function") {
ret.push(x.toString());
var flag = false;
for(k in x) { if(x.hasOwnProperty(k)) {
if(flag) ret.push(',\n');
else ret.push('\n{');
flag = true;
ret.push(k);
ret.push(': \n');
foo(x[k]);
} }
if(flag) ret.push('}\n');
return true;
}
if(x instanceof Array) {
if(x.length > numeric.largeArray) { ret.push('...Large Array...'); return true; }
var flag = false;
ret.push('[');
for(k=0;k<x.length;k++) { if(k>0) { ret.push(','); if(flag) ret.push('\n '); } flag = foo(x[k]); }
ret.push(']');
return true;
}
ret.push('{');
var flag = false;
for(k in x) { if(x.hasOwnProperty(k)) { if(flag) ret.push(',\n'); flag = true; ret.push(k); ret.push(': \n'); foo(x[k]); } }
ret.push('}');
return true;
}
foo(x);
return ret.join('');
};
numeric.parseDate = function parseDate(d) {
function foo(d) {
if(typeof d === 'string') { return Date.parse(d.replace(/-/g,'/')); }
if(!(d instanceof Array)) { throw new Error("parseDate: parameter must be arrays of strings"); }
var ret = [],k;
for(k=0;k<d.length;k++) { ret[k] = foo(d[k]); }
return ret;
}
return foo(d);
};
numeric.parseFloat = function parseFloat_(d) {
function foo(d) {
if(typeof d === 'string') { return parseFloat(d); }
if(!(d instanceof Array)) { throw new Error("parseFloat: parameter must be arrays of strings"); }
var ret = [],k;
for(k=0;k<d.length;k++) { ret[k] = foo(d[k]); }
return ret;
}
return foo(d);
};
numeric.parseCSV = function parseCSV(t) {
var foo = t.split('\n');
var j,k;
var ret = [];
var pat = /(([^'",]*)|('[^']*')|("[^"]*")),/g;
var patnum = /^\s*(([+-]?[0-9]+(\.[0-9]*)?(e[+-]?[0-9]+)?)|([+-]?[0-9]*(\.[0-9]+)?(e[+-]?[0-9]+)?))\s*$/;
var stripper = function(n) { return n.substr(0,n.length-1); };
var count = 0;
for(k=0;k<foo.length;k++) {
var bar = (foo[k]+",").match(pat),baz;
if(bar.length>0) {
ret[count] = [];
for(j=0;j<bar.length;j++) {
baz = stripper(bar[j]);
if(patnum.test(baz)) { ret[count][j] = parseFloat(baz); }
else ret[count][j] = baz;
}
count++;
}
}
return ret;
};
numeric.toCSV = function toCSV(A) {
var s = numeric.dim(A);
var i,j,m,n,row,ret;
m = s[0];
n = s[1];
ret = [];
for(i=0;i<m;i++) {
row = [];
for(j=0;j<m;j++) { row[j] = A[i][j].toString(); }
ret[i] = row.join(', ');
}
return ret.join('\n')+'\n';
};
numeric.getURL = function getURL(url) {
var client = new XMLHttpRequest();
client.open("GET",url,false);
client.send();
return client;
};
numeric.imageURL = function imageURL(img) {
function base64(A) {
var n = A.length, i,x,y,z,p,q,r,s;
var key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var ret = "";
for(i=0;i<n;i+=3) {
x = A[i];
y = A[i+1];
z = A[i+2];
p = x >> 2;
q = ((x & 3) << 4) + (y >> 4);
r = ((y & 15) << 2) + (z >> 6);
s = z & 63;
if(i+1>=n) { r = s = 64; }
else if(i+2>=n) { s = 64; }
ret += key.charAt(p) + key.charAt(q) + key.charAt(r) + key.charAt(s);
}
return ret;
}
function crc32Array (a,from,to) {
if(typeof from === "undefined") { from = 0; }
if(typeof to === "undefined") { to = a.length; }
var table = [0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D];
var crc = -1, y = 0, n = a.length,i;
for (i = from; i < to; i++) {
y = (crc ^ a[i]) & 0xFF;
crc = (crc >>> 8) ^ table[y];
}
return crc ^ (-1);
}
var h = img[0].length, w = img[0][0].length, s1, s2, next,k,length,a,b,i,j,adler32,crc32;
var stream = [
137, 80, 78, 71, 13, 10, 26, 10, // 0: PNG signature
0,0,0,13, // 8: IHDR Chunk length
73, 72, 68, 82, // 12: "IHDR"
(w >> 24) & 255, (w >> 16) & 255, (w >> 8) & 255, w&255, // 16: Width
(h >> 24) & 255, (h >> 16) & 255, (h >> 8) & 255, h&255, // 20: Height
8, // 24: bit depth
2, // 25: RGB
0, // 26: deflate
0, // 27: no filter
0, // 28: no interlace
-1,-2,-3,-4, // 29: CRC
-5,-6,-7,-8, // 33: IDAT Chunk length
73, 68, 65, 84, // 37: "IDAT"
// RFC 1950 header starts here
8, // 41: RFC1950 CMF
29 // 42: RFC1950 FLG
];
crc32 = crc32Array(stream,12,29);
stream[29] = (crc32>>24)&255;
stream[30] = (crc32>>16)&255;
stream[31] = (crc32>>8)&255;
stream[32] = (crc32)&255;
s1 = 1;
s2 = 0;
for(i=0;i<h;i++) {
if(i<h-1) { stream.push(0); }
else { stream.push(1); }
a = (3*w+1+(i===0))&255; b = ((3*w+1+(i===0))>>8)&255;
stream.push(a); stream.push(b);
stream.push((~a)&255); stream.push((~b)&255);
if(i===0) stream.push(0);
for(j=0;j<w;j++) {
for(k=0;k<3;k++) {
a = img[k][i][j];
if(a>255) a = 255;
else if(a<0) a=0;
else a = Math.round(a);
s1 = (s1 + a )%65521;
s2 = (s2 + s1)%65521;
stream.push(a);
}
}
stream.push(0);
}
adler32 = (s2<<16)+s1;
stream.push((adler32>>24)&255);
stream.push((adler32>>16)&255);
stream.push((adler32>>8)&255);
stream.push((adler32)&255);
length = stream.length - 41;
stream[33] = (length>>24)&255;
stream[34] = (length>>16)&255;
stream[35] = (length>>8)&255;
stream[36] = (length)&255;
crc32 = crc32Array(stream,37);
stream.push((crc32>>24)&255);
stream.push((crc32>>16)&255);
stream.push((crc32>>8)&255);
stream.push((crc32)&255);
stream.push(0);
stream.push(0);
stream.push(0);
stream.push(0);
// a = stream.length;
stream.push(73); // I
stream.push(69); // E
stream.push(78); // N
stream.push(68); // D
stream.push(174); // CRC1
stream.push(66); // CRC2
stream.push(96); // CRC3
stream.push(130); // CRC4
return 'data:image/png;base64,'+base64(stream);
};
// 2. Linear algebra with Arrays.
numeric._dim = function _dim(x) {
var ret = [];
while(typeof x === "object") { ret.push(x.length); x = x[0]; }
return ret;
};
numeric.dim = function dim(x) {
var y,z;
if(typeof x === "object") {
y = x[0];
if(typeof y === "object") {
z = y[0];
if(typeof z === "object") {
return numeric._dim(x);
}
return [x.length,y.length];
}
return [x.length];
}
return [];
};
numeric.mapreduce = function mapreduce(body,init) {
return Function('x','accum','_s','_k',
'if(typeof accum === "undefined") accum = '+init+';\n'+
'if(typeof x === "number") { var xi = x; '+body+'; return accum; }\n'+
'if(typeof _s === "undefined") _s = numeric.dim(x);\n'+
'if(typeof _k === "undefined") _k = 0;\n'+
'var _n = _s[_k];\n'+
'var i,xi;\n'+
'if(_k < _s.length-1) {\n'+
' for(i=_n-1;i>=0;i--) {\n'+
' accum = arguments.callee(x[i],accum,_s,_k+1);\n'+
' }'+
' return accum;\n'+
'}\n'+
'for(i=_n-1;i>=1;i-=2) { \n'+
' xi = x[i];\n'+
' '+body+';\n'+
' xi = x[i-1];\n'+
' '+body+';\n'+
'}\n'+
'if(i === 0) {\n'+
' xi = x[i];\n'+
' '+body+'\n'+
'}\n'+
'return accum;'
);
};
numeric.mapreduce2 = function mapreduce2(body,setup) {
return Function('x',
'var n = x.length;\n'+
'var i,xi;\n'+setup+';\n'+
'for(i=n-1;i!==-1;--i) { \n'+
' xi = x[i];\n'+
' '+body+';\n'+
'}\n'+
'return accum;'
);
};
numeric.same = function same(x,y) {
var i,n;
if(!(x instanceof Array) || !(y instanceof Array)) { return false; }
n = x.length;
if(n !== y.length) { return false; }
for(i=0;i<n;i++) {
if(x[i] === y[i]) { continue; }
if(typeof x[i] === "object") { if(!same(x[i],y[i])) return false; }
else { return false; }
}
return true;
};
numeric.rep = function rep(s,v,k) {
if(typeof k === "undefined") { k=0; }
var n = s[k], ret = Array(n), i;
if(k === s.length-1) {
for(i=n-2;i>=0;i-=2) { ret[i+1] = v; ret[i] = v; }
if(i===-1) { ret[0] = v; }
return ret;
}
for(i=n-1;i>=0;i--) { ret[i] = numeric.rep(s,v,k+1); }
return ret;
};
numeric.dotMMsmall = function dotMMsmall(x,y) {
var i,j,k,p,q,r,ret,foo,bar,woo,i0,k0,p0,r0;
p = x.length; q = y.length; r = y[0].length;
ret = Array(p);
for(i=p-1;i>=0;i--) {
foo = Array(r);
bar = x[i];
for(k=r-1;k>=0;k--) {
woo = bar[q-1]*y[q-1][k];
for(j=q-2;j>=1;j-=2) {
i0 = j-1;
woo += bar[j]*y[j][k] + bar[i0]*y[i0][k];
}
if(j===0) { woo += bar[0]*y[0][k]; }
foo[k] = woo;
}
ret[i] = foo;
}
return ret;
};
numeric._getCol = function _getCol(A,j,x) {
var n = A.length, i;
for(i=n-1;i>0;--i) {
x[i] = A[i][j];
--i;
x[i] = A[i][j];
}
if(i===0) x[0] = A[0][j];
};
numeric.dotMMbig = function dotMMbig(x,y){
var gc = numeric._getCol, p = y.length, v = Array(p);
var m = x.length, n = y[0].length, A = new Array(m), xj;
var VV = numeric.dotVV;
var i,j,k,z;
--p;
--m;
for(i=m;i!==-1;--i) A[i] = Array(n);
--n;
for(i=n;i!==-1;--i) {
gc(y,i,v);
for(j=m;j!==-1;--j) {
z=0;
xj = x[j];
A[j][i] = VV(xj,v);
}
}
return A;
};
numeric.dotMV = function dotMV(x,y) {
var p = x.length, q = y.length,i;
var ret = Array(p), dotVV = numeric.dotVV;
for(i=p-1;i>=0;i--) { ret[i] = dotVV(x[i],y); }
return ret;
};
numeric.dotVM = function dotVM(x,y) {
var i,j,k,p,q,r,ret,foo,bar,woo,i0,k0,p0,r0,s1,s2,s3,baz,accum;
p = x.length; q = y[0].length;
ret = Array(q);
for(k=q-1;k>=0;k--) {
woo = x[p-1]*y[p-1][k];
for(j=p-2;j>=1;j-=2) {
i0 = j-1;
woo += x[j]*y[j][k] + x[i0]*y[i0][k];
}
if(j===0) { woo += x[0]*y[0][k]; }
ret[k] = woo;
}
return ret;
};
numeric.dotVV = function dotVV(x,y) {
var i,n=x.length,i1,ret = x[n-1]*y[n-1];
for(i=n-2;i>=1;i-=2) {
i1 = i-1;
ret += x[i]*y[i] + x[i1]*y[i1];
}
if(i===0) { ret += x[0]*y[0]; }
return ret;
};
numeric.dot = function dot(x,y) {
var d = numeric.dim;
switch(d(x).length*1000+d(y).length) {
case 2002:
if(y.length < 10) return numeric.dotMMsmall(x,y);
else return numeric.dotMMbig(x,y);
case 2001: return numeric.dotMV(x,y);
case 1002: return numeric.dotVM(x,y);
case 1001: return numeric.dotVV(x,y);
case 1000: return numeric.mulVS(x,y);
case 1: return numeric.mulSV(x,y);
case 0: return x*y;
default: throw new Error('numeric.dot only works on vectors and matrices');
}
};
numeric.diag = function diag(d) {
var i,i1,j,n = d.length, A = Array(n), Ai;
for(i=n-1;i>=0;i--) {
Ai = Array(n);
i1 = i+2;
for(j=n-1;j>=i1;j-=2) {
Ai[j] = 0;
Ai[j-1] = 0;
}
if(j>i) { Ai[j] = 0; }
Ai[i] = d[i];
for(j=i-1;j>=1;j-=2) {
Ai[j] = 0;
Ai[j-1] = 0;
}
if(j===0) { Ai[0] = 0; }
A[i] = Ai;
}
return A;
};
numeric.getDiag = function(A) {
var n = Math.min(A.length,A[0].length),i,ret = Array(n);
for(i=n-1;i>=1;--i) {
ret[i] = A[i][i];
--i;
ret[i] = A[i][i];
}
if(i===0) {
ret[0] = A[0][0];
}
return ret;
};
numeric.identity = function identity(n) { return numeric.diag(numeric.rep([n],1)); };
numeric.pointwise = function pointwise(params,body,setup) {
if(typeof setup === "undefined") { setup = ""; }
var fun = [];
var k;
var avec = /\[i\]$/,p,thevec = '';
var haveret = false;
for(k=0;k<params.length;k++) {
if(avec.test(params[k])) {
p = params[k].substring(0,params[k].length-3);
thevec = p;
} else { p = params[k]; }
if(p==='ret') haveret = true;
fun.push(p);
}
fun[params.length] = '_s';
fun[params.length+1] = '_k';
fun[params.length+2] = (
'if(typeof _s === "undefined") _s = numeric.dim('+thevec+');\n'+
'if(typeof _k === "undefined") _k = 0;\n'+
'var _n = _s[_k];\n'+
'var i'+(haveret?'':', ret = Array(_n)')+';\n'+
'if(_k < _s.length-1) {\n'+
' for(i=_n-1;i>=0;i--) ret[i] = arguments.callee('+params.join(',')+',_s,_k+1);\n'+
' return ret;\n'+
'}\n'+
setup+'\n'+
'for(i=_n-1;i!==-1;--i) {\n'+
' '+body+'\n'+
'}\n'+
'return ret;'
);
return Function.apply(null,fun);
};
numeric.pointwise2 = function pointwise2(params,body,setup) {
if(typeof setup === "undefined") { setup = ""; }
var fun = [];
var k;
var avec = /\[i\]$/,p,thevec = '';
var haveret = false;
for(k=0;k<params.length;k++) {
if(avec.test(params[k])) {
p = params[k].substring(0,params[k].length-3);
thevec = p;
} else { p = params[k]; }
if(p==='ret') haveret = true;
fun.push(p);
}
fun[params.length] = (
'var _n = '+thevec+'.length;\n'+
'var i'+(haveret?'':', ret = Array(_n)')+';\n'+
setup+'\n'+
'for(i=_n-1;i!==-1;--i) {\n'+
body+'\n'+
'}\n'+
'return ret;'
);
return Function.apply(null,fun);
};
numeric._biforeach = (function _biforeach(x,y,s,k,f) {
if(k === s.length-1) { f(x,y); return; }
var i,n=s[k];
for(i=n-1;i>=0;i--) { _biforeach(typeof x==="object"?x[i]:x,typeof y==="object"?y[i]:y,s,k+1,f); }
});
numeric._biforeach2 = (function _biforeach2(x,y,s,k,f) {
if(k === s.length-1) { return f(x,y); }
var i,n=s[k],ret = Array(n);
for(i=n-1;i>=0;--i) { ret[i] = _biforeach2(typeof x==="object"?x[i]:x,typeof y==="object"?y[i]:y,s,k+1,f); }
return ret;
});
numeric._foreach = (function _foreach(x,s,k,f) {
if(k === s.length-1) { f(x); return; }
var i,n=s[k];
for(i=n-1;i>=0;i--) { _foreach(x[i],s,k+1,f); }
});
numeric._foreach2 = (function _foreach2(x,s,k,f) {
if(k === s.length-1) { return f(x); }
var i,n=s[k], ret = Array(n);
for(i=n-1;i>=0;i--) { ret[i] = _foreach2(x[i],s,k+1,f); }
return ret;
});
/*numeric.anyV = numeric.mapreduce('if(xi) return true;','false');
numeric.allV = numeric.mapreduce('if(!xi) return false;','true');
numeric.any = function(x) { if(typeof x.length === "undefined") return x; return numeric.anyV(x); }
numeric.all = function(x) { if(typeof x.length === "undefined") return x; return numeric.allV(x); }*/
numeric.ops2 = {
add: '+',
sub: '-',
mul: '*',
div: '/',
mod: '%',
and: '&&',
or: '||',
eq: '===',
neq: '!==',
lt: '<',
gt: '>',
leq: '<=',
geq: '>=',
band: '&',
bor: '|',
bxor: '^',
lshift: '<<',
rshift: '>>',
rrshift: '>>>'
};
numeric.opseq = {
addeq: '+=',
subeq: '-=',
muleq: '*=',
diveq: '/=',
modeq: '%=',
lshifteq: '<<=',
rshifteq: '>>=',
rrshifteq: '>>>=',
bandeq: '&=',
boreq: '|=',
bxoreq: '^='
};
numeric.mathfuns = ['abs','acos','asin','atan','ceil','cos',
'exp','floor','log','round','sin','sqrt','tan',
'isNaN','isFinite'];
numeric.mathfuns2 = ['atan2','pow','max','min'];
numeric.ops1 = {
neg: '-',
not: '!',
bnot: '~',
clone: ''
};
numeric.mapreducers = {
any: ['if(xi) return true;','var accum = false;'],
all: ['if(!xi) return false;','var accum = true;'],
sum: ['accum += xi;','var accum = 0;'],
prod: ['accum *= xi;','var accum = 1;'],
norm2Squared: ['accum += xi*xi;','var accum = 0;'],
norminf: ['accum = max(accum,abs(xi));','var accum = 0, max = Math.max, abs = Math.abs;'],
norm1: ['accum += abs(xi)','var accum = 0, abs = Math.abs;'],
sup: ['accum = max(accum,xi);','var accum = -Infinity, max = Math.max;'],
inf: ['accum = min(accum,xi);','var accum = Infinity, min = Math.min;']
};
(function () {
var i,o;
for(i=0;i<numeric.mathfuns2.length;++i) {
o = numeric.mathfuns2[i];
numeric.ops2[o] = o;
}
for(i in numeric.ops2) {
if(numeric.ops2.hasOwnProperty(i)) {
o = numeric.ops2[i];
var code, codeeq, setup = '';
if(numeric.myIndexOf.call(numeric.mathfuns2,i)!==-1) {
setup = 'var '+o+' = Math.'+o+';\n';
code = function(r,x,y) { return r+' = '+o+'('+x+','+y+')'; };
codeeq = function(x,y) { return x+' = '+o+'('+x+','+y+')'; };
} else {
code = function(r,x,y) { return r+' = '+x+' '+o+' '+y; };
if(numeric.opseq.hasOwnProperty(i+'eq')) {
codeeq = function(x,y) { return x+' '+o+'= '+y; };
} else {
codeeq = function(x,y) { return x+' = '+x+' '+o+' '+y; };
}
}
numeric[i+'VV'] = numeric.pointwise2(['x[i]','y[i]'],code('ret[i]','x[i]','y[i]'),setup);
numeric[i+'SV'] = numeric.pointwise2(['x','y[i]'],code('ret[i]','x','y[i]'),setup);
numeric[i+'VS'] = numeric.pointwise2(['x[i]','y'],code('ret[i]','x[i]','y'),setup);
numeric[i] = Function(
'var n = arguments.length, i, x = arguments[0], y;\n'+
'var VV = numeric.'+i+'VV, VS = numeric.'+i+'VS, SV = numeric.'+i+'SV;\n'+
'var dim = numeric.dim;\n'+
'for(i=1;i!==n;++i) { \n'+
' y = arguments[i];\n'+
' if(typeof x === "object") {\n'+
' if(typeof y === "object") x = numeric._biforeach2(x,y,dim(x),0,VV);\n'+
' else x = numeric._biforeach2(x,y,dim(x),0,VS);\n'+
' } else if(typeof y === "object") x = numeric._biforeach2(x,y,dim(y),0,SV);\n'+
' else '+codeeq('x','y')+'\n'+
'}\nreturn x;\n');
numeric[o] = numeric[i];
numeric[i+'eqV'] = numeric.pointwise2(['ret[i]','x[i]'], codeeq('ret[i]','x[i]'),setup);
numeric[i+'eqS'] = numeric.pointwise2(['ret[i]','x'], codeeq('ret[i]','x'),setup);
numeric[i+'eq'] = Function(
'var n = arguments.length, i, x = arguments[0], y;\n'+
'var V = numeric.'+i+'eqV, S = numeric.'+i+'eqS\n'+
'var s = numeric.dim(x);\n'+
'for(i=1;i!==n;++i) { \n'+
' y = arguments[i];\n'+
' if(typeof y === "object") numeric._biforeach(x,y,s,0,V);\n'+
' else numeric._biforeach(x,y,s,0,S);\n'+
'}\nreturn x;\n');
}
}
for(i=0;i<numeric.mathfuns2.length;++i) {
o = numeric.mathfuns2[i];
delete numeric.ops2[o];
}
for(i=0;i<numeric.mathfuns.length;++i) {
o = numeric.mathfuns[i];
numeric.ops1[o] = o;
}
for(i in numeric.ops1) {
if(numeric.ops1.hasOwnProperty(i)) {
setup = '';
o = numeric.ops1[i];
if(numeric.myIndexOf.call(numeric.mathfuns,i)!==-1) {
if(Math.hasOwnProperty(o)) setup = 'var '+o+' = Math.'+o+';\n';
}
numeric[i+'eqV'] = numeric.pointwise2(['ret[i]'],'ret[i] = '+o+'(ret[i]);',setup);
numeric[i+'eq'] = Function('x',
'if(typeof x !== "object") return '+o+'x\n'+
'var i;\n'+
'var V = numeric.'+i+'eqV;\n'+
'var s = numeric.dim(x);\n'+
'numeric._foreach(x,s,0,V);\n'+
'return x;\n');
numeric[i+'V'] = numeric.pointwise2(['x[i]'],'ret[i] = '+o+'(x[i]);',setup);
numeric[i] = Function('x',
'if(typeof x !== "object") return '+o+'(x)\n'+
'var i;\n'+
'var V = numeric.'+i+'V;\n'+
'var s = numeric.dim(x);\n'+
'return numeric._foreach2(x,s,0,V);\n');
}
}
for(i=0;i<numeric.mathfuns.length;++i) {
o = numeric.mathfuns[i];
delete numeric.ops1[o];
}
for(i in numeric.mapreducers) {
if(numeric.mapreducers.hasOwnProperty(i)) {
o = numeric.mapreducers[i];
numeric[i+'V'] = numeric.mapreduce2(o[0],o[1]);
numeric[i] = Function('x','s','k',
o[1]+
'if(typeof x !== "object") {'+
' xi = x;\n'+
o[0]+';\n'+
' return accum;\n'+
'}'+
'if(typeof s === "undefined") s = numeric.dim(x);\n'+
'if(typeof k === "undefined") k = 0;\n'+
'if(k === s.length-1) return numeric.'+i+'V(x);\n'+
'var xi;\n'+
'var n = x.length, i;\n'+
'for(i=n-1;i!==-1;--i) {\n'+
' xi = arguments.callee(x[i]);\n'+
o[0]+';\n'+
'}\n'+
'return accum;\n');
}
}
}());
numeric.truncVV = numeric.pointwise(['x[i]','y[i]'],'ret[i] = round(x[i]/y[i])*y[i];','var round = Math.round;');
numeric.truncVS = numeric.pointwise(['x[i]','y'],'ret[i] = round(x[i]/y)*y;','var round = Math.round;');
numeric.truncSV = numeric.pointwise(['x','y[i]'],'ret[i] = round(x/y[i])*y[i];','var round = Math.round;');
numeric.trunc = function trunc(x,y) {
if(typeof x === "object") {
if(typeof y === "object") return numeric.truncVV(x,y);
return numeric.truncVS(x,y);
}
if (typeof y === "object") return numeric.truncSV(x,y);
return Math.round(x/y)*y;
};
numeric.inv = function inv(x) {
var s = numeric.dim(x), abs = Math.abs, m = s[0], n = s[1];
var A = numeric.clone(x), Ai, Aj;
var I = numeric.identity(m), Ii, Ij;
var i,j,k,x;
for(j=0;j<n;++j) {
var i0 = -1;
var v0 = -1;
for(i=j;i!==m;++i) { k = abs(A[i][j]); if(k>v0) { i0 = i; v0 = k; } }
Aj = A[i0]; A[i0] = A[j]; A[j] = Aj;
Ij = I[i0]; I[i0] = I[j]; I[j] = Ij;
x = Aj[j];
for(k=j;k!==n;++k) Aj[k] /= x;
for(k=n-1;k!==-1;--k) Ij[k] /= x;
for(i=m-1;i!==-1;--i) {
if(i!==j) {
Ai = A[i];
Ii = I[i];
x = Ai[j];
for(k=j+1;k!==n;++k) Ai[k] -= Aj[k]*x;
for(k=n-1;k>0;--k) { Ii[k] -= Ij[k]*x; --k; Ii[k] -= Ij[k]*x; }
if(k===0) Ii[0] -= Ij[0]*x;
}
}
}
return I;
};
numeric.det = function det(x) {
var s = numeric.dim(x);
if(s.length !== 2 || s[0] !== s[1]) { throw new Error('numeric: det() only works on square matrices'); }
var n = s[0], ret = 1,i,j,k,A = numeric.clone(x),Aj,Ai,alpha,temp,k1,k2,k3;
for(j=0;j<n-1;j++) {
k=j;
for(i=j+1;i<n;i++) { if(Math.abs(A[i][j]) > Math.abs(A[k][j])) { k = i; } }
if(k !== j) {
temp = A[k]; A[k] = A[j]; A[j] = temp;
ret *= -1;
}
Aj = A[j];
for(i=j+1;i<n;i++) {
Ai = A[i];
alpha = Ai[j]/Aj[j];
for(k=j+1;k<n-1;k+=2) {
k1 = k+1;
Ai[k] -= Aj[k]*alpha;
Ai[k1] -= Aj[k1]*alpha;
}
if(k!==n) { Ai[k] -= Aj[k]*alpha; }
}
if(Aj[j] === 0) { return 0; }
ret *= Aj[j];
}
return ret*A[j][j];
};
numeric.transpose = function transpose(x) {
var i,j,m = x.length,n = x[0].length, ret=Array(n),A0,A1,Bj;
for(j=0;j<n;j++) ret[j] = Array(m);
for(i=m-1;i>=1;i-=2) {
A1 = x[i];
A0 = x[i-1];
for(j=n-1;j>=1;--j) {
Bj = ret[j]; Bj[i] = A1[j]; Bj[i-1] = A0[j];
--j;
Bj = ret[j]; Bj[i] = A1[j]; Bj[i-1] = A0[j];
}
if(j===0) {
Bj = ret[0]; Bj[i] = A1[0]; Bj[i-1] = A0[0];
}
}
if(i===0) {
A0 = x[0];
for(j=n-1;j>=1;--j) {
ret[j][0] = A0[j];
--j;
ret[j][0] = A0[j];
}
if(j===0) { ret[0][0] = A0[0]; }
}
return ret;
};
numeric.negtranspose = function negtranspose(x) {
var i,j,m = x.length,n = x[0].length, ret=Array(n),A0,A1,Bj;
for(j=0;j<n;j++) ret[j] = Array(m);
for(i=m-1;i>=1;i-=2) {
A1 = x[i];
A0 = x[i-1];
for(j=n-1;j>=1;--j) {
Bj = ret[j]; Bj[i] = -A1[j]; Bj[i-1] = -A0[j];
--j;
Bj = ret[j]; Bj[i] = -A1[j]; Bj[i-1] = -A0[j];
}
if(j===0) {
Bj = ret[0]; Bj[i] = -A1[0]; Bj[i-1] = -A0[0];
}
}
if(i===0) {
A0 = x[0];
for(j=n-1;j>=1;--j) {
ret[j][0] = -A0[j];
--j;
ret[j][0] = -A0[j];
}
if(j===0) { ret[0][0] = -A0[0]; }
}
return ret;
};
numeric._random = function _random(s,k) {
var i,n=s[k],ret=Array(n), rnd;
if(k === s.length-1) {
rnd = Math.random;
for(i=n-1;i>=1;i-=2) {
ret[i] = rnd();
ret[i-1] = rnd();
}
if(i===0) { ret[0] = rnd(); }
return ret;
}
for(i=n-1;i>=0;i--) ret[i] = _random(s,k+1);
return ret;
};
numeric.random = function random(s) { return numeric._random(s,0); };
numeric.norm2 = function norm2(x) { return Math.sqrt(numeric.norm2Squared(x)); };
numeric.linspace = function linspace(a,b,n) {
if(typeof n === "undefined") n = Math.max(Math.round(b-a)+1,1);
if(n<2) { return n===1?[a]:[]; }
var i,ret = Array(n);
n--;
for(i=n;i>=0;i--) { ret[i] = (i*b+(n-i)*a)/n; }
return ret;
};
numeric.getBlock = function getBlock(x,from,to) {
var s = numeric.dim(x);
function foo(x,k) {
var i,a = from[k], n = to[k]-a, ret = Array(n);
if(k === s.length-1) {
for(i=n;i>=0;i--) { ret[i] = x[i+a]; }
return ret;
}
for(i=n;i>=0;i--) { ret[i] = foo(x[i+a],k+1); }
return ret;
}
return foo(x,0);
};
numeric.setBlock = function setBlock(x,from,to,B) {
var s = numeric.dim(x);
function foo(x,y,k) {
var i,a = from[k], n = to[k]-a;
if(k === s.length-1) { for(i=n;i>=0;i--) { x[i+a] = y[i]; } }
for(i=n;i>=0;i--) { foo(x[i+a],y[i],k+1); }
}
foo(x,B,0);
return x;
};
numeric.getRange = function getRange(A,I,J) {
var m = I.length, n = J.length;
var i,j;
var B = Array(m), Bi, AI;
for(i=m-1;i!==-1;--i) {
B[i] = Array(n);
Bi = B[i];
AI = A[I[i]];
for(j=n-1;j!==-1;--j) Bi[j] = AI[J[j]];
}
return B;
};
numeric.blockMatrix = function blockMatrix(X) {
var s = numeric.dim(X);
if(s.length<4) return numeric.blockMatrix([X]);
var m=s[0],n=s[1],M,N,i,j,Xij;
M = 0; N = 0;
for(i=0;i<m;++i) M+=X[i][0].length;
for(j=0;j<n;++j) N+=X[0][j][0].length;
var Z = Array(M);
for(i=0;i<M;++i) Z[i] = Array(N);
var I=0,J,ZI,k,l,Xijk;
for(i=0;i<m;++i) {
J=N;
for(j=n-1;j!==-1;--j) {
Xij = X[i][j];
J -= Xij[0].length;
for(k=Xij.length-1;k!==-1;--k) {
Xijk = Xij[k];
ZI = Z[I+k];
for(l = Xijk.length-1;l!==-1;--l) ZI[J+l] = Xijk[l];
}
}
I += X[i][0].length;
}
return Z;
};
numeric.tensor = function tensor(x,y) {
if(typeof x === "number" || typeof y === "number") return numeric.mul(x,y);
var s1 = numeric.dim(x), s2 = numeric.dim(y);
if(s1.length !== 1 || s2.length !== 1) {
throw new Error('numeric: tensor product is only defined for vectors');
}
var m = s1[0], n = s2[0], A = Array(m), Ai, i,j,xi;
for(i=m-1;i>=0;i--) {
Ai = Array(n);
xi = x[i];
for(j=n-1;j>=3;--j) {
Ai[j] = xi * y[j];
--j;
Ai[j] = xi * y[j];
--j;
Ai[j] = xi * y[j];
--j;
Ai[j] = xi * y[j];
}
while(j>=0) { Ai[j] = xi * y[j]; --j; }
A[i] = Ai;
}
return A;
};
// 3. The Tensor type T
numeric.T = function T(x,y) { this.x = x; this.y = y; };
numeric.t = function t(x,y) { return new numeric.T(x,y); };
numeric.Tbinop = function Tbinop(rr,rc,cr,cc,setup) {
var io = numeric.indexOf;
if(typeof setup !== "string") {
var k;
setup = '';
for(k in numeric) {
if(numeric.hasOwnProperty(k) && (rr.indexOf(k)>=0 || rc.indexOf(k)>=0 || cr.indexOf(k)>=0 || cc.indexOf(k)>=0) && k.length>1) {
setup += 'var '+k+' = numeric.'+k+';\n';
}
}
}
return Function(['y'],
'var x = this;\n'+
'if(!(y instanceof numeric.T)) { y = new numeric.T(y); }\n'+
setup+'\n'+
'if(x.y) {'+
' if(y.y) {'+
' return new numeric.T('+cc+');\n'+
' }\n'+
' return new numeric.T('+cr+');\n'+
'}\n'+
'if(y.y) {\n'+
' return new numeric.T('+rc+');\n'+
'}\n'+
'return new numeric.T('+rr+');\n'
);
};
numeric.T.prototype.add = numeric.Tbinop(
'add(x.x,y.x)',
'add(x.x,y.x),y.y',
'add(x.x,y.x),x.y',
'add(x.x,y.x),add(x.y,y.y)');
numeric.T.prototype.sub = numeric.Tbinop(
'sub(x.x,y.x)',
'sub(x.x,y.x),neg(y.y)',
'sub(x.x,y.x),x.y',
'sub(x.x,y.x),sub(x.y,y.y)');
numeric.T.prototype.mul = numeric.Tbinop(
'mul(x.x,y.x)',
'mul(x.x,y.x),mul(x.x,y.y)',
'mul(x.x,y.x),mul(x.y,y.x)',
'sub(mul(x.x,y.x),mul(x.y,y.y)),add(mul(x.x,y.y),mul(x.y,y.x))');
numeric.T.prototype.reciprocal = function reciprocal() {
var mul = numeric.mul, div = numeric.div;
if(this.y) {
var d = numeric.add(mul(this.x,this.x),mul(this.y,this.y));
return new numeric.T(div(this.x,d),div(numeric.neg(this.y),d));
}
return new T(div(1,this.x));
};
numeric.T.prototype.div = function div(y) {
if(!(y instanceof numeric.T)) y = new numeric.T(y);
if(y.y) { return this.mul(y.reciprocal()); }
var div = numeric.div;
if(this.y) { return new numeric.T(div(this.x,y.x),div(this.y,y.x)); }
return new numeric.T(div(this.x,y.x));
};
numeric.T.prototype.dot = numeric.Tbinop(
'dot(x.x,y.x)',
'dot(x.x,y.x),dot(x.x,y.y)',
'dot(x.x,y.x),dot(x.y,y.x)',
'sub(dot(x.x,y.x),dot(x.y,y.y)),add(dot(x.x,y.y),dot(x.y,y.x))'
);
numeric.T.prototype.transpose = function transpose() {
var t = numeric.transpose, x = this.x, y = this.y;
if(y) { return new numeric.T(t(x),t(y)); }
return new numeric.T(t(x));
};
numeric.T.prototype.transjugate = function transjugate() {
var t = numeric.transpose, x = this.x, y = this.y;
if(y) { return new numeric.T(t(x),numeric.negtranspose(y)); }
return new numeric.T(t(x));
};
numeric.Tunop = function Tunop(r,c,s) {
if(typeof s !== "string") { s = ''; }
return Function(
'var x = this;\n'+
s+'\n'+
'if(x.y) {'+
' '+c+';\n'+
'}\n'+
r+';\n'
);
};
numeric.T.prototype.exp = numeric.Tunop(
'return new numeric.T(ex)',
'return new numeric.T(mul(cos(x.y),ex),mul(sin(x.y),ex))',
'var ex = numeric.exp(x.x), cos = numeric.cos, sin = numeric.sin, mul = numeric.mul;');
numeric.T.prototype.conj = numeric.Tunop(
'return new numeric.T(x.x);',
'return new numeric.T(x.x,numeric.neg(x.y));');
numeric.T.prototype.neg = numeric.Tunop(
'return new numeric.T(neg(x.x));',
'return new numeric.T(neg(x.x),neg(x.y));',
'var neg = numeric.neg;');
numeric.T.prototype.sin = numeric.Tunop(
'return new numeric.T(numeric.sin(x.x))',
'return x.exp().sub(x.neg().exp()).div(new numeric.T(0,2));');
numeric.T.prototype.cos = numeric.Tunop(
'return new numeric.T(numeric.cos(x.x))',
'return x.exp().add(x.neg().exp()).div(2);');
numeric.T.prototype.abs = numeric.Tunop(
'return new numeric.T(numeric.abs(x.x));',
'return new numeric.T(numeric.sqrt(numeric.add(mul(x.x,x.x),mul(x.y,x.y))));',
'var mul = numeric.mul;');
numeric.T.prototype.log = numeric.Tunop(
'return new numeric.T(numeric.log(x.x));',
'var theta = new numeric.T(numeric.atan2(x.y,x.x)), r = x.abs();\n'+
'return new numeric.T(numeric.log(r.x),theta.x);');
numeric.T.prototype.norm2 = numeric.Tunop(
'return numeric.norm2(x.x);',
'var f = numeric.norm2Squared;\n'+
'return Math.sqrt(f(x.x)+f(x.y));');
numeric.T.prototype.inv = function inv() {
var A = this;
if(typeof A.y === "undefined") { return new numeric.T(numeric.inv(A.x)); }
var n = A.x.length, i, j, k;
var Rx = numeric.identity(n),Ry = numeric.rep([n,n],0);
var Ax = numeric.clone(A.x), Ay = numeric.clone(A.y);
var Aix, Aiy, Ajx, Ajy, Rix, Riy, Rjx, Rjy;
var i,j,k,d,d1,ax,ay,bx,by,temp;
for(i=0;i<n;i++) {
ax = Ax[i][i]; ay = Ay[i][i];
d = ax*ax+ay*ay;
k = i;
for(j=i+1;j<n;j++) {
ax = Ax[j][i]; ay = Ay[j][i];
d1 = ax*ax+ay*ay;
if(d1 > d) { k=j; d = d1; }
}
if(k!==i) {
temp = Ax[i]; Ax[i] = Ax[k]; Ax[k] = temp;
temp = Ay[i]; Ay[i] = Ay[k]; Ay[k] = temp;
temp = Rx[i]; Rx[i] = Rx[k]; Rx[k] = temp;
temp = Ry[i]; Ry[i] = Ry[k]; Ry[k] = temp;
}
Aix = Ax[i]; Aiy = Ay[i];
Rix = Rx[i]; Riy = Ry[i];
ax = Aix[i]; ay = Aiy[i];
for(j=i+1;j<n;j++) {
bx = Aix[j]; by = Aiy[j];
Aix[j] = (bx*ax+by*ay)/d;
Aiy[j] = (by*ax-bx*ay)/d;
}
for(j=0;j<n;j++) {
bx = Rix[j]; by = Riy[j];
Rix[j] = (bx*ax+by*ay)/d;
Riy[j] = (by*ax-bx*ay)/d;
}
for(j=i+1;j<n;j++) {
Ajx = Ax[j]; Ajy = Ay[j];
Rjx = Rx[j]; Rjy = Ry[j];
ax = Ajx[i]; ay = Ajy[i];
for(k=i+1;k<n;k++) {
bx = Aix[k]; by = Aiy[k];
Ajx[k] -= bx*ax-by*ay;
Ajy[k] -= by*ax+bx*ay;
}
for(k=0;k<n;k++) {
bx = Rix[k]; by = Riy[k];
Rjx[k] -= bx*ax-by*ay;
Rjy[k] -= by*ax+bx*ay;
}
}
}
for(i=n-1;i>0;i--) {
Rix = Rx[i]; Riy = Ry[i];
for(j=i-1;j>=0;j--) {
Rjx = Rx[j]; Rjy = Ry[j];
ax = Ax[j][i]; ay = Ay[j][i];
for(k=n-1;k>=0;k--) {
bx = Rix[k]; by = Riy[k];
Rjx[k] -= ax*bx - ay*by;
Rjy[k] -= ax*by + ay*bx;
}
}
}
return new numeric.T(Rx,Ry);
};
numeric.T.prototype.get = function get(i) {
var x = this.x, y = this.y, k = 0, ik, n = i.length;
if(y) {
while(k<n) {
ik = i[k];
x = x[ik];
y = y[ik];
k++;
}
return new numeric.T(x,y);
}
while(k<n) {
ik = i[k];
x = x[ik];
k++;
}
return new numeric.T(x);
};
numeric.T.prototype.set = function set(i,v) {
var x = this.x, y = this.y, k = 0, ik, n = i.length, vx = v.x, vy = v.y;
if(n===0) {
if(vy) { this.y = vy; }
else if(y) { this.y = undefined; }
this.x = x;
return this;
}
if(vy) {
if(y) { /* ok */ }
else {
y = numeric.rep(numeric.dim(x),0);
this.y = y;
}
while(k<n-1) {
ik = i[k];
x = x[ik];
y = y[ik];
k++;
}
ik = i[k];
x[ik] = vx;
y[ik] = vy;
return this;
}
if(y) {
while(k<n-1) {
ik = i[k];
x = x[ik];
y = y[ik];
k++;
}
ik = i[k];
x[ik] = vx;
if(vx instanceof Array) y[ik] = numeric.rep(numeric.dim(vx),0);
else y[ik] = 0;
return this;
}
while(k<n-1) {
ik = i[k];
x = x[ik];
k++;
}
ik = i[k];
x[ik] = vx;
return this;
};
numeric.T.prototype.getRows = function getRows(i0,i1) {
var n = i1-i0+1, j;
var rx = Array(n), ry, x = this.x, y = this.y;
for(j=i0;j<=i1;j++) { rx[j-i0] = x[j]; }
if(y) {
ry = Array(n);
for(j=i0;j<=i1;j++) { ry[j-i0] = y[j]; }
return new numeric.T(rx,ry);
}
return new numeric.T(rx);
};
numeric.T.prototype.setRows = function setRows(i0,i1,A) {
var j;
var rx = this.x, ry = this.y, x = A.x, y = A.y;
for(j=i0;j<=i1;j++) { rx[j] = x[j-i0]; }
if(y) {
if(!ry) { ry = numeric.rep(numeric.dim(rx),0); this.y = ry; }
for(j=i0;j<=i1;j++) { ry[j] = y[j-i0]; }
} else if(ry) {
for(j=i0;j<=i1;j++) { ry[j] = numeric.rep([x[j-i0].length],0); }
}
return this;
};
numeric.T.prototype.getRow = function getRow(k) {
var x = this.x, y = this.y;
if(y) { return new numeric.T(x[k],y[k]); }
return new numeric.T(x[k]);
};
numeric.T.prototype.setRow = function setRow(i,v) {
var rx = this.x, ry = this.y, x = v.x, y = v.y;
rx[i] = x;
if(y) {
if(!ry) { ry = numeric.rep(numeric.dim(rx),0); this.y = ry; }
ry[i] = y;
} else if(ry) {
ry = numeric.rep([x.length],0);
}
return this;
};
numeric.T.prototype.getBlock = function getBlock(from,to) {
var x = this.x, y = this.y, b = numeric.getBlock;
if(y) { return new numeric.T(b(x,from,to),b(y,from,to)); }
return new numeric.T(b(x,from,to));
};
numeric.T.prototype.setBlock = function setBlock(from,to,A) {
if(!(A instanceof numeric.T)) A = new numeric.T(A);
var x = this.x, y = this.y, b = numeric.setBlock, Ax = A.x, Ay = A.y;
if(Ay) {
if(!y) { this.y = numeric.rep(numeric.dim(this),0); y = this.y; }
b(x,from,to,Ax);
b(y,from,to,Ay);
return this;
}
b(x,from,to,Ax);
if(y) b(y,from,to,numeric.rep(numeric.dim(Ax),0));
};
numeric.T.rep = function rep(s,v) {
var T = numeric.T;
if(!(v instanceof T)) v = new T(v);
var x = v.x, y = v.y, r = numeric.rep;
if(y) return new T(r(s,x),r(s,y));
return new T(r(s,x));
};
numeric.T.diag = function diag(d) {
if(!(d instanceof numeric.T)) d = new numeric.T(d);
var x = d.x, y = d.y, diag = numeric.diag;
if(y) return new numeric.T(diag(x),diag(y));
return new numeric.T(diag(x));
};
numeric.T.eig = function eig() {
if(this.y) { throw new Error('eig: not implemented for complex matrices.'); }
return numeric.eig(this.x);
};
numeric.T.identity = function identity(n) { return new numeric.T(numeric.identity(n)); };
numeric.T.prototype.getDiag = function getDiag() {
var n = numeric;
var x = this.x, y = this.y;
if(y) { return new n.T(n.getDiag(x),n.getDiag(y)); }
return new n.T(n.getDiag(x));
};
// 4. Eigenvalues of real matrices
numeric.house = function house(x) {
var v = numeric.clone(x);
var s = x[0] >= 0 ? 1 : -1;
var alpha = s*numeric.norm2(x);
v[0] += alpha;
var foo = numeric.norm2(v);
if(foo === 0) { /* this should not happen */ throw new Error('eig: internal error'); }
return numeric.div(v,foo);
};
numeric.toUpperHessenberg = function toUpperHessenberg(me) {
var s = numeric.dim(me);
if(s.length !== 2 || s[0] !== s[1]) { throw new Error('numeric: toUpperHessenberg() only works on square matrices'); }
var m = s[0], i,j,k,x,v,A = numeric.clone(me),B,C,Ai,Ci,Q = numeric.identity(m),Qi;
for(j=0;j<m-2;j++) {
x = Array(m-j-1);
for(i=j+1;i<m;i++) { x[i-j-1] = A[i][j]; }
if(numeric.norm2(x)>0) {
v = numeric.house(x);
B = numeric.getBlock(A,[j+1,j],[m-1,m-1]);
C = numeric.tensor(v,numeric.dot(v,B));
for(i=j+1;i<m;i++) { Ai = A[i]; Ci = C[i-j-1]; for(k=j;k<m;k++) Ai[k] -= 2*Ci[k-j]; }
B = numeric.getBlock(A,[0,j+1],[m-1,m-1]);
C = numeric.tensor(numeric.dot(B,v),v);
for(i=0;i<m;i++) { Ai = A[i]; Ci = C[i]; for(k=j+1;k<m;k++) Ai[k] -= 2*Ci[k-j-1]; }
B = Array(m-j-1);
for(i=j+1;i<m;i++) B[i-j-1] = Q[i];
C = numeric.tensor(v,numeric.dot(v,B));
for(i=j+1;i<m;i++) { Qi = Q[i]; Ci = C[i-j-1]; for(k=0;k<m;k++) Qi[k] -= 2*Ci[k]; }
}
}
return {H:A, Q:Q};
};
numeric.epsilon = 2.220446049250313e-16;
numeric.QRFrancis = function(H,maxiter) {
if(typeof maxiter === "undefined") { maxiter = 10000; }
H = numeric.clone(H);
var H0 = numeric.clone(H);
var s = numeric.dim(H),m=s[0],x,v,a,b,c,d,det,tr, Hloc, Q = numeric.identity(m), Qi, Hi, B, C, Ci,i,j,k,iter;
if(m<3) { return {Q:Q, B:[ [0,m-1] ]}; }
var epsilon = numeric.epsilon;
for(iter=0;iter<maxiter;iter++) {
for(j=0;j<m-1;j++) {
if(Math.abs(H[j+1][j]) < epsilon*(Math.abs(H[j][j])+Math.abs(H[j+1][j+1]))) {
var QH1 = numeric.QRFrancis(numeric.getBlock(H,[0,0],[j,j]),maxiter);
var QH2 = numeric.QRFrancis(numeric.getBlock(H,[j+1,j+1],[m-1,m-1]),maxiter);
B = Array(j+1);
for(i=0;i<=j;i++) { B[i] = Q[i]; }
C = numeric.dot(QH1.Q,B);
for(i=0;i<=j;i++) { Q[i] = C[i]; }
B = Array(m-j-1);
for(i=j+1;i<m;i++) { B[i-j-1] = Q[i]; }
C = numeric.dot(QH2.Q,B);
for(i=j+1;i<m;i++) { Q[i] = C[i-j-1]; }
return {Q:Q,B:QH1.B.concat(numeric.add(QH2.B,j+1))};
}
}
a = H[m-2][m-2]; b = H[m-2][m-1];
c = H[m-1][m-2]; d = H[m-1][m-1];
tr = a+d;
det = (a*d-b*c);
Hloc = numeric.getBlock(H, [0,0], [2,2]);
if(tr*tr>=4*det) {
var s1,s2;
s1 = 0.5*(tr+Math.sqrt(tr*tr-4*det));
s2 = 0.5*(tr-Math.sqrt(tr*tr-4*det));
Hloc = numeric.add(numeric.sub(numeric.dot(Hloc,Hloc),
numeric.mul(Hloc,s1+s2)),
numeric.diag(numeric.rep([3],s1*s2)));
} else {
Hloc = numeric.add(numeric.sub(numeric.dot(Hloc,Hloc),
numeric.mul(Hloc,tr)),
numeric.diag(numeric.rep([3],det)));
}
x = [Hloc[0][0],Hloc[1][0],Hloc[2][0]];
v = numeric.house(x);
B = [H[0],H[1],H[2]];
C = numeric.tensor(v,numeric.dot(v,B));
for(i=0;i<3;i++) { Hi = H[i]; Ci = C[i]; for(k=0;k<m;k++) Hi[k] -= 2*Ci[k]; }
B = numeric.getBlock(H, [0,0],[m-1,2]);
C = numeric.tensor(numeric.dot(B,v),v);
for(i=0;i<m;i++) { Hi = H[i]; Ci = C[i]; for(k=0;k<3;k++) Hi[k] -= 2*Ci[k]; }
B = [Q[0],Q[1],Q[2]];
C = numeric.tensor(v,numeric.dot(v,B));
for(i=0;i<3;i++) { Qi = Q[i]; Ci = C[i]; for(k=0;k<m;k++) Qi[k] -= 2*Ci[k]; }
var J;
for(j=0;j<m-2;j++) {
for(k=j;k<=j+1;k++) {
if(Math.abs(H[k+1][k]) < epsilon*(Math.abs(H[k][k])+Math.abs(H[k+1][k+1]))) {
var QH1 = numeric.QRFrancis(numeric.getBlock(H,[0,0],[k,k]),maxiter);
var QH2 = numeric.QRFrancis(numeric.getBlock(H,[k+1,k+1],[m-1,m-1]),maxiter);
B = Array(k+1);
for(i=0;i<=k;i++) { B[i] = Q[i]; }
C = numeric.dot(QH1.Q,B);
for(i=0;i<=k;i++) { Q[i] = C[i]; }
B = Array(m-k-1);
for(i=k+1;i<m;i++) { B[i-k-1] = Q[i]; }
C = numeric.dot(QH2.Q,B);
for(i=k+1;i<m;i++) { Q[i] = C[i-k-1]; }
return {Q:Q,B:QH1.B.concat(numeric.add(QH2.B,k+1))};
}
}
J = Math.min(m-1,j+3);
x = Array(J-j);
for(i=j+1;i<=J;i++) { x[i-j-1] = H[i][j]; }
v = numeric.house(x);
B = numeric.getBlock(H, [j+1,j],[J,m-1]);
C = numeric.tensor(v,numeric.dot(v,B));
for(i=j+1;i<=J;i++) { Hi = H[i]; Ci = C[i-j-1]; for(k=j;k<m;k++) Hi[k] -= 2*Ci[k-j]; }
B = numeric.getBlock(H, [0,j+1],[m-1,J]);
C = numeric.tensor(numeric.dot(B,v),v);
for(i=0;i<m;i++) { Hi = H[i]; Ci = C[i]; for(k=j+1;k<=J;k++) Hi[k] -= 2*Ci[k-j-1]; }
B = Array(J-j);
for(i=j+1;i<=J;i++) B[i-j-1] = Q[i];
C = numeric.tensor(v,numeric.dot(v,B));
for(i=j+1;i<=J;i++) { Qi = Q[i]; Ci = C[i-j-1]; for(k=0;k<m;k++) Qi[k] -= 2*Ci[k]; }
}
}
throw new Error('numeric: eigenvalue iteration does not converge -- increase maxiter?');
};
numeric.eig = function eig(A,maxiter) {
var QH = numeric.toUpperHessenberg(A);
var QB = numeric.QRFrancis(QH.H,maxiter);
var T = numeric.T;
var n = A.length,i,k,flag = false,B = QB.B,H = numeric.dot(QB.Q,numeric.dot(QH.H,numeric.transpose(QB.Q)));
var Q = new T(numeric.dot(QB.Q,QH.Q)),Q0;
var m = B.length,j;
var a,b,c,d,p1,p2,disc,x,y,p,q,n1,n2;
var sqrt = Math.sqrt;
for(k=0;k<m;k++) {
i = B[k][0];
if(i === B[k][1]) {
// nothing
} else {
j = i+1;
a = H[i][i];
b = H[i][j];
c = H[j][i];
d = H[j][j];
if(b === 0 && c === 0) continue;
p1 = -a-d;
p2 = a*d-b*c;
disc = p1*p1-4*p2;
if(disc>=0) {
if(p1<0) x = -0.5*(p1-sqrt(disc));
else x = -0.5*(p1+sqrt(disc));
n1 = (a-x)*(a-x)+b*b;
n2 = c*c+(d-x)*(d-x);
if(n1>n2) {
n1 = sqrt(n1);
p = (a-x)/n1;
q = b/n1;
} else {
n2 = sqrt(n2);
p = c/n2;
q = (d-x)/n2;
}
Q0 = new T([[q,-p],[p,q]]);
Q.setRows(i,j,Q0.dot(Q.getRows(i,j)));
} else {
x = -0.5*p1;
y = 0.5*sqrt(-disc);
n1 = (a-x)*(a-x)+b*b;
n2 = c*c+(d-x)*(d-x);
if(n1>n2) {
n1 = sqrt(n1+y*y);
p = (a-x)/n1;
q = b/n1;
x = 0;
y /= n1;
} else {
n2 = sqrt(n2+y*y);
p = c/n2;
q = (d-x)/n2;
x = y/n2;
y = 0;
}
Q0 = new T([[q,-p],[p,q]],[[x,y],[y,-x]]);
Q.setRows(i,j,Q0.dot(Q.getRows(i,j)));
}
}
}
var R = Q.dot(A).dot(Q.transjugate()), n = A.length, E = numeric.T.identity(n);
for(j=0;j<n;j++) {
if(j>0) {
for(k=j-1;k>=0;k--) {
var Rk = R.get([k,k]), Rj = R.get([j,j]);
if(numeric.neq(Rk.x,Rj.x) || numeric.neq(Rk.y,Rj.y)) {
x = R.getRow(k).getBlock([k],[j-1]);
y = E.getRow(j).getBlock([k],[j-1]);
E.set([j,k],(R.get([k,j]).neg().sub(x.dot(y))).div(Rk.sub(Rj)));
} else {
E.setRow(j,E.getRow(k));
continue;
}
}
}
}
for(j=0;j<n;j++) {
x = E.getRow(j);
E.setRow(j,x.div(x.norm2()));
}
E = E.transpose();
E = Q.transjugate().dot(E);
return { lambda:R.getDiag(), E:E };
};
// 5. Compressed Column Storage matrices
numeric.ccsSparse = function ccsSparse(A) {
var m = A.length,n,foo, i,j, counts = [];
for(i=m-1;i!==-1;--i) {
foo = A[i];
for(j in foo) {
j = parseInt(j);
while(j>=counts.length) counts[counts.length] = 0;
if(foo[j]!==0) counts[j]++;
}
}
var n = counts.length;
var Ai = Array(n+1);
Ai[0] = 0;
for(i=0;i<n;++i) Ai[i+1] = Ai[i] + counts[i];
var Aj = Array(Ai[n]), Av = Array(Ai[n]);
for(i=m-1;i!==-1;--i) {
foo = A[i];
for(j in foo) {
if(foo[j]!==0) {
counts[j]--;
Aj[Ai[j]+counts[j]] = i;
Av[Ai[j]+counts[j]] = foo[j];
}
}
}
return [Ai,Aj,Av];
};
numeric.ccsFull = function ccsFull(A) {
var Ai = A[0], Aj = A[1], Av = A[2], s = numeric.ccsDim(A), m = s[0], n = s[1], i,j,j0,j1,k;
var B = numeric.rep([m,n],0);
for(i=0;i<n;i++) {
j0 = Ai[i];
j1 = Ai[i+1];
for(j=j0;j<j1;++j) { B[Aj[j]][i] = Av[j]; }
}
return B;
};
numeric.ccsTSolve = function ccsTSolve(A,b,x,bj,xj) {
var Ai = A[0], Aj = A[1], Av = A[2],m = Ai.length-1, max = Math.max,n=0;
if(typeof bj === "undefined") x = numeric.rep([m],0);
if(typeof bj === "undefined") bj = numeric.linspace(0,x.length-1);
if(typeof xj === "undefined") xj = [];
function dfs(j) {
var k;
if(x[j] !== 0) return;
x[j] = 1;
for(k=Ai[j];k<Ai[j+1];++k) dfs(Aj[k]);
xj[n] = j;
++n;
}
var i,j,j0,j1,k,l,l0,l1,a;
for(i=bj.length-1;i!==-1;--i) { dfs(bj[i]); }
xj.length = n;
for(i=xj.length-1;i!==-1;--i) { x[xj[i]] = 0; }
for(i=bj.length-1;i!==-1;--i) { j = bj[i]; x[j] = b[j]; }
for(i=xj.length-1;i!==-1;--i) {
j = xj[i];
j0 = Ai[j];
j1 = max(Ai[j+1],j0);
for(k=j0;k!==j1;++k) { if(Aj[k] === j) { x[j] /= Av[k]; break; } }
a = x[j];
for(k=j0;k!==j1;++k) {
l = Aj[k];
if(l !== j) x[l] -= a*Av[k];
}
}
return x;
};
numeric.ccsDFS = function ccsDFS(n) {
this.k = Array(n);
this.k1 = Array(n);
this.j = Array(n);
};
numeric.ccsDFS.prototype.dfs = function dfs(J,Ai,Aj,x,xj,Pinv) {
var m = 0,foo,n=xj.length;
var k = this.k, k1 = this.k1, j = this.j,km,k11;
if(x[J]!==0) return;
x[J] = 1;
j[0] = J;
k[0] = km = Ai[J];
k1[0] = k11 = Ai[J+1];
while(1) {
if(km >= k11) {
xj[n] = j[m];
if(m===0) return;
++n;
--m;
km = k[m];
k11 = k1[m];
} else {
foo = Pinv[Aj[km]];
if(x[foo] === 0) {
x[foo] = 1;
k[m] = km;
++m;
j[m] = foo;
km = Ai[foo];
k1[m] = k11 = Ai[foo+1];
} else ++km;
}
}
};
numeric.ccsLPSolve = function ccsLPSolve(A,B,x,xj,I,Pinv,dfs) {
var Ai = A[0], Aj = A[1], Av = A[2],m = Ai.length-1, n=0;
var Bi = B[0], Bj = B[1], Bv = B[2];
var i,i0,i1,j,J,j0,j1,k,l,l0,l1,a;
i0 = Bi[I];
i1 = Bi[I+1];
xj.length = 0;
for(i=i0;i<i1;++i) { dfs.dfs(Pinv[Bj[i]],Ai,Aj,x,xj,Pinv); }
for(i=xj.length-1;i!==-1;--i) { x[xj[i]] = 0; }
for(i=i0;i!==i1;++i) { j = Pinv[Bj[i]]; x[j] = Bv[i]; }
for(i=xj.length-1;i!==-1;--i) {
j = xj[i];
j0 = Ai[j];
j1 = Ai[j+1];
for(k=j0;k<j1;++k) { if(Pinv[Aj[k]] === j) { x[j] /= Av[k]; break; } }
a = x[j];
for(k=j0;k<j1;++k) {
l = Pinv[Aj[k]];
if(l !== j) x[l] -= a*Av[k];
}
}
return x;
};
numeric.ccsLUP1 = function ccsLUP1(A,threshold) {
var m = A[0].length-1;
var L = [numeric.rep([m+1],0),[],[]], U = [numeric.rep([m+1], 0),[],[]];
var Li = L[0], Lj = L[1], Lv = L[2], Ui = U[0], Uj = U[1], Uv = U[2];
var x = numeric.rep([m],0), xj = numeric.rep([m],0);
var i,j,k,j0,j1,a,e,c,d,K;
var sol = numeric.ccsLPSolve, max = Math.max, abs = Math.abs;
var P = numeric.linspace(0,m-1),Pinv = numeric.linspace(0,m-1);
var dfs = new numeric.ccsDFS(m);
if(typeof threshold === "undefined") { threshold = 1; }
for(i=0;i<m;++i) {
sol(L,A,x,xj,i,Pinv,dfs);
a = -1;
e = -1;
for(j=xj.length-1;j!==-1;--j) {
k = xj[j];
if(k <= i) continue;
c = abs(x[k]);
if(c > a) { e = k; a = c; }
}
if(abs(x[i])<threshold*a) {
j = P[i];
a = P[e];
P[i] = a; Pinv[a] = i;
P[e] = j; Pinv[j] = e;
a = x[i]; x[i] = x[e]; x[e] = a;
}
a = Li[i];
e = Ui[i];
d = x[i];
Lj[a] = P[i];
Lv[a] = 1;
++a;
for(j=xj.length-1;j!==-1;--j) {
k = xj[j];
c = x[k];
xj[j] = 0;
x[k] = 0;
if(k<=i) { Uj[e] = k; Uv[e] = c; ++e; }
else { Lj[a] = P[k]; Lv[a] = c/d; ++a; }
}
Li[i+1] = a;
Ui[i+1] = e;
}
for(j=Lj.length-1;j!==-1;--j) { Lj[j] = Pinv[Lj[j]]; }
return {L:L, U:U, P:P, Pinv:Pinv};
};
numeric.ccsDFS0 = function ccsDFS0(n) {
this.k = Array(n);
this.k1 = Array(n);
this.j = Array(n);
};
numeric.ccsDFS0.prototype.dfs = function dfs(J,Ai,Aj,x,xj,Pinv,P) {
var m = 0,foo,n=xj.length;
var k = this.k, k1 = this.k1, j = this.j,km,k11;
if(x[J]!==0) return;
x[J] = 1;
j[0] = J;
k[0] = km = Ai[Pinv[J]];
k1[0] = k11 = Ai[Pinv[J]+1];
while(1) {
if(isNaN(km)) throw new Error("Ow!");
if(km >= k11) {
xj[n] = Pinv[j[m]];
if(m===0) return;
++n;
--m;
km = k[m];
k11 = k1[m];
} else {
foo = Aj[km];
if(x[foo] === 0) {
x[foo] = 1;
k[m] = km;
++m;
j[m] = foo;
foo = Pinv[foo];
km = Ai[foo];
k1[m] = k11 = Ai[foo+1];
} else ++km;
}
}
};
numeric.ccsLPSolve0 = function ccsLPSolve0(A,B,y,xj,I,Pinv,P,dfs) {
var Ai = A[0], Aj = A[1], Av = A[2],m = Ai.length-1, n=0;
var Bi = B[0], Bj = B[1], Bv = B[2];
var i,i0,i1,j,J,j0,j1,k,l,l0,l1,a;
i0 = Bi[I];
i1 = Bi[I+1];
xj.length = 0;
for(i=i0;i<i1;++i) { dfs.dfs(Bj[i],Ai,Aj,y,xj,Pinv,P); }
for(i=xj.length-1;i!==-1;--i) { j = xj[i]; y[P[j]] = 0; }
for(i=i0;i!==i1;++i) { j = Bj[i]; y[j] = Bv[i]; }
for(i=xj.length-1;i!==-1;--i) {
j = xj[i];
l = P[j];
j0 = Ai[j];
j1 = Ai[j+1];
for(k=j0;k<j1;++k) { if(Aj[k] === l) { y[l] /= Av[k]; break; } }
a = y[l];
for(k=j0;k<j1;++k) y[Aj[k]] -= a*Av[k];
y[l] = a;
}
};
numeric.ccsLUP0 = function ccsLUP0(A,threshold) {
var m = A[0].length-1;
var L = [numeric.rep([m+1],0),[],[]], U = [numeric.rep([m+1], 0),[],[]];
var Li = L[0], Lj = L[1], Lv = L[2], Ui = U[0], Uj = U[1], Uv = U[2];
var y = numeric.rep([m],0), xj = numeric.rep([m],0);
var i,j,k,j0,j1,a,e,c,d,K;
var sol = numeric.ccsLPSolve0, max = Math.max, abs = Math.abs;
var P = numeric.linspace(0,m-1),Pinv = numeric.linspace(0,m-1);
var dfs = new numeric.ccsDFS0(m);
if(typeof threshold === "undefined") { threshold = 1; }
for(i=0;i<m;++i) {
sol(L,A,y,xj,i,Pinv,P,dfs);
a = -1;
e = -1;
for(j=xj.length-1;j!==-1;--j) {
k = xj[j];
if(k <= i) continue;
c = abs(y[P[k]]);
if(c > a) { e = k; a = c; }
}
if(abs(y[P[i]])<threshold*a) {
j = P[i];
a = P[e];
P[i] = a; Pinv[a] = i;
P[e] = j; Pinv[j] = e;
}
a = Li[i];
e = Ui[i];
d = y[P[i]];
Lj[a] = P[i];
Lv[a] = 1;
++a;
for(j=xj.length-1;j!==-1;--j) {
k = xj[j];
c = y[P[k]];
xj[j] = 0;
y[P[k]] = 0;
if(k<=i) { Uj[e] = k; Uv[e] = c; ++e; }
else { Lj[a] = P[k]; Lv[a] = c/d; ++a; }
}
Li[i+1] = a;
Ui[i+1] = e;
}
for(j=Lj.length-1;j!==-1;--j) { Lj[j] = Pinv[Lj[j]]; }
return {L:L, U:U, P:P, Pinv:Pinv};
};
numeric.ccsLUP = numeric.ccsLUP0;
numeric.ccsDim = function ccsDim(A) { return [numeric.sup(A[1])+1,A[0].length-1]; };
numeric.ccsGetBlock = function ccsGetBlock(A,i,j) {
var s = numeric.ccsDim(A),m=s[0],n=s[1];
if(typeof i === "undefined") { i = numeric.linspace(0,m-1); }
else if(typeof i === "number") { i = [i]; }
if(typeof j === "undefined") { j = numeric.linspace(0,n-1); }
else if(typeof j === "number") { j = [j]; }
var p,p0,p1,P = i.length,q,Q = j.length,r,jq,ip;
var Bi = numeric.rep([n],0), Bj=[], Bv=[], B = [Bi,Bj,Bv];
var Ai = A[0], Aj = A[1], Av = A[2];
var x = numeric.rep([m],0),count=0,flags = numeric.rep([m],0);
for(q=0;q<Q;++q) {
jq = j[q];
var q0 = Ai[jq];
var q1 = Ai[jq+1];
for(p=q0;p<q1;++p) {
r = Aj[p];
flags[r] = 1;
x[r] = Av[p];
}
for(p=0;p<P;++p) {
ip = i[p];
if(flags[ip]) {
Bj[count] = p;
Bv[count] = x[i[p]];
++count;
}
}
for(p=q0;p<q1;++p) {
r = Aj[p];
flags[r] = 0;
}
Bi[q+1] = count;
}
return B;
};
numeric.ccsDot = function ccsDot(A,B) {
var Ai = A[0], Aj = A[1], Av = A[2];
var Bi = B[0], Bj = B[1], Bv = B[2];
var sA = numeric.ccsDim(A), sB = numeric.ccsDim(B);
var m = sA[0], n = sA[1], o = sB[1];
var x = numeric.rep([m],0), flags = numeric.rep([m],0), xj = Array(m);
var Ci = numeric.rep([o],0), Cj = [], Cv = [], C = [Ci,Cj,Cv];
var i,j,k,j0,j1,i0,i1,l,p,a,b;
for(k=0;k!==o;++k) {
j0 = Bi[k];
j1 = Bi[k+1];
p = 0;
for(j=j0;j<j1;++j) {
a = Bj[j];
b = Bv[j];
i0 = Ai[a];
i1 = Ai[a+1];
for(i=i0;i<i1;++i) {
l = Aj[i];
if(flags[l]===0) {
xj[p] = l;
flags[l] = 1;
p = p+1;
}
x[l] = x[l] + Av[i]*b;
}
}
j0 = Ci[k];
j1 = j0+p;
Ci[k+1] = j1;
for(j=p-1;j!==-1;--j) {
b = j0+j;
i = xj[j];
Cj[b] = i;
Cv[b] = x[i];
flags[i] = 0;
x[i] = 0;
}
Ci[k+1] = Ci[k]+p;
}
return C;
};
numeric.ccsLUPSolve = function ccsLUPSolve(LUP,B) {
var L = LUP.L, U = LUP.U, P = LUP.P;
var Bi = B[0];
var flag = false;
if(typeof Bi !== "object") { B = [[0,B.length],numeric.linspace(0,B.length-1),B]; Bi = B[0]; flag = true; }
var Bj = B[1], Bv = B[2];
var n = L[0].length-1, m = Bi.length-1;
var x = numeric.rep([n],0), xj = Array(n);
var b = numeric.rep([n],0), bj = Array(n);
var Xi = numeric.rep([m+1],0), Xj = [], Xv = [];
var sol = numeric.ccsTSolve;
var i,j,j0,j1,k,J,N=0;
for(i=0;i<m;++i) {
k = 0;
j0 = Bi[i];
j1 = Bi[i+1];
for(j=j0;j<j1;++j) {
J = LUP.Pinv[Bj[j]];
bj[k] = J;
b[J] = Bv[j];
++k;
}
bj.length = k;
sol(L,b,x,bj,xj);
for(j=bj.length-1;j!==-1;--j) b[bj[j]] = 0;
sol(U,x,b,xj,bj);
if(flag) return b;
for(j=xj.length-1;j!==-1;--j) x[xj[j]] = 0;
for(j=bj.length-1;j!==-1;--j) {
J = bj[j];
Xj[N] = J;
Xv[N] = b[J];
b[J] = 0;
++N;
}
Xi[i+1] = N;
}
return [Xi,Xj,Xv];
};
numeric.ccsbinop = function ccsbinop(body,setup) {
if(typeof setup === "undefined") setup='';
return Function('X','Y',
'var Xi = X[0], Xj = X[1], Xv = X[2];\n'+
'var Yi = Y[0], Yj = Y[1], Yv = Y[2];\n'+
'var n = Xi.length-1,m = Math.max(numeric.sup(Xj),numeric.sup(Yj))+1;\n'+
'var Zi = numeric.rep([n+1],0), Zj = [], Zv = [];\n'+
'var x = numeric.rep([m],0),y = numeric.rep([m],0);\n'+
'var xk,yk,zk;\n'+
'var i,j,j0,j1,k,p=0;\n'+
setup+
'for(i=0;i<n;++i) {\n'+
' j0 = Xi[i]; j1 = Xi[i+1];\n'+
' for(j=j0;j!==j1;++j) {\n'+
' k = Xj[j];\n'+
' x[k] = 1;\n'+
' Zj[p] = k;\n'+
' ++p;\n'+
' }\n'+
' j0 = Yi[i]; j1 = Yi[i+1];\n'+
' for(j=j0;j!==j1;++j) {\n'+
' k = Yj[j];\n'+
' y[k] = Yv[j];\n'+
' if(x[k] === 0) {\n'+
' Zj[p] = k;\n'+
' ++p;\n'+
' }\n'+
' }\n'+
' Zi[i+1] = p;\n'+
' j0 = Xi[i]; j1 = Xi[i+1];\n'+
' for(j=j0;j!==j1;++j) x[Xj[j]] = Xv[j];\n'+
' j0 = Zi[i]; j1 = Zi[i+1];\n'+
' for(j=j0;j!==j1;++j) {\n'+
' k = Zj[j];\n'+
' xk = x[k];\n'+
' yk = y[k];\n'+
body+'\n'+
' Zv[j] = zk;\n'+
' }\n'+
' j0 = Xi[i]; j1 = Xi[i+1];\n'+
' for(j=j0;j!==j1;++j) x[Xj[j]] = 0;\n'+
' j0 = Yi[i]; j1 = Yi[i+1];\n'+
' for(j=j0;j!==j1;++j) y[Yj[j]] = 0;\n'+
'}\n'+
'return [Zi,Zj,Zv];'
);
};
(function() {
var k,A,B,C;
for(k in numeric.ops2) {
if(isFinite(eval('1'+numeric.ops2[k]+'0'))) A = '[Y[0],Y[1],numeric.'+k+'(X,Y[2])]';
else A = 'NaN';
if(isFinite(eval('0'+numeric.ops2[k]+'1'))) B = '[X[0],X[1],numeric.'+k+'(X[2],Y)]';
else B = 'NaN';
if(isFinite(eval('1'+numeric.ops2[k]+'0')) && isFinite(eval('0'+numeric.ops2[k]+'1'))) C = 'numeric.ccs'+k+'MM(X,Y)';
else C = 'NaN';
numeric['ccs'+k+'MM'] = numeric.ccsbinop('zk = xk '+numeric.ops2[k]+'yk;');
numeric['ccs'+k] = Function('X','Y',
'if(typeof X === "number") return '+A+';\n'+
'if(typeof Y === "number") return '+B+';\n'+
'return '+C+';\n'
);
}
}());
numeric.ccsScatter = function ccsScatter(A) {
var Ai = A[0], Aj = A[1], Av = A[2];
var n = numeric.sup(Aj)+1,m=Ai.length;
var Ri = numeric.rep([n],0),Rj=Array(m), Rv = Array(m);
var counts = numeric.rep([n],0),i;
for(i=0;i<m;++i) counts[Aj[i]]++;
for(i=0;i<n;++i) Ri[i+1] = Ri[i] + counts[i];
var ptr = Ri.slice(0),k,Aii;
for(i=0;i<m;++i) {
Aii = Aj[i];
k = ptr[Aii];
Rj[k] = Ai[i];
Rv[k] = Av[i];
ptr[Aii]=ptr[Aii]+1;
}
return [Ri,Rj,Rv];
};
numeric.ccsGather = function ccsGather(A) {
var Ai = A[0], Aj = A[1], Av = A[2];
var n = Ai.length-1,m = Aj.length;
var Ri = Array(m), Rj = Array(m), Rv = Array(m);
var i,j,j0,j1,p;
p=0;
for(i=0;i<n;++i) {
j0 = Ai[i];
j1 = Ai[i+1];
for(j=j0;j!==j1;++j) {
Rj[p] = i;
Ri[p] = Aj[j];
Rv[p] = Av[j];
++p;
}
}
return [Ri,Rj,Rv];
};
// The following sparse linear algebra routines are deprecated.
numeric.sdim = function dim(A,ret,k) {
if(typeof ret === "undefined") { ret = []; }
if(typeof A !== "object") return ret;
if(typeof k === "undefined") { k=0; }
if(!(k in ret)) { ret[k] = 0; }
if(A.length > ret[k]) ret[k] = A.length;
var i;
for(i in A) {
if(A.hasOwnProperty(i)) dim(A[i],ret,k+1);
}
return ret;
};
numeric.sclone = function clone(A,k,n) {
if(typeof k === "undefined") { k=0; }
if(typeof n === "undefined") { n = numeric.sdim(A).length; }
var i,ret = Array(A.length);
if(k === n-1) {
for(i in A) { if(A.hasOwnProperty(i)) ret[i] = A[i]; }
return ret;
}
for(i in A) {
if(A.hasOwnProperty(i)) ret[i] = clone(A[i],k+1,n);
}
return ret;
};
numeric.sdiag = function diag(d) {
var n = d.length,i,ret = Array(n),i1,i2,i3;
for(i=n-1;i>=1;i-=2) {
i1 = i-1;
ret[i] = []; ret[i][i] = d[i];
ret[i1] = []; ret[i1][i1] = d[i1];
}
if(i===0) { ret[0] = []; ret[0][0] = d[i]; }
return ret;
};
numeric.sidentity = function identity(n) { return numeric.sdiag(numeric.rep([n],1)); };
numeric.stranspose = function transpose(A) {
var ret = [], n = A.length, i,j,Ai;
for(i in A) {
if(!(A.hasOwnProperty(i))) continue;
Ai = A[i];
for(j in Ai) {
if(!(Ai.hasOwnProperty(j))) continue;
if(typeof ret[j] !== "object") { ret[j] = []; }
ret[j][i] = Ai[j];
}
}
return ret;
};
numeric.sLUP = function LUP(A,tol) {
throw new Error("The function numeric.sLUP had a bug in it and has been removed. Please use the new numeric.ccsLUP function instead.");
};
numeric.sdotMM = function dotMM(A,B) {
var p = A.length, q = B.length, BT = numeric.stranspose(B), r = BT.length, Ai, BTk;
var i,j,k,accum;
var ret = Array(p),reti;
for(i=p-1;i>=0;i--) {
reti = [];
Ai = A[i];
for(k=r-1;k>=0;k--) {
accum = 0;
BTk = BT[k];
for(j in Ai) {
if(!(Ai.hasOwnProperty(j))) continue;
if(j in BTk) { accum += Ai[j]*BTk[j]; }
}
if(accum) reti[k] = accum;
}
ret[i] = reti;
}
return ret;
};
numeric.sdotMV = function dotMV(A,x) {
var p = A.length, Ai, i,j;
var ret = Array(p), accum;
for(i=p-1;i>=0;i--) {
Ai = A[i];
accum = 0;
for(j in Ai) {
if(!(Ai.hasOwnProperty(j))) continue;
if(x[j]) accum += Ai[j]*x[j];
}
if(accum) ret[i] = accum;
}
return ret;
};
numeric.sdotVM = function dotMV(x,A) {
var i,j,Ai,alpha;
var ret = [], accum;
for(i in x) {
if(!x.hasOwnProperty(i)) continue;
Ai = A[i];
alpha = x[i];
for(j in Ai) {
if(!Ai.hasOwnProperty(j)) continue;
if(!ret[j]) { ret[j] = 0; }
ret[j] += alpha*Ai[j];
}
}
return ret;
};
numeric.sdotVV = function dotVV(x,y) {
var i,ret=0;
for(i in x) { if(x[i] && y[i]) ret+= x[i]*y[i]; }
return ret;
};
numeric.sdot = function dot(A,B) {
var m = numeric.sdim(A).length, n = numeric.sdim(B).length;
var k = m*1000+n;
switch(k) {
case 0: return A*B;
case 1001: return numeric.sdotVV(A,B);
case 2001: return numeric.sdotMV(A,B);
case 1002: return numeric.sdotVM(A,B);
case 2002: return numeric.sdotMM(A,B);
default: throw new Error('numeric.sdot not implemented for tensors of order '+m+' and '+n);
}
};
numeric.sscatter = function scatter(V) {
var n = V[0].length, Vij, i, j, m = V.length, A = [], Aj;
for(i=n-1;i>=0;--i) {
if(!V[m-1][i]) continue;
Aj = A;
for(j=0;j<m-2;j++) {
Vij = V[j][i];
if(!Aj[Vij]) Aj[Vij] = [];
Aj = Aj[Vij];
}
Aj[V[j][i]] = V[j+1][i];
}
return A;
};
numeric.sgather = function gather(A,ret,k) {
if(typeof ret === "undefined") ret = [];
if(typeof k === "undefined") k = [];
var n,i,Ai;
n = k.length;
for(i in A) {
if(A.hasOwnProperty(i)) {
k[n] = parseInt(i);
Ai = A[i];
if(typeof Ai === "number") {
if(Ai) {
if(ret.length === 0) {
for(i=n+1;i>=0;--i) ret[i] = [];
}
for(i=n;i>=0;--i) ret[i].push(k[i]);
ret[n+1].push(Ai);
}
} else gather(Ai,ret,k);
}
}
if(k.length>n) k.pop();
return ret;
};
// 6. Coordinate matrices
numeric.cLU = function LU(A) {
var I = A[0], J = A[1], V = A[2];
var p = I.length, m=0, i,j,k,a,b,c;
for(i=0;i<p;i++) if(I[i]>m) m=I[i];
m++;
var L = Array(m), U = Array(m), left = numeric.rep([m],Infinity), right = numeric.rep([m],-Infinity);
var Ui, Uj,alpha;
for(k=0;k<p;k++) {
i = I[k];
j = J[k];
if(j<left[i]) left[i] = j;
if(j>right[i]) right[i] = j;
}
for(i=0;i<m-1;i++) { if(right[i] > right[i+1]) right[i+1] = right[i]; }
for(i=m-1;i>=1;i--) { if(left[i]<left[i-1]) left[i-1] = left[i]; }
var countL = 0, countU = 0;
for(i=0;i<m;i++) {
U[i] = numeric.rep([right[i]-left[i]+1],0);
L[i] = numeric.rep([i-left[i]],0);
countL += i-left[i]+1;
countU += right[i]-i+1;
}
for(k=0;k<p;k++) { i = I[k]; U[i][J[k]-left[i]] = V[k]; }
for(i=0;i<m-1;i++) {
a = i-left[i];
Ui = U[i];
for(j=i+1;left[j]<=i && j<m;j++) {
b = i-left[j];
c = right[i]-i;
Uj = U[j];
alpha = Uj[b]/Ui[a];
if(alpha) {
for(k=1;k<=c;k++) { Uj[k+b] -= alpha*Ui[k+a]; }
L[j][i-left[j]] = alpha;
}
}
}
var Ui = [], Uj = [], Uv = [], Li = [], Lj = [], Lv = [];
var p,q,foo;
p=0; q=0;
for(i=0;i<m;i++) {
a = left[i];
b = right[i];
foo = U[i];
for(j=i;j<=b;j++) {
if(foo[j-a]) {
Ui[p] = i;
Uj[p] = j;
Uv[p] = foo[j-a];
p++;
}
}
foo = L[i];
for(j=a;j<i;j++) {
if(foo[j-a]) {
Li[q] = i;
Lj[q] = j;
Lv[q] = foo[j-a];
q++;
}
}
Li[q] = i;
Lj[q] = i;
Lv[q] = 1;
q++;
}
return {U:[Ui,Uj,Uv], L:[Li,Lj,Lv]};
};
numeric.cLUsolve = function LUsolve(lu,b) {
var L = lu.L, U = lu.U, ret = numeric.clone(b);
var Li = L[0], Lj = L[1], Lv = L[2];
var Ui = U[0], Uj = U[1], Uv = U[2];
var p = Ui.length, q = Li.length;
var m = ret.length,i,j,k;
k = 0;
for(i=0;i<m;i++) {
while(Lj[k] < i) {
ret[i] -= Lv[k]*ret[Lj[k]];
k++;
}
k++;
}
k = p-1;
for(i=m-1;i>=0;i--) {
while(Uj[k] > i) {
ret[i] -= Uv[k]*ret[Uj[k]];
k--;
}
ret[i] /= Uv[k];
k--;
}
return ret;
};
numeric.cgrid = function grid(n,shape) {
if(typeof n === "number") n = [n,n];
var ret = numeric.rep(n,-1);
var i,j,count;
if(typeof shape !== "function") {
switch(shape) {
case 'L':
shape = function(i,j) { return (i>=n[0]/2 || j<n[1]/2); };
break;
default:
shape = function(i,j) { return true; };
break;
}
}
count=0;
for(i=1;i<n[0]-1;i++) for(j=1;j<n[1]-1;j++)
if(shape(i,j)) {
ret[i][j] = count;
count++;
}
return ret;
};
numeric.cdelsq = function delsq(g) {
var dir = [[-1,0],[0,-1],[0,1],[1,0]];
var s = numeric.dim(g), m = s[0], n = s[1], i,j,k,p,q;
var Li = [], Lj = [], Lv = [];
for(i=1;i<m-1;i++) for(j=1;j<n-1;j++) {
if(g[i][j]<0) continue;
for(k=0;k<4;k++) {
p = i+dir[k][0];
q = j+dir[k][1];
if(g[p][q]<0) continue;
Li.push(g[i][j]);
Lj.push(g[p][q]);
Lv.push(-1);
}
Li.push(g[i][j]);
Lj.push(g[i][j]);
Lv.push(4);
}
return [Li,Lj,Lv];
};
numeric.cdotMV = function dotMV(A,x) {
var ret, Ai = A[0], Aj = A[1], Av = A[2],k,p=Ai.length,N;
N=0;
for(k=0;k<p;k++) { if(Ai[k]>N) N = Ai[k]; }
N++;
ret = numeric.rep([N],0);
for(k=0;k<p;k++) { ret[Ai[k]]+=Av[k]*x[Aj[k]]; }
return ret;
};
// 7. Splines
numeric.Spline = function Spline(x,yl,yr,kl,kr) { this.x = x; this.yl = yl; this.yr = yr; this.kl = kl; this.kr = kr; };
numeric.Spline.prototype._at = function _at(x1,p) {
var x = this.x;
var yl = this.yl;
var yr = this.yr;
var kl = this.kl;
var kr = this.kr;
var x1,a,b,t;
var add = numeric.add, sub = numeric.sub, mul = numeric.mul;
a = sub(mul(kl[p],x[p+1]-x[p]),sub(yr[p+1],yl[p]));
b = add(mul(kr[p+1],x[p]-x[p+1]),sub(yr[p+1],yl[p]));
t = (x1-x[p])/(x[p+1]-x[p]);
var s = t*(1-t);
return add(add(add(mul(1-t,yl[p]),mul(t,yr[p+1])),mul(a,s*(1-t))),mul(b,s*t));
};
numeric.Spline.prototype.at = function at(x0) {
if(typeof x0 === "number") {
var x = this.x;
var n = x.length;
var p,q,mid,floor = Math.floor,a,b,t;
p = 0;
q = n-1;
while(q-p>1) {
mid = floor((p+q)/2);
if(x[mid] <= x0) p = mid;
else q = mid;
}
return this._at(x0,p);
}
var n = x0.length, i, ret = Array(n);
for(i=n-1;i!==-1;--i) ret[i] = this.at(x0[i]);
return ret;
};
numeric.Spline.prototype.diff = function diff() {
var x = this.x;
var yl = this.yl;
var yr = this.yr;
var kl = this.kl;
var kr = this.kr;
var n = yl.length;
var i,dx,dy;
var zl = kl, zr = kr, pl = Array(n), pr = Array(n);
var add = numeric.add, mul = numeric.mul, div = numeric.div, sub = numeric.sub;
for(i=n-1;i!==-1;--i) {
dx = x[i+1]-x[i];
dy = sub(yr[i+1],yl[i]);
pl[i] = div(add(mul(dy, 6),mul(kl[i],-4*dx),mul(kr[i+1],-2*dx)),dx*dx);
pr[i+1] = div(add(mul(dy,-6),mul(kl[i], 2*dx),mul(kr[i+1], 4*dx)),dx*dx);
}
return new numeric.Spline(x,zl,zr,pl,pr);
};
numeric.Spline.prototype.roots = function roots() {
function sqr(x) { return x*x; }
var ret = [];
var x = this.x, yl = this.yl, yr = this.yr, kl = this.kl, kr = this.kr;
if(typeof yl[0] === "number") {
yl = [yl];
yr = [yr];
kl = [kl];
kr = [kr];
}
var m = yl.length,n=x.length-1,i,j,k,y,s,t;
var ai,bi,ci,di, ret = Array(m),ri,k0,k1,y0,y1,A,B,D,dx,cx,stops,z0,z1,zm,t0,t1,tm;
var sqrt = Math.sqrt;
for(i=0;i!==m;++i) {
ai = yl[i];
bi = yr[i];
ci = kl[i];
di = kr[i];
ri = [];
for(j=0;j!==n;j++) {
if(j>0 && bi[j]*ai[j]<0) ri.push(x[j]);
dx = (x[j+1]-x[j]);
cx = x[j];
y0 = ai[j];
y1 = bi[j+1];
k0 = ci[j]/dx;
k1 = di[j+1]/dx;
D = sqr(k0-k1+3*(y0-y1)) + 12*k1*y0;
A = k1+3*y0+2*k0-3*y1;
B = 3*(k1+k0+2*(y0-y1));
if(D<=0) {
z0 = A/B;
if(z0>x[j] && z0<x[j+1]) stops = [x[j],z0,x[j+1]];
else stops = [x[j],x[j+1]];
} else {
z0 = (A-sqrt(D))/B;
z1 = (A+sqrt(D))/B;
stops = [x[j]];
if(z0>x[j] && z0<x[j+1]) stops.push(z0);
if(z1>x[j] && z1<x[j+1]) stops.push(z1);
stops.push(x[j+1]);
}
t0 = stops[0];
z0 = this._at(t0,j);
for(k=0;k<stops.length-1;k++) {
t1 = stops[k+1];
z1 = this._at(t1,j);
if(z0 === 0) {
ri.push(t0);
t0 = t1;
z0 = z1;
continue;
}
if(z1 === 0 || z0*z1>0) {
t0 = t1;
z0 = z1;
continue;
}
var side = 0;
while(1) {
tm = (z0*t1-z1*t0)/(z0-z1);
if(tm <= t0 || tm >= t1) { break; }
zm = this._at(tm,j);
if(zm*z1>0) {
t1 = tm;
z1 = zm;
if(side === -1) z0*=0.5;
side = -1;
} else if(zm*z0>0) {
t0 = tm;
z0 = zm;
if(side === 1) z1*=0.5;
side = 1;
} else break;
}
ri.push(tm);
t0 = stops[k+1];
z0 = this._at(t0, j);
}
if(z1 === 0) ri.push(t1);
}
ret[i] = ri;
}
if(typeof this.yl[0] === "number") return ret[0];
return ret;
};
numeric.spline = function spline(x,y,k1,kn) {
var n = x.length, b = [], dx = [], dy = [];
var i;
var sub = numeric.sub,mul = numeric.mul,add = numeric.add;
for(i=n-2;i>=0;i--) { dx[i] = x[i+1]-x[i]; dy[i] = sub(y[i+1],y[i]); }
if(typeof k1 === "string" || typeof kn === "string") {
k1 = kn = "periodic";
}
// Build sparse tridiagonal system
var T = [[],[],[]];
switch(typeof k1) {
case "undefined":
b[0] = mul(3/(dx[0]*dx[0]),dy[0]);
T[0].push(0,0);
T[1].push(0,1);
T[2].push(2/dx[0],1/dx[0]);
break;
case "string":
b[0] = add(mul(3/(dx[n-2]*dx[n-2]),dy[n-2]),mul(3/(dx[0]*dx[0]),dy[0]));
T[0].push(0,0,0);
T[1].push(n-2,0,1);
T[2].push(1/dx[n-2],2/dx[n-2]+2/dx[0],1/dx[0]);
break;
default:
b[0] = k1;
T[0].push(0);
T[1].push(0);
T[2].push(1);
break;
}
for(i=1;i<n-1;i++) {
b[i] = add(mul(3/(dx[i-1]*dx[i-1]),dy[i-1]),mul(3/(dx[i]*dx[i]),dy[i]));
T[0].push(i,i,i);
T[1].push(i-1,i,i+1);
T[2].push(1/dx[i-1],2/dx[i-1]+2/dx[i],1/dx[i]);
}
switch(typeof kn) {
case "undefined":
b[n-1] = mul(3/(dx[n-2]*dx[n-2]),dy[n-2]);
T[0].push(n-1,n-1);
T[1].push(n-2,n-1);
T[2].push(1/dx[n-2],2/dx[n-2]);
break;
case "string":
T[1][T[1].length-1] = 0;
break;
default:
b[n-1] = kn;
T[0].push(n-1);
T[1].push(n-1);
T[2].push(1);
break;
}
if(typeof b[0] !== "number") b = numeric.transpose(b);
else b = [b];
var k = Array(b.length);
if(typeof k1 === "string") {
for(i=k.length-1;i!==-1;--i) {
k[i] = numeric.ccsLUPSolve(numeric.ccsLUP(numeric.ccsScatter(T)),b[i]);
k[i][n-1] = k[i][0];
}
} else {
for(i=k.length-1;i!==-1;--i) {
k[i] = numeric.cLUsolve(numeric.cLU(T),b[i]);
}
}
if(typeof y[0] === "number") k = k[0];
else k = numeric.transpose(k);
return new numeric.Spline(x,y,y,k,k);
};
// 8. FFT
numeric.fftpow2 = function fftpow2(x,y) {
var n = x.length;
if(n === 1) return;
var cos = Math.cos, sin = Math.sin, i,j;
var xe = Array(n/2), ye = Array(n/2), xo = Array(n/2), yo = Array(n/2);
j = n/2;
for(i=n-1;i!==-1;--i) {
--j;
xo[j] = x[i];
yo[j] = y[i];
--i;
xe[j] = x[i];
ye[j] = y[i];
}
fftpow2(xe,ye);
fftpow2(xo,yo);
j = n/2;
var t,k = (-6.2831853071795864769252867665590057683943387987502116419/n),ci,si;
for(i=n-1;i!==-1;--i) {
--j;
if(j === -1) j = n/2-1;
t = k*i;
ci = cos(t);
si = sin(t);
x[i] = xe[j] + ci*xo[j] - si*yo[j];
y[i] = ye[j] + ci*yo[j] + si*xo[j];
}
};
numeric._ifftpow2 = function _ifftpow2(x,y) {
var n = x.length;
if(n === 1) return;
var cos = Math.cos, sin = Math.sin, i,j;
var xe = Array(n/2), ye = Array(n/2), xo = Array(n/2), yo = Array(n/2);
j = n/2;
for(i=n-1;i!==-1;--i) {
--j;
xo[j] = x[i];
yo[j] = y[i];
--i;
xe[j] = x[i];
ye[j] = y[i];
}
_ifftpow2(xe,ye);
_ifftpow2(xo,yo);
j = n/2;
var t,k = (6.2831853071795864769252867665590057683943387987502116419/n),ci,si;
for(i=n-1;i!==-1;--i) {
--j;
if(j === -1) j = n/2-1;
t = k*i;
ci = cos(t);
si = sin(t);
x[i] = xe[j] + ci*xo[j] - si*yo[j];
y[i] = ye[j] + ci*yo[j] + si*xo[j];
}
};
numeric.ifftpow2 = function ifftpow2(x,y) {
numeric._ifftpow2(x,y);
numeric.diveq(x,x.length);
numeric.diveq(y,y.length);
};
numeric.convpow2 = function convpow2(ax,ay,bx,by) {
numeric.fftpow2(ax,ay);
numeric.fftpow2(bx,by);
var i,n = ax.length,axi,bxi,ayi,byi;
for(i=n-1;i!==-1;--i) {
axi = ax[i]; ayi = ay[i]; bxi = bx[i]; byi = by[i];
ax[i] = axi*bxi-ayi*byi;
ay[i] = axi*byi+ayi*bxi;
}
numeric.ifftpow2(ax,ay);
};
numeric.T.prototype.fft = function fft() {
var x = this.x, y = this.y;
var n = x.length, log = Math.log, log2 = log(2),
p = Math.ceil(log(2*n-1)/log2), m = Math.pow(2,p);
var cx = numeric.rep([m],0), cy = numeric.rep([m],0), cos = Math.cos, sin = Math.sin;
var k, c = (-3.141592653589793238462643383279502884197169399375105820/n),t;
var a = numeric.rep([m],0), b = numeric.rep([m],0),nhalf = Math.floor(n/2);
for(k=0;k<n;k++) a[k] = x[k];
if(typeof y !== "undefined") for(k=0;k<n;k++) b[k] = y[k];
cx[0] = 1;
for(k=1;k<=m/2;k++) {
t = c*k*k;
cx[k] = cos(t);
cy[k] = sin(t);
cx[m-k] = cos(t);
cy[m-k] = sin(t);
}
var X = new numeric.T(a,b), Y = new numeric.T(cx,cy);
X = X.mul(Y);
numeric.convpow2(X.x,X.y,numeric.clone(Y.x),numeric.neg(Y.y));
X = X.mul(Y);
X.x.length = n;
X.y.length = n;
return X;
};
numeric.T.prototype.ifft = function ifft() {
var x = this.x, y = this.y;
var n = x.length, log = Math.log, log2 = log(2),
p = Math.ceil(log(2*n-1)/log2), m = Math.pow(2,p);
var cx = numeric.rep([m],0), cy = numeric.rep([m],0), cos = Math.cos, sin = Math.sin;
var k, c = (3.141592653589793238462643383279502884197169399375105820/n),t;
var a = numeric.rep([m],0), b = numeric.rep([m],0),nhalf = Math.floor(n/2);
for(k=0;k<n;k++) a[k] = x[k];
if(typeof y !== "undefined") for(k=0;k<n;k++) b[k] = y[k];
cx[0] = 1;
for(k=1;k<=m/2;k++) {
t = c*k*k;
cx[k] = cos(t);
cy[k] = sin(t);
cx[m-k] = cos(t);
cy[m-k] = sin(t);
}
var X = new numeric.T(a,b), Y = new numeric.T(cx,cy);
X = X.mul(Y);
numeric.convpow2(X.x,X.y,numeric.clone(Y.x),numeric.neg(Y.y));
X = X.mul(Y);
X.x.length = n;
X.y.length = n;
return X.div(n);
};
//9. Unconstrained optimization
numeric.gradient = function gradient(f,x) {
var n = x.length;
var f0 = f(x);
if(isNaN(f0)) throw new Error('gradient: f(x) is a NaN!');
var max = Math.max;
var i,x0 = numeric.clone(x),f1,f2, J = Array(n);
var div = numeric.div, sub = numeric.sub,errest,roundoff,max = Math.max,eps = 1e-3,abs = Math.abs, min = Math.min;
var t0,t1,t2,it=0,d1,d2,N;
for(i=0;i<n;i++) {
var h = max(1e-6*f0,1e-8);
while(1) {
++it;
if(it>20) { throw new Error("Numerical gradient fails"); }
x0[i] = x[i]+h;
f1 = f(x0);
x0[i] = x[i]-h;
f2 = f(x0);
x0[i] = x[i];
if(isNaN(f1) || isNaN(f2)) { h/=16; continue; }
J[i] = (f1-f2)/(2*h);
t0 = x[i]-h;
t1 = x[i];
t2 = x[i]+h;
d1 = (f1-f0)/h;
d2 = (f0-f2)/h;
N = max(abs(J[i]),abs(f0),abs(f1),abs(f2),abs(t0),abs(t1),abs(t2),1e-8);
errest = min(max(abs(d1-J[i]),abs(d2-J[i]),abs(d1-d2))/N,h/N);
if(errest>eps) { h/=16; }
else break;
}
}
return J;
};
numeric.uncmin = function uncmin(f,x0,tol,gradient,maxit,callback,options) {
var grad = numeric.gradient;
if(typeof options === "undefined") { options = {}; }
if(typeof tol === "undefined") { tol = 1e-8; }
if(typeof gradient === "undefined") { gradient = function(x) { return grad(f,x); }; }
if(typeof maxit === "undefined") maxit = 1000;
x0 = numeric.clone(x0);
var n = x0.length;
var f0 = f(x0),f1,df0;
if(isNaN(f0)) throw new Error('uncmin: f(x0) is a NaN!');
var max = Math.max, norm2 = numeric.norm2;
tol = max(tol,numeric.epsilon);
var step,g0,g1,H1 = options.Hinv || numeric.identity(n);
var dot = numeric.dot, inv = numeric.inv, sub = numeric.sub, add = numeric.add, ten = numeric.tensor, div = numeric.div, mul = numeric.mul;
var all = numeric.all, isfinite = numeric.isFinite, neg = numeric.neg;
var it=0,i,s,x1,y,Hy,Hs,ys,i0,t,nstep,t1,t2;
var msg = "";
g0 = gradient(x0);
while(it<maxit) {
if(typeof callback === "function") { if(callback(it,x0,f0,g0,H1)) { msg = "Callback returned true"; break; } }
if(!all(isfinite(g0))) { msg = "Gradient has Infinity or NaN"; break; }
step = neg(dot(H1,g0));
if(!all(isfinite(step))) { msg = "Search direction has Infinity or NaN"; break; }
nstep = norm2(step);
if(nstep < tol) { msg="Newton step smaller than tol"; break; }
t = 1;
df0 = dot(g0,step);
// line search
x1 = x0;
while(it < maxit) {
if(t*nstep < tol) { break; }
s = mul(step,t);
x1 = add(x0,s);
f1 = f(x1);
if(f1-f0 >= 0.1*t*df0 || isNaN(f1)) {
t *= 0.5;
++it;
continue;
}
break;
}
if(t*nstep < tol) { msg = "Line search step size smaller than tol"; break; }
if(it === maxit) { msg = "maxit reached during line search"; break; }
g1 = gradient(x1);
y = sub(g1,g0);
ys = dot(y,s);
Hy = dot(H1,y);
H1 = sub(add(H1,
mul(
(ys+dot(y,Hy))/(ys*ys),
ten(s,s) )),
div(add(ten(Hy,s),ten(s,Hy)),ys));
x0 = x1;
f0 = f1;
g0 = g1;
++it;
}
return {solution: x0, f: f0, gradient: g0, invHessian: H1, iterations:it, message: msg};
};
// 10. Ode solver (Dormand-Prince)
numeric.Dopri = function Dopri(x,y,f,ymid,iterations,msg,events) {
this.x = x;
this.y = y;
this.f = f;
this.ymid = ymid;
this.iterations = iterations;
this.events = events;
this.message = msg;
};
numeric.Dopri.prototype._at = function _at(xi,j) {
function sqr(x) { return x*x; }
var sol = this;
var xs = sol.x;
var ys = sol.y;
var k1 = sol.f;
var ymid = sol.ymid;
var n = xs.length;
var x0,x1,xh,y0,y1,yh,xi;
var floor = Math.floor,h;
var c = 0.5;
var add = numeric.add, mul = numeric.mul,sub = numeric.sub, p,q,w;
x0 = xs[j];
x1 = xs[j+1];
y0 = ys[j];
y1 = ys[j+1];
h = x1-x0;
xh = x0+c*h;
yh = ymid[j];
p = sub(k1[j ],mul(y0,1/(x0-xh)+2/(x0-x1)));
q = sub(k1[j+1],mul(y1,1/(x1-xh)+2/(x1-x0)));
w = [sqr(xi - x1) * (xi - xh) / sqr(x0 - x1) / (x0 - xh),
sqr(xi - x0) * sqr(xi - x1) / sqr(x0 - xh) / sqr(x1 - xh),
sqr(xi - x0) * (xi - xh) / sqr(x1 - x0) / (x1 - xh),
(xi - x0) * sqr(xi - x1) * (xi - xh) / sqr(x0-x1) / (x0 - xh),
(xi - x1) * sqr(xi - x0) * (xi - xh) / sqr(x0-x1) / (x1 - xh)];
return add(add(add(add(mul(y0,w[0]),
mul(yh,w[1])),
mul(y1,w[2])),
mul( p,w[3])),
mul( q,w[4]));
};
numeric.Dopri.prototype.at = function at(x) {
var i,j,k,floor = Math.floor;
if(typeof x !== "number") {
var n = x.length, ret = Array(n);
for(i=n-1;i!==-1;--i) {
ret[i] = this.at(x[i]);
}
return ret;
}
var x0 = this.x;
i = 0; j = x0.length-1;
while(j-i>1) {
k = floor(0.5*(i+j));
if(x0[k] <= x) i = k;
else j = k;
}
return this._at(x,i);
};
numeric.dopri = function dopri(x0,x1,y0,f,tol,maxit,event) {
if(typeof tol === "undefined") { tol = 1e-6; }
if(typeof maxit === "undefined") { maxit = 1000; }
var xs = [x0], ys = [y0], k1 = [f(x0,y0)], k2,k3,k4,k5,k6,k7, ymid = [];
var A2 = 1/5;
var A3 = [3/40,9/40];
var A4 = [44/45,-56/15,32/9];
var A5 = [19372/6561,-25360/2187,64448/6561,-212/729];
var A6 = [9017/3168,-355/33,46732/5247,49/176,-5103/18656];
var b = [35/384,0,500/1113,125/192,-2187/6784,11/84];
var bm = [0.5*6025192743/30085553152,
0,
0.5*51252292925/65400821598,
0.5*-2691868925/45128329728,
0.5*187940372067/1594534317056,
0.5*-1776094331/19743644256,
0.5*11237099/235043384];
var c = [1/5,3/10,4/5,8/9,1,1];
var e = [-71/57600,0,71/16695,-71/1920,17253/339200,-22/525,1/40];
var i = 0,er,j;
var h = (x1-x0)/10;
var it = 0;
var add = numeric.add, mul = numeric.mul, y1,erinf;
var max = Math.max, min = Math.min, abs = Math.abs, norminf = numeric.norminf,pow = Math.pow;
var any = numeric.any, lt = numeric.lt, and = numeric.and, sub = numeric.sub;
var e0, e1, ev;
var ret = new numeric.Dopri(xs,ys,k1,ymid,-1,"");
if(typeof event === "function") e0 = event(x0,y0);
while(x0<x1 && it<maxit) {
++it;
if(x0+h>x1) h = x1-x0;
k2 = f(x0+c[0]*h, add(y0,mul( A2*h,k1[i])));
k3 = f(x0+c[1]*h, add(add(y0,mul(A3[0]*h,k1[i])),mul(A3[1]*h,k2)));
k4 = f(x0+c[2]*h, add(add(add(y0,mul(A4[0]*h,k1[i])),mul(A4[1]*h,k2)),mul(A4[2]*h,k3)));
k5 = f(x0+c[3]*h, add(add(add(add(y0,mul(A5[0]*h,k1[i])),mul(A5[1]*h,k2)),mul(A5[2]*h,k3)),mul(A5[3]*h,k4)));
k6 = f(x0+c[4]*h,add(add(add(add(add(y0,mul(A6[0]*h,k1[i])),mul(A6[1]*h,k2)),mul(A6[2]*h,k3)),mul(A6[3]*h,k4)),mul(A6[4]*h,k5)));
y1 = add(add(add(add(add(y0,mul(k1[i],h*b[0])),mul(k3,h*b[2])),mul(k4,h*b[3])),mul(k5,h*b[4])),mul(k6,h*b[5]));
k7 = f(x0+h,y1);
er = add(add(add(add(add(mul(k1[i],h*e[0]),mul(k3,h*e[2])),mul(k4,h*e[3])),mul(k5,h*e[4])),mul(k6,h*e[5])),mul(k7,h*e[6]));
if(typeof er === "number") erinf = abs(er);
else erinf = norminf(er);
if(erinf > tol) { // reject
h = 0.2*h*pow(tol/erinf,0.25);
if(x0+h === x0) {
ret.msg = "Step size became too small";
break;
}
continue;
}
ymid[i] = add(add(add(add(add(add(y0,
mul(k1[i],h*bm[0])),
mul(k3 ,h*bm[2])),
mul(k4 ,h*bm[3])),
mul(k5 ,h*bm[4])),
mul(k6 ,h*bm[5])),
mul(k7 ,h*bm[6]));
++i;
xs[i] = x0+h;
ys[i] = y1;
k1[i] = k7;
if(typeof event === "function") {
var yi,xl = x0,xr = x0+0.5*h,xi;
e1 = event(xr,ymid[i-1]);
ev = and(lt(e0,0),lt(0,e1));
if(!any(ev)) { xl = xr; xr = x0+h; e0 = e1; e1 = event(xr,y1); ev = and(lt(e0,0),lt(0,e1)); }
if(any(ev)) {
var xc, yc, en,ei;
var side=0, sl = 1.0, sr = 1.0;
while(1) {
if(typeof e0 === "number") xi = (sr*e1*xl-sl*e0*xr)/(sr*e1-sl*e0);
else {
xi = xr;
for(j=e0.length-1;j!==-1;--j) {
if(e0[j]<0 && e1[j]>0) xi = min(xi,(sr*e1[j]*xl-sl*e0[j]*xr)/(sr*e1[j]-sl*e0[j]));
}
}
if(xi <= xl || xi >= xr) break;
yi = ret._at(xi, i-1);
ei = event(xi,yi);
en = and(lt(e0,0),lt(0,ei));
if(any(en)) {
xr = xi;
e1 = ei;
ev = en;
sr = 1.0;
if(side === -1) sl *= 0.5;
else sl = 1.0;
side = -1;
} else {
xl = xi;
e0 = ei;
sl = 1.0;
if(side === 1) sr *= 0.5;
else sr = 1.0;
side = 1;
}
}
y1 = ret._at(0.5*(x0+xi),i-1);
ret.f[i] = f(xi,yi);
ret.x[i] = xi;
ret.y[i] = yi;
ret.ymid[i-1] = y1;
ret.events = ev;
ret.iterations = it;
return ret;
}
}
x0 += h;
y0 = y1;
e0 = e1;
h = min(0.8*h*pow(tol/erinf,0.25),4*h);
}
ret.iterations = it;
return ret;
};
// 11. Ax = b
numeric.LU = function(A, fast) {
fast = fast || false;
var abs = Math.abs;
var i, j, k, absAjk, Akk, Ak, Pk, Ai;
var max;
var n = A.length, n1 = n-1;
var P = new Array(n);
if(!fast) A = numeric.clone(A);
for (k = 0; k < n; ++k) {
Pk = k;
Ak = A[k];
max = abs(Ak[k]);
for (j = k + 1; j < n; ++j) {
absAjk = abs(A[j][k]);
if (max < absAjk) {
max = absAjk;
Pk = j;
}
}
P[k] = Pk;
if (Pk != k) {
A[k] = A[Pk];
A[Pk] = Ak;
Ak = A[k];
}
Akk = Ak[k];
for (i = k + 1; i < n; ++i) {
A[i][k] /= Akk;
}
for (i = k + 1; i < n; ++i) {
Ai = A[i];
for (j = k + 1; j < n1; ++j) {
Ai[j] -= Ai[k] * Ak[j];
++j;
Ai[j] -= Ai[k] * Ak[j];
}
if(j===n1) Ai[j] -= Ai[k] * Ak[j];
}
}
return {
LU: A,
P: P
};
};
numeric.LUsolve = function LUsolve(LUP, b) {
var i, j;
var LU = LUP.LU;
var n = LU.length;
var x = numeric.clone(b);
var P = LUP.P;
var Pi, LUi, LUii, tmp;
for (i=n-1;i!==-1;--i) x[i] = b[i];
for (i = 0; i < n; ++i) {
Pi = P[i];
if (P[i] !== i) {
tmp = x[i];
x[i] = x[Pi];
x[Pi] = tmp;
}
LUi = LU[i];
for (j = 0; j < i; ++j) {
x[i] -= x[j] * LUi[j];
}
}
for (i = n - 1; i >= 0; --i) {
LUi = LU[i];
for (j = i + 1; j < n; ++j) {
x[i] -= x[j] * LUi[j];
}
x[i] /= LUi[i];
}
return x;
};
numeric.solve = function solve(A,b,fast) { return numeric.LUsolve(numeric.LU(A,fast), b); };
// 12. Linear programming
numeric.echelonize = function echelonize(A) {
var s = numeric.dim(A), m = s[0], n = s[1];
var I = numeric.identity(m);
var P = Array(m);
var i,j,k,l,Ai,Ii,Z,a;
var abs = Math.abs;
var diveq = numeric.diveq;
A = numeric.clone(A);
for(i=0;i<m;++i) {
k = 0;
Ai = A[i];
Ii = I[i];
for(j=1;j<n;++j) if(abs(Ai[k])<abs(Ai[j])) k=j;
P[i] = k;
diveq(Ii,Ai[k]);
diveq(Ai,Ai[k]);
for(j=0;j<m;++j) if(j!==i) {
Z = A[j]; a = Z[k];
for(l=n-1;l!==-1;--l) Z[l] -= Ai[l]*a;
Z = I[j];
for(l=m-1;l!==-1;--l) Z[l] -= Ii[l]*a;
}
}
return {I:I, A:A, P:P};
};
numeric.__solveLP = function __solveLP(c,A,b,tol,maxit,x,flag) {
var sum = numeric.sum, log = numeric.log, mul = numeric.mul, sub = numeric.sub, dot = numeric.dot, div = numeric.div, add = numeric.add;
var m = c.length, n = b.length,y;
var unbounded = false, cb,i0=0;
var alpha = 1.0;
var f0,df0,AT = numeric.transpose(A), svd = numeric.svd,transpose = numeric.transpose,leq = numeric.leq, sqrt = Math.sqrt, abs = Math.abs;
var muleq = numeric.muleq;
var norm = numeric.norminf, any = numeric.any,min = Math.min;
var all = numeric.all, gt = numeric.gt;
var p = Array(m), A0 = Array(n),e=numeric.rep([n],1), H;
var solve = numeric.solve, z = sub(b,dot(A,x)),count;
var dotcc = dot(c,c);
var g;
for(count=i0;count<maxit;++count) {
var i,j,d;
for(i=n-1;i!==-1;--i) A0[i] = div(A[i],z[i]);
var A1 = transpose(A0);
for(i=m-1;i!==-1;--i) p[i] = (/*x[i]+*/sum(A1[i]));
alpha = 0.25*abs(dotcc/dot(c,p));
var a1 = 100*sqrt(dotcc/dot(p,p));
if(!isFinite(alpha) || alpha>a1) alpha = a1;
g = add(c,mul(alpha,p));
H = dot(A1,A0);
for(i=m-1;i!==-1;--i) H[i][i] += 1;
d = solve(H,div(g,alpha),true);
var t0 = div(z,dot(A,d));
var t = 1.0;
for(i=n-1;i!==-1;--i) if(t0[i]<0) t = min(t,-0.999*t0[i]);
y = sub(x,mul(d,t));
z = sub(b,dot(A,y));
if(!all(gt(z,0))) return { solution: x, message: "", iterations: count };
x = y;
if(alpha<tol) return { solution: y, message: "", iterations: count };
if(flag) {
var s = dot(c,g), Ag = dot(A,g);
unbounded = true;
for(i=n-1;i!==-1;--i) if(s*Ag[i]<0) { unbounded = false; break; }
} else {
if(x[m-1]>=0) unbounded = false;
else unbounded = true;
}
if(unbounded) return { solution: y, message: "Unbounded", iterations: count };
}
return { solution: x, message: "maximum iteration count exceeded", iterations:count };
};
numeric._solveLP = function _solveLP(c,A,b,tol,maxit) {
var m = c.length, n = b.length,y;
var sum = numeric.sum, log = numeric.log, mul = numeric.mul, sub = numeric.sub, dot = numeric.dot, div = numeric.div, add = numeric.add;
var c0 = numeric.rep([m],0).concat([1]);
var J = numeric.rep([n,1],-1);
var A0 = numeric.blockMatrix([[A , J ]]);
var b0 = b;
var y = numeric.rep([m],0).concat(Math.max(0,numeric.sup(numeric.neg(b)))+1);
var x0 = numeric.__solveLP(c0,A0,b0,tol,maxit,y,false);
var x = numeric.clone(x0.solution);
x.length = m;
var foo = numeric.inf(sub(b,dot(A,x)));
if(foo<0) { return { solution: NaN, message: "Infeasible", iterations: x0.iterations }; }
var ret = numeric.__solveLP(c, A, b, tol, maxit-x0.iterations, x, true);
ret.iterations += x0.iterations;
return ret;
};
numeric.solveLP = function solveLP(c,A,b,Aeq,beq,tol,maxit) {
if(typeof maxit === "undefined") maxit = 1000;
if(typeof tol === "undefined") tol = numeric.epsilon;
if(typeof Aeq === "undefined") return numeric._solveLP(c,A,b,tol,maxit);
var m = Aeq.length, n = Aeq[0].length, o = A.length;
var B = numeric.echelonize(Aeq);
var flags = numeric.rep([n],0);
var P = B.P;
var Q = [];
var i;
for(i=P.length-1;i!==-1;--i) flags[P[i]] = 1;
for(i=n-1;i!==-1;--i) if(flags[i]===0) Q.push(i);
var g = numeric.getRange;
var I = numeric.linspace(0,m-1), J = numeric.linspace(0,o-1);
var Aeq2 = g(Aeq,I,Q), A1 = g(A,J,P), A2 = g(A,J,Q), dot = numeric.dot, sub = numeric.sub;
var A3 = dot(A1,B.I);
var A4 = sub(A2,dot(A3,Aeq2)), b4 = sub(b,dot(A3,beq));
var c1 = Array(P.length), c2 = Array(Q.length);
for(i=P.length-1;i!==-1;--i) c1[i] = c[P[i]];
for(i=Q.length-1;i!==-1;--i) c2[i] = c[Q[i]];
var c4 = sub(c2,dot(c1,dot(B.I,Aeq2)));
var S = numeric._solveLP(c4,A4,b4,tol,maxit);
var x2 = S.solution;
if(x2!==x2) return S;
var x1 = dot(B.I,sub(beq,dot(Aeq2,x2)));
var x = Array(c.length);
for(i=P.length-1;i!==-1;--i) x[P[i]] = x1[i];
for(i=Q.length-1;i!==-1;--i) x[Q[i]] = x2[i];
return { solution: x, message:S.message, iterations: S.iterations };
};
numeric.MPStoLP = function MPStoLP(MPS) {
if(MPS instanceof String) { MPS.split('\n'); }
var state = 0;
var states = ['Initial state','NAME','ROWS','COLUMNS','RHS','BOUNDS','ENDATA'];
var n = MPS.length;
var i,j,z,N=0,rows = {}, sign = [], rl = 0, vars = {}, nv = 0;
var name;
var c = [], A = [], b = [];
function err(e) { throw new Error('MPStoLP: '+e+'\nLine '+i+': '+MPS[i]+'\nCurrent state: '+states[state]+'\n'); }
for(i=0;i<n;++i) {
z = MPS[i];
var w0 = z.match(/\S*/g);
var w = [];
for(j=0;j<w0.length;++j) if(w0[j]!=="") w.push(w0[j]);
if(w.length === 0) continue;
for(j=0;j<states.length;++j) if(z.substr(0,states[j].length) === states[j]) break;
if(j<states.length) {
state = j;
if(j===1) { name = w[1]; }
if(j===6) return { name:name, c:c, A:numeric.transpose(A), b:b, rows:rows, vars:vars };
continue;
}
switch(state) {
case 0: case 1: err('Unexpected line');
case 2:
switch(w[0]) {
case 'N': if(N===0) N = w[1]; else err('Two or more N rows'); break;
case 'L': rows[w[1]] = rl; sign[rl] = 1; b[rl] = 0; ++rl; break;
case 'G': rows[w[1]] = rl; sign[rl] = -1;b[rl] = 0; ++rl; break;
case 'E': rows[w[1]] = rl; sign[rl] = 0;b[rl] = 0; ++rl; break;
default: err('Parse error '+numeric.prettyPrint(w));
}
break;
case 3:
if(!vars.hasOwnProperty(w[0])) { vars[w[0]] = nv; c[nv] = 0; A[nv] = numeric.rep([rl],0); ++nv; }
var p = vars[w[0]];
for(j=1;j<w.length;j+=2) {
if(w[j] === N) { c[p] = parseFloat(w[j+1]); continue; }
var q = rows[w[j]];
A[p][q] = (sign[q]<0?-1:1)*parseFloat(w[j+1]);
}
break;
case 4:
for(j=1;j<w.length;j+=2) b[rows[w[j]]] = (sign[rows[w[j]]]<0?-1:1)*parseFloat(w[j+1]);
break;
case 5: /*FIXME*/ break;
case 6: err('Internal error');
}
}
err('Reached end of file without ENDATA');
};
// seedrandom.js version 2.0.
// Author: David Bau 4/2/2011
//
// Defines a method Math.seedrandom() that, when called, substitutes
// an explicitly seeded RC4-based algorithm for Math.random(). Also
// supports automatic seeding from local or network sources of entropy.
//
// Usage:
//
// <script src=http://davidbau.com/encode/seedrandom-min.js></script>
//
// Math.seedrandom('yipee'); Sets Math.random to a function that is
// initialized using the given explicit seed.
//
// Math.seedrandom(); Sets Math.random to a function that is
// seeded using the current time, dom state,
// and other accumulated local entropy.
// The generated seed string is returned.
//
// Math.seedrandom('yowza', true);
// Seeds using the given explicit seed mixed
// together with accumulated entropy.
//
// <script src="http://bit.ly/srandom-512"></script>
// Seeds using physical random bits downloaded
// from random.org.
//
// <script src="https://jsonlib.appspot.com/urandom?callback=Math.seedrandom">
// </script> Seeds using urandom bits from call.jsonlib.com,
// which is faster than random.org.
//
// Examples:
//
// Math.seedrandom("hello"); // Use "hello" as the seed.
// document.write(Math.random()); // Always 0.5463663768140734
// document.write(Math.random()); // Always 0.43973793770592234
// var rng1 = Math.random; // Remember the current prng.
//
// var autoseed = Math.seedrandom(); // New prng with an automatic seed.
// document.write(Math.random()); // Pretty much unpredictable.
//
// Math.random = rng1; // Continue "hello" prng sequence.
// document.write(Math.random()); // Always 0.554769432473455
//
// Math.seedrandom(autoseed); // Restart at the previous seed.
// document.write(Math.random()); // Repeat the 'unpredictable' value.
//
// Notes:
//
// Each time seedrandom('arg') is called, entropy from the passed seed
// is accumulated in a pool to help generate future seeds for the
// zero-argument form of Math.seedrandom, so entropy can be injected over
// time by calling seedrandom with explicit data repeatedly.
//
// On speed - This javascript implementation of Math.random() is about
// 3-10x slower than the built-in Math.random() because it is not native
// code, but this is typically fast enough anyway. Seeding is more expensive,
// especially if you use auto-seeding. Some details (timings on Chrome 4):
//
// Our Math.random() - avg less than 0.002 milliseconds per call
// seedrandom('explicit') - avg less than 0.5 milliseconds per call
// seedrandom('explicit', true) - avg less than 2 milliseconds per call
// seedrandom() - avg about 38 milliseconds per call
//
// LICENSE (BSD):
//
// Copyright 2010 David Bau, all rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of this module nor the names of its contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
/**
* All code is in an anonymous closure to keep the global namespace clean.
*
* @param {number=} overflow
* @param {number=} startdenom
*/
// Patched by Seb so that seedrandom.js does not pollute the Math object.
// My tests suggest that doing Math.trouble = 1 makes Math lookups about 5%
// slower.
numeric.seedrandom = { pow:Math.pow, random:Math.random };
(function (pool, math, width, chunks, significance, overflow, startdenom) {
//
// seedrandom()
// This is the seedrandom function described above.
//
math['seedrandom'] = function seedrandom(seed, use_entropy) {
var key = [];
var arc4;
// Flatten the seed string or build one from local entropy if needed.
seed = mixkey(flatten(
use_entropy ? [seed, pool] :
arguments.length ? seed :
[new Date().getTime(), pool, window], 3), key);
// Use the seed to initialize an ARC4 generator.
arc4 = new ARC4(key);
// Mix the randomness into accumulated entropy.
mixkey(arc4.S, pool);
// Override Math.random
// This function returns a random double in [0, 1) that contains
// randomness in every bit of the mantissa of the IEEE 754 value.
math['random'] = function random() { // Closure to return a random double:
var n = arc4.g(chunks); // Start with a numerator n < 2 ^ 48
var d = startdenom; // and denominator d = 2 ^ 48.
var x = 0; // and no 'extra last byte'.
while (n < significance) { // Fill up all significant digits by
n = (n + x) * width; // shifting numerator and
d *= width; // denominator and generating a
x = arc4.g(1); // new least-significant-byte.
}
while (n >= overflow) { // To avoid rounding up, before adding
n /= 2; // last byte, shift everything
d /= 2; // right using integer math until
x >>>= 1; // we have exactly the desired bits.
}
return (n + x) / d; // Form the number within [0, 1).
};
// Return the seed that was used
return seed;
};
//
// ARC4
//
// An ARC4 implementation. The constructor takes a key in the form of
// an array of at most (width) integers that should be 0 <= x < (width).
//
// The g(count) method returns a pseudorandom integer that concatenates
// the next (count) outputs from ARC4. Its return value is a number x
// that is in the range 0 <= x < (width ^ count).
//
/** @constructor */
function ARC4(key) {
var t, u, me = this, keylen = key.length;
var i = 0, j = me.i = me.j = me.m = 0;
me.S = [];
me.c = [];
// The empty key [] is treated as [0].
if (!keylen) { key = [keylen++]; }
// Set up S using the standard key scheduling algorithm.
while (i < width) { me.S[i] = i++; }
for (i = 0; i < width; i++) {
t = me.S[i];
j = lowbits(j + t + key[i % keylen]);
u = me.S[j];
me.S[i] = u;
me.S[j] = t;
}
// The "g" method returns the next (count) outputs as one number.
me.g = function getnext(count) {
var s = me.S;
var i = lowbits(me.i + 1); var t = s[i];
var j = lowbits(me.j + t); var u = s[j];
s[i] = u;
s[j] = t;
var r = s[lowbits(t + u)];
while (--count) {
i = lowbits(i + 1); t = s[i];
j = lowbits(j + t); u = s[j];
s[i] = u;
s[j] = t;
r = r * width + s[lowbits(t + u)];
}
me.i = i;
me.j = j;
return r;
};
// For robust unpredictability discard an initial batch of values.
// See http://www.rsa.com/rsalabs/node.asp?id=2009
me.g(width);
}
//
// flatten()
// Converts an object tree to nested arrays of strings.
//
/** @param {Object=} result
* @param {string=} prop
* @param {string=} typ */
function flatten(obj, depth, result, prop, typ) {
result = [];
typ = typeof(obj);
if (depth && typ == 'object') {
for (prop in obj) {
if (prop.indexOf('S') < 5) { // Avoid FF3 bug (local/sessionStorage)
try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}
}
}
}
return (result.length ? result : obj + (typ != 'string' ? '\0' : ''));
}
//
// mixkey()
// Mixes a string seed into a key that is an array of integers, and
// returns a shortened string seed that is equivalent to the result key.
//
/** @param {number=} smear
* @param {number=} j */
function mixkey(seed, key, smear, j) {
seed += ''; // Ensure the seed is a string
smear = 0;
for (j = 0; j < seed.length; j++) {
key[lowbits(j)] =
lowbits((smear ^= key[lowbits(j)] * 19) + seed.charCodeAt(j));
}
seed = '';
for (j in key) { seed += String.fromCharCode(key[j]); }
return seed;
}
//
// lowbits()
// A quick "n mod width" for width a power of 2.
//
function lowbits(n) { return n & (width - 1); }
//
// The following constants are related to IEEE 754 limits.
//
startdenom = math.pow(width, chunks);
significance = math.pow(2, significance);
overflow = significance * 2;
//
// When seedrandom.js is loaded, we immediately mix a few bits
// from the built-in RNG into the entropy pool. Because we do
// not want to intefere with determinstic PRNG state later,
// seedrandom will not call math.random on its own again after
// initialization.
//
mixkey(math.random(), pool);
// End anonymous scope, and pass initial values.
}(
[], // pool: entropy pool starts empty
numeric.seedrandom, // math: package containing random, pow, and seedrandom
256, // width: each RC4 output is 0 <= x < 256
6, // chunks: at least six RC4 outputs for each double
52 // significance: there are 52 significant digits in a double
));
/* This file is a slightly modified version of quadprog.js from Alberto Santini.
* It has been slightly modified by Sébastien Loisel to make sure that it handles
* 0-based Arrays instead of 1-based Arrays.
* License is in resources/LICENSE.quadprog */
(function(exports) {
function base0to1(A) {
if(typeof A !== "object") { return A; }
var ret = [], i,n=A.length;
for(i=0;i<n;i++) ret[i+1] = base0to1(A[i]);
return ret;
}
function base1to0(A) {
if(typeof A !== "object") { return A; }
var ret = [], i,n=A.length;
for(i=1;i<n;i++) ret[i-1] = base1to0(A[i]);
return ret;
}
function dpori(a, lda, n) {
var i, j, k, kp1, t;
for (k = 1; k <= n; k = k + 1) {
a[k][k] = 1 / a[k][k];
t = -a[k][k];
//~ dscal(k - 1, t, a[1][k], 1);
for (i = 1; i < k; i = i + 1) {
a[i][k] = t * a[i][k];
}
kp1 = k + 1;
if (n < kp1) {
break;
}
for (j = kp1; j <= n; j = j + 1) {
t = a[k][j];
a[k][j] = 0;
//~ daxpy(k, t, a[1][k], 1, a[1][j], 1);
for (i = 1; i <= k; i = i + 1) {
a[i][j] = a[i][j] + (t * a[i][k]);
}
}
}
}
function dposl(a, lda, n, b) {
var i, k, kb, t;
for (k = 1; k <= n; k = k + 1) {
//~ t = ddot(k - 1, a[1][k], 1, b[1], 1);
t = 0;
for (i = 1; i < k; i = i + 1) {
t = t + (a[i][k] * b[i]);
}
b[k] = (b[k] - t) / a[k][k];
}
for (kb = 1; kb <= n; kb = kb + 1) {
k = n + 1 - kb;
b[k] = b[k] / a[k][k];
t = -b[k];
//~ daxpy(k - 1, t, a[1][k], 1, b[1], 1);
for (i = 1; i < k; i = i + 1) {
b[i] = b[i] + (t * a[i][k]);
}
}
}
function dpofa(a, lda, n, info) {
var i, j, jm1, k, t, s;
for (j = 1; j <= n; j = j + 1) {
info[1] = j;
s = 0;
jm1 = j - 1;
if (jm1 < 1) {
s = a[j][j] - s;
if (s <= 0) {
break;
}
a[j][j] = Math.sqrt(s);
} else {
for (k = 1; k <= jm1; k = k + 1) {
//~ t = a[k][j] - ddot(k - 1, a[1][k], 1, a[1][j], 1);
t = a[k][j];
for (i = 1; i < k; i = i + 1) {
t = t - (a[i][j] * a[i][k]);
}
t = t / a[k][k];
a[k][j] = t;
s = s + t * t;
}
s = a[j][j] - s;
if (s <= 0) {
break;
}
a[j][j] = Math.sqrt(s);
}
info[1] = 0;
}
}
function qpgen2(dmat, dvec, fddmat, n, sol, crval, amat,
bvec, fdamat, q, meq, iact, nact, iter, work, ierr) {
var i, j, l, l1, info, it1, iwzv, iwrv, iwrm, iwsv, iwuv, nvl, r, iwnbv,
temp, sum, t1, tt, gc, gs, nu,
t1inf, t2min,
vsmall, tmpa, tmpb,
go;
r = Math.min(n, q);
l = 2 * n + (r * (r + 5)) / 2 + 2 * q + 1;
vsmall = 1.0e-60;
do {
vsmall = vsmall + vsmall;
tmpa = 1 + 0.1 * vsmall;
tmpb = 1 + 0.2 * vsmall;
} while (tmpa <= 1 || tmpb <= 1);
for (i = 1; i <= n; i = i + 1) {
work[i] = dvec[i];
}
for (i = n + 1; i <= l; i = i + 1) {
work[i] = 0;
}
for (i = 1; i <= q; i = i + 1) {
iact[i] = 0;
}
info = [];
if (ierr[1] === 0) {
dpofa(dmat, fddmat, n, info);
if (info[1] !== 0) {
ierr[1] = 2;
return;
}
dposl(dmat, fddmat, n, dvec);
dpori(dmat, fddmat, n);
} else {
for (j = 1; j <= n; j = j + 1) {
sol[j] = 0;
for (i = 1; i <= j; i = i + 1) {
sol[j] = sol[j] + dmat[i][j] * dvec[i];
}
}
for (j = 1; j <= n; j = j + 1) {
dvec[j] = 0;
for (i = j; i <= n; i = i + 1) {
dvec[j] = dvec[j] + dmat[j][i] * sol[i];
}
}
}
crval[1] = 0;
for (j = 1; j <= n; j = j + 1) {
sol[j] = dvec[j];
crval[1] = crval[1] + work[j] * sol[j];
work[j] = 0;
for (i = j + 1; i <= n; i = i + 1) {
dmat[i][j] = 0;
}
}
crval[1] = -crval[1] / 2;
ierr[1] = 0;
iwzv = n;
iwrv = iwzv + n;
iwuv = iwrv + r;
iwrm = iwuv + r + 1;
iwsv = iwrm + (r * (r + 1)) / 2;
iwnbv = iwsv + q;
for (i = 1; i <= q; i = i + 1) {
sum = 0;
for (j = 1; j <= n; j = j + 1) {
sum = sum + amat[j][i] * amat[j][i];
}
work[iwnbv + i] = Math.sqrt(sum);
}
nact = 0;
iter[1] = 0;
iter[2] = 0;
function fn_goto_50() {
iter[1] = iter[1] + 1;
l = iwsv;
for (i = 1; i <= q; i = i + 1) {
l = l + 1;
sum = -bvec[i];
for (j = 1; j <= n; j = j + 1) {
sum = sum + amat[j][i] * sol[j];
}
if (Math.abs(sum) < vsmall) {
sum = 0;
}
if (i > meq) {
work[l] = sum;
} else {
work[l] = -Math.abs(sum);
if (sum > 0) {
for (j = 1; j <= n; j = j + 1) {
amat[j][i] = -amat[j][i];
}
bvec[i] = -bvec[i];
}
}
}
for (i = 1; i <= nact; i = i + 1) {
work[iwsv + iact[i]] = 0;
}
nvl = 0;
temp = 0;
for (i = 1; i <= q; i = i + 1) {
if (work[iwsv + i] < temp * work[iwnbv + i]) {
nvl = i;
temp = work[iwsv + i] / work[iwnbv + i];
}
}
if (nvl === 0) {
return 999;
}
return 0;
}
function fn_goto_55() {
for (i = 1; i <= n; i = i + 1) {
sum = 0;
for (j = 1; j <= n; j = j + 1) {
sum = sum + dmat[j][i] * amat[j][nvl];
}
work[i] = sum;
}
l1 = iwzv;
for (i = 1; i <= n; i = i + 1) {
work[l1 + i] = 0;
}
for (j = nact + 1; j <= n; j = j + 1) {
for (i = 1; i <= n; i = i + 1) {
work[l1 + i] = work[l1 + i] + dmat[i][j] * work[j];
}
}
t1inf = true;
for (i = nact; i >= 1; i = i - 1) {
sum = work[i];
l = iwrm + (i * (i + 3)) / 2;
l1 = l - i;
for (j = i + 1; j <= nact; j = j + 1) {
sum = sum - work[l] * work[iwrv + j];
l = l + j;
}
sum = sum / work[l1];
work[iwrv + i] = sum;
if (iact[i] < meq) {
// continue;
break;
}
if (sum < 0) {
// continue;
break;
}
t1inf = false;
it1 = i;
}
if (!t1inf) {
t1 = work[iwuv + it1] / work[iwrv + it1];
for (i = 1; i <= nact; i = i + 1) {
if (iact[i] < meq) {
// continue;
break;
}
if (work[iwrv + i] < 0) {
// continue;
break;
}
temp = work[iwuv + i] / work[iwrv + i];
if (temp < t1) {
t1 = temp;
it1 = i;
}
}
}
sum = 0;
for (i = iwzv + 1; i <= iwzv + n; i = i + 1) {
sum = sum + work[i] * work[i];
}
if (Math.abs(sum) <= vsmall) {
if (t1inf) {
ierr[1] = 1;
// GOTO 999
return 999;
} else {
for (i = 1; i <= nact; i = i + 1) {
work[iwuv + i] = work[iwuv + i] - t1 * work[iwrv + i];
}
work[iwuv + nact + 1] = work[iwuv + nact + 1] + t1;
// GOTO 700
return 700;
}
} else {
sum = 0;
for (i = 1; i <= n; i = i + 1) {
sum = sum + work[iwzv + i] * amat[i][nvl];
}
tt = -work[iwsv + nvl] / sum;
t2min = true;
if (!t1inf) {
if (t1 < tt) {
tt = t1;
t2min = false;
}
}
for (i = 1; i <= n; i = i + 1) {
sol[i] = sol[i] + tt * work[iwzv + i];
if (Math.abs(sol[i]) < vsmall) {
sol[i] = 0;
}
}
crval[1] = crval[1] + tt * sum * (tt / 2 + work[iwuv + nact + 1]);
for (i = 1; i <= nact; i = i + 1) {
work[iwuv + i] = work[iwuv + i] - tt * work[iwrv + i];
}
work[iwuv + nact + 1] = work[iwuv + nact + 1] + tt;
if (t2min) {
nact = nact + 1;
iact[nact] = nvl;
l = iwrm + ((nact - 1) * nact) / 2 + 1;
for (i = 1; i <= nact - 1; i = i + 1) {
work[l] = work[i];
l = l + 1;
}
if (nact === n) {
work[l] = work[n];
} else {
for (i = n; i >= nact + 1; i = i - 1) {
if (work[i] === 0) {
// continue;
break;
}
gc = Math.max(Math.abs(work[i - 1]), Math.abs(work[i]));
gs = Math.min(Math.abs(work[i - 1]), Math.abs(work[i]));
if (work[i - 1] >= 0) {
temp = Math.abs(gc * Math.sqrt(1 + gs * gs / (gc * gc)));
} else {
temp = -Math.abs(gc * Math.sqrt(1 + gs * gs / (gc * gc)));
}
gc = work[i - 1] / temp;
gs = work[i] / temp;
if (gc === 1) {
// continue;
break;
}
if (gc === 0) {
work[i - 1] = gs * temp;
for (j = 1; j <= n; j = j + 1) {
temp = dmat[j][i - 1];
dmat[j][i - 1] = dmat[j][i];
dmat[j][i] = temp;
}
} else {
work[i - 1] = temp;
nu = gs / (1 + gc);
for (j = 1; j <= n; j = j + 1) {
temp = gc * dmat[j][i - 1] + gs * dmat[j][i];
dmat[j][i] = nu * (dmat[j][i - 1] + temp) - dmat[j][i];
dmat[j][i - 1] = temp;
}
}
}
work[l] = work[nact];
}
} else {
sum = -bvec[nvl];
for (j = 1; j <= n; j = j + 1) {
sum = sum + sol[j] * amat[j][nvl];
}
if (nvl > meq) {
work[iwsv + nvl] = sum;
} else {
work[iwsv + nvl] = -Math.abs(sum);
if (sum > 0) {
for (j = 1; j <= n; j = j + 1) {
amat[j][nvl] = -amat[j][nvl];
}
bvec[nvl] = -bvec[nvl];
}
}
// GOTO 700
return 700;
}
}
return 0;
}
function fn_goto_797() {
l = iwrm + (it1 * (it1 + 1)) / 2 + 1;
l1 = l + it1;
if (work[l1] === 0) {
// GOTO 798
return 798;
}
gc = Math.max(Math.abs(work[l1 - 1]), Math.abs(work[l1]));
gs = Math.min(Math.abs(work[l1 - 1]), Math.abs(work[l1]));
if (work[l1 - 1] >= 0) {
temp = Math.abs(gc * Math.sqrt(1 + gs * gs / (gc * gc)));
} else {
temp = -Math.abs(gc * Math.sqrt(1 + gs * gs / (gc * gc)));
}
gc = work[l1 - 1] / temp;
gs = work[l1] / temp;
if (gc === 1) {
// GOTO 798
return 798;
}
if (gc === 0) {
for (i = it1 + 1; i <= nact; i = i + 1) {
temp = work[l1 - 1];
work[l1 - 1] = work[l1];
work[l1] = temp;
l1 = l1 + i;
}
for (i = 1; i <= n; i = i + 1) {
temp = dmat[i][it1];
dmat[i][it1] = dmat[i][it1 + 1];
dmat[i][it1 + 1] = temp;
}
} else {
nu = gs / (1 + gc);
for (i = it1 + 1; i <= nact; i = i + 1) {
temp = gc * work[l1 - 1] + gs * work[l1];
work[l1] = nu * (work[l1 - 1] + temp) - work[l1];
work[l1 - 1] = temp;
l1 = l1 + i;
}
for (i = 1; i <= n; i = i + 1) {
temp = gc * dmat[i][it1] + gs * dmat[i][it1 + 1];
dmat[i][it1 + 1] = nu * (dmat[i][it1] + temp) - dmat[i][it1 + 1];
dmat[i][it1] = temp;
}
}
return 0;
}
function fn_goto_798() {
l1 = l - it1;
for (i = 1; i <= it1; i = i + 1) {
work[l1] = work[l];
l = l + 1;
l1 = l1 + 1;
}
work[iwuv + it1] = work[iwuv + it1 + 1];
iact[it1] = iact[it1 + 1];
it1 = it1 + 1;
if (it1 < nact) {
// GOTO 797
return 797;
}
return 0;
}
function fn_goto_799() {
work[iwuv + nact] = work[iwuv + nact + 1];
work[iwuv + nact + 1] = 0;
iact[nact] = 0;
nact = nact - 1;
iter[2] = iter[2] + 1;
return 0;
}
go = 0;
while (true) {
go = fn_goto_50();
if (go === 999) {
return;
}
while (true) {
go = fn_goto_55();
if (go === 0) {
break;
}
if (go === 999) {
return;
}
if (go === 700) {
if (it1 === nact) {
fn_goto_799();
} else {
while (true) {
fn_goto_797();
go = fn_goto_798();
if (go !== 797) {
break;
}
}
fn_goto_799();
}
}
}
}
}
function solveQP(Dmat, dvec, Amat, bvec, meq, factorized) {
Dmat = base0to1(Dmat);
dvec = base0to1(dvec);
Amat = base0to1(Amat);
var i, n, q,
nact, r,
crval = [], iact = [], sol = [], work = [], iter = [],
message;
meq = meq || 0;
factorized = factorized ? base0to1(factorized) : [undefined, 0];
bvec = bvec ? base0to1(bvec) : [];
// In Fortran the array index starts from 1
n = Dmat.length - 1;
q = Amat[1].length - 1;
if (!bvec) {
for (i = 1; i <= q; i = i + 1) {
bvec[i] = 0;
}
}
for (i = 1; i <= q; i = i + 1) {
iact[i] = 0;
}
nact = 0;
r = Math.min(n, q);
for (i = 1; i <= n; i = i + 1) {
sol[i] = 0;
}
crval[1] = 0;
for (i = 1; i <= (2 * n + (r * (r + 5)) / 2 + 2 * q + 1); i = i + 1) {
work[i] = 0;
}
for (i = 1; i <= 2; i = i + 1) {
iter[i] = 0;
}
qpgen2(Dmat, dvec, n, n, sol, crval, Amat,
bvec, n, q, meq, iact, nact, iter, work, factorized);
message = "";
if (factorized[1] === 1) {
message = "constraints are inconsistent, no solution!";
}
if (factorized[1] === 2) {
message = "matrix D in quadratic function is not positive definite!";
}
return {
solution: base1to0(sol),
value: base1to0(crval),
unconstrained_solution: base1to0(dvec),
iterations: base1to0(iter),
iact: base1to0(iact),
message: message
};
}
exports.solveQP = solveQP;
}(numeric));
/*
Shanti Rao sent me this routine by private email. I had to modify it
slightly to work on Arrays instead of using a Matrix object.
It is apparently translated from http://stitchpanorama.sourceforge.net/Python/svd.py
*/
numeric.svd= function svd(A) {
var temp;
//Compute the thin SVD from G. H. Golub and C. Reinsch, Numer. Math. 14, 403-420 (1970)
var prec= numeric.epsilon; //Math.pow(2,-52) // assumes double prec
var tolerance= 1.e-64/prec;
var itmax= 50;
var c=0;
var i=0;
var j=0;
var k=0;
var l=0;
var u= numeric.clone(A);
var m= u.length;
var n= u[0].length;
if (m < n) throw "Need more rows than columns"
var e = new Array(n);
var q = new Array(n);
for (i=0; i<n; i++) e[i] = q[i] = 0.0;
var v = numeric.rep([n,n],0);
// v.zero();
function pythag(a,b)
{
a = Math.abs(a);
b = Math.abs(b);
if (a > b)
return a*Math.sqrt(1.0+(b*b/a/a))
else if (b == 0.0)
return a
return b*Math.sqrt(1.0+(a*a/b/b))
}
//Householder's reduction to bidiagonal form
var f= 0.0;
var g= 0.0;
var h= 0.0;
var x= 0.0;
var y= 0.0;
var z= 0.0;
var s= 0.0;
for (i=0; i < n; i++)
{
e[i]= g;
s= 0.0;
l= i+1;
for (j=i; j < m; j++)
s += (u[j][i]*u[j][i]);
if (s <= tolerance)
g= 0.0;
else
{
f= u[i][i];
g= Math.sqrt(s);
if (f >= 0.0) g= -g;
h= f*g-s;
u[i][i]=f-g;
for (j=l; j < n; j++)
{
s= 0.0;
for (k=i; k < m; k++)
s += u[k][i]*u[k][j];
f= s/h;
for (k=i; k < m; k++)
u[k][j]+=f*u[k][i];
}
}
q[i]= g;
s= 0.0;
for (j=l; j < n; j++)
s= s + u[i][j]*u[i][j];
if (s <= tolerance)
g= 0.0;
else
{
f= u[i][i+1];
g= Math.sqrt(s);
if (f >= 0.0) g= -g;
h= f*g - s;
u[i][i+1] = f-g;
for (j=l; j < n; j++) e[j]= u[i][j]/h;
for (j=l; j < m; j++)
{
s=0.0;
for (k=l; k < n; k++)
s += (u[j][k]*u[i][k]);
for (k=l; k < n; k++)
u[j][k]+=s*e[k];
}
}
y= Math.abs(q[i])+Math.abs(e[i]);
if (y>x)
x=y;
}
// accumulation of right hand gtransformations
for (i=n-1; i != -1; i+= -1)
{
if (g != 0.0)
{
h= g*u[i][i+1];
for (j=l; j < n; j++)
v[j][i]=u[i][j]/h;
for (j=l; j < n; j++)
{
s=0.0;
for (k=l; k < n; k++)
s += u[i][k]*v[k][j];
for (k=l; k < n; k++)
v[k][j]+=(s*v[k][i]);
}
}
for (j=l; j < n; j++)
{
v[i][j] = 0;
v[j][i] = 0;
}
v[i][i] = 1;
g= e[i];
l= i;
}
// accumulation of left hand transformations
for (i=n-1; i != -1; i+= -1)
{
l= i+1;
g= q[i];
for (j=l; j < n; j++)
u[i][j] = 0;
if (g != 0.0)
{
h= u[i][i]*g;
for (j=l; j < n; j++)
{
s=0.0;
for (k=l; k < m; k++) s += u[k][i]*u[k][j];
f= s/h;
for (k=i; k < m; k++) u[k][j]+=f*u[k][i];
}
for (j=i; j < m; j++) u[j][i] = u[j][i]/g;
}
else
for (j=i; j < m; j++) u[j][i] = 0;
u[i][i] += 1;
}
// diagonalization of the bidiagonal form
prec= prec*x;
for (k=n-1; k != -1; k+= -1)
{
for (var iteration=0; iteration < itmax; iteration++)
{ // test f splitting
var test_convergence = false;
for (l=k; l != -1; l+= -1)
{
if (Math.abs(e[l]) <= prec)
{ test_convergence= true;
break
}
if (Math.abs(q[l-1]) <= prec)
break
}
if (!test_convergence)
{ // cancellation of e[l] if l>0
c= 0.0;
s= 1.0;
var l1= l-1;
for (i =l; i<k+1; i++)
{
f= s*e[i];
e[i]= c*e[i];
if (Math.abs(f) <= prec)
break
g= q[i];
h= pythag(f,g);
q[i]= h;
c= g/h;
s= -f/h;
for (j=0; j < m; j++)
{
y= u[j][l1];
z= u[j][i];
u[j][l1] = y*c+(z*s);
u[j][i] = -y*s+(z*c);
}
}
}
// test f convergence
z= q[k];
if (l== k)
{ //convergence
if (z<0.0)
{ //q[k] is made non-negative
q[k]= -z;
for (j=0; j < n; j++)
v[j][k] = -v[j][k];
}
break //break out of iteration loop and move on to next k value
}
if (iteration >= itmax-1)
throw 'Error: no convergence.'
// shift from bottom 2x2 minor
x= q[l];
y= q[k-1];
g= e[k-1];
h= e[k];
f= ((y-z)*(y+z)+(g-h)*(g+h))/(2.0*h*y);
g= pythag(f,1.0);
if (f < 0.0)
f= ((x-z)*(x+z)+h*(y/(f-g)-h))/x;
else
f= ((x-z)*(x+z)+h*(y/(f+g)-h))/x;
// next QR transformation
c= 1.0;
s= 1.0;
for (i=l+1; i< k+1; i++)
{
g= e[i];
y= q[i];
h= s*g;
g= c*g;
z= pythag(f,h);
e[i-1]= z;
c= f/z;
s= h/z;
f= x*c+g*s;
g= -x*s+g*c;
h= y*s;
y= y*c;
for (j=0; j < n; j++)
{
x= v[j][i-1];
z= v[j][i];
v[j][i-1] = x*c+z*s;
v[j][i] = -x*s+z*c;
}
z= pythag(f,h);
q[i-1]= z;
c= f/z;
s= h/z;
f= c*g+s*y;
x= -s*g+c*y;
for (j=0; j < m; j++)
{
y= u[j][i-1];
z= u[j][i];
u[j][i-1] = y*c+z*s;
u[j][i] = -y*s+z*c;
}
}
e[l]= 0.0;
e[k]= f;
q[k]= x;
}
}
//vt= transpose(v)
//return (u,q,vt)
for (i=0;i<q.length; i++)
if (q[i] < prec) q[i] = 0;
//sort eigenvalues
for (i=0; i< n; i++)
{
//writeln(q)
for (j=i-1; j >= 0; j--)
{
if (q[j] < q[i])
{
// writeln(i,'-',j)
c = q[j];
q[j] = q[i];
q[i] = c;
for(k=0;k<u.length;k++) { temp = u[k][i]; u[k][i] = u[k][j]; u[k][j] = temp; }
for(k=0;k<v.length;k++) { temp = v[k][i]; v[k][i] = v[k][j]; v[k][j] = temp; }
// u.swapCols(i,j)
// v.swapCols(i,j)
i = j;
}
}
}
return {U:u,S:q,V:v}
};
});
var performanceNow = createCommonjsModule(function (module) {
// Generated by CoffeeScript 1.12.2
(function() {
var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
module.exports = function() {
return performance.now();
};
} else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
module.exports = function() {
return (getNanoSeconds() - nodeLoadTime) / 1e6;
};
hrtime = process.hrtime;
getNanoSeconds = function() {
var hr;
hr = hrtime();
return hr[0] * 1e9 + hr[1];
};
moduleLoadTime = getNanoSeconds();
upTime = process.uptime() * 1e9;
nodeLoadTime = moduleLoadTime - upTime;
} else if (Date.now) {
module.exports = function() {
return Date.now() - loadTime;
};
loadTime = Date.now();
} else {
module.exports = function() {
return new Date().getTime() - loadTime;
};
loadTime = new Date().getTime();
}
}).call(commonjsGlobal);
});
var root = typeof window === 'undefined' ? commonjsGlobal : window;
var vendors = ['moz', 'webkit'];
var suffix = 'AnimationFrame';
var raf = root['request' + suffix];
var caf = root['cancel' + suffix] || root['cancelRequest' + suffix];
for(var i = 0; !raf && i < vendors.length; i++) {
raf = root[vendors[i] + 'Request' + suffix];
caf = root[vendors[i] + 'Cancel' + suffix]
|| root[vendors[i] + 'CancelRequest' + suffix];
}
// Some versions of FF have rAF but not cAF
if(!raf || !caf) {
var last = 0
, id = 0
, queue = []
, frameDuration = 1000 / 60;
raf = function(callback) {
if(queue.length === 0) {
var _now = performanceNow()
, next = Math.max(0, frameDuration - (_now - last));
last = next + _now;
setTimeout(function() {
var cp = queue.slice(0);
// Clear queue here to prevent
// callbacks from appending listeners
// to the current frame's queue
queue.length = 0;
for(var i = 0; i < cp.length; i++) {
if(!cp[i].cancelled) {
try{
cp[i].callback(last);
} catch(e) {
setTimeout(function() { throw e }, 0);
}
}
}
}, Math.round(next));
}
queue.push({
handle: ++id,
callback: callback,
cancelled: false
});
return id
};
caf = function(handle) {
for(var i = 0; i < queue.length; i++) {
if(queue[i].handle === handle) {
queue[i].cancelled = true;
}
}
};
}
var raf_1 = function(fn) {
// Wrap in a new function to prevent
// `cancel` potentially being assigned
// to the native rAF function
return raf.call(root, fn)
};
var cancel = function() {
caf.apply(root, arguments);
};
var polyfill = function(object) {
if (!object) {
object = root;
}
object.requestAnimationFrame = raf;
object.cancelAnimationFrame = caf;
};
raf_1.cancel = cancel;
raf_1.polyfill = polyfill;
var promise = createCommonjsModule(function (module) {
(function (root) {
// Store setTimeout reference so promise-polyfill will be unaffected by
// other code modifying setTimeout (like sinon.useFakeTimers())
var setTimeoutFunc = setTimeout;
function noop() {}
// Polyfill for Function.prototype.bind
function bind(fn, thisArg) {
return function () {
fn.apply(thisArg, arguments);
};
}
function Promise(fn) {
if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
if (typeof fn !== 'function') throw new TypeError('not a function');
this._state = 0;
this._handled = false;
this._value = undefined;
this._deferreds = [];
doResolve(fn, this);
}
function handle(self, deferred) {
while (self._state === 3) {
self = self._value;
}
if (self._state === 0) {
self._deferreds.push(deferred);
return;
}
self._handled = true;
Promise._immediateFn(function () {
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
if (cb === null) {
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
return;
}
var ret;
try {
ret = cb(self._value);
} catch (e) {
reject(deferred.promise, e);
return;
}
resolve(deferred.promise, ret);
});
}
function resolve(self, newValue) {
try {
// Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
var then = newValue.then;
if (newValue instanceof Promise) {
self._state = 3;
self._value = newValue;
finale(self);
return;
} else if (typeof then === 'function') {
doResolve(bind(then, newValue), self);
return;
}
}
self._state = 1;
self._value = newValue;
finale(self);
} catch (e) {
reject(self, e);
}
}
function reject(self, newValue) {
self._state = 2;
self._value = newValue;
finale(self);
}
function finale(self) {
if (self._state === 2 && self._deferreds.length === 0) {
Promise._immediateFn(function() {
if (!self._handled) {
Promise._unhandledRejectionFn(self._value);
}
});
}
for (var i = 0, len = self._deferreds.length; i < len; i++) {
handle(self, self._deferreds[i]);
}
self._deferreds = null;
}
function Handler(onFulfilled, onRejected, promise) {
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
this.promise = promise;
}
/**
* Take a potentially misbehaving resolver function and make sure
* onFulfilled and onRejected are only called once.
*
* Makes no guarantees about asynchrony.
*/
function doResolve(fn, self) {
var done = false;
try {
fn(function (value) {
if (done) return;
done = true;
resolve(self, value);
}, function (reason) {
if (done) return;
done = true;
reject(self, reason);
});
} catch (ex) {
if (done) return;
done = true;
reject(self, ex);
}
}
Promise.prototype['catch'] = function (onRejected) {
return this.then(null, onRejected);
};
Promise.prototype.then = function (onFulfilled, onRejected) {
var prom = new (this.constructor)(noop);
handle(this, new Handler(onFulfilled, onRejected, prom));
return prom;
};
Promise.all = function (arr) {
return new Promise(function (resolve, reject) {
if (!arr || typeof arr.length === 'undefined') throw new TypeError('Promise.all accepts an array');
var args = Array.prototype.slice.call(arr);
if (args.length === 0) return resolve([]);
var remaining = args.length;
function res(i, val) {
try {
if (val && (typeof val === 'object' || typeof val === 'function')) {
var then = val.then;
if (typeof then === 'function') {
then.call(val, function (val) {
res(i, val);
}, reject);
return;
}
}
args[i] = val;
if (--remaining === 0) {
resolve(args);
}
} catch (ex) {
reject(ex);
}
}
for (var i = 0; i < args.length; i++) {
res(i, args[i]);
}
});
};
Promise.resolve = function (value) {
if (value && typeof value === 'object' && value.constructor === Promise) {
return value;
}
return new Promise(function (resolve) {
resolve(value);
});
};
Promise.reject = function (value) {
return new Promise(function (resolve, reject) {
reject(value);
});
};
Promise.race = function (values) {
return new Promise(function (resolve, reject) {
for (var i = 0, len = values.length; i < len; i++) {
values[i].then(resolve, reject);
}
});
};
// Use polyfill for setImmediate for performance gains
Promise._immediateFn = (typeof setImmediate === 'function' && function (fn) { setImmediate(fn); }) ||
function (fn) {
setTimeoutFunc(fn, 0);
};
Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
if (typeof console !== 'undefined' && console) {
console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
}
};
/**
* Set the immediate function to execute callbacks
* @param fn {function} Function to execute
* @deprecated
*/
Promise._setImmediateFn = function _setImmediateFn(fn) {
Promise._immediateFn = fn;
};
/**
* Change the function to execute on unhandled rejection
* @param {function} fn Function to execute on unhandled rejection
* @deprecated
*/
Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
Promise._unhandledRejectionFn = fn;
};
if ('object' !== 'undefined' && module.exports) {
module.exports = Promise;
} else if (!root.Promise) {
root.Promise = Promise;
}
})(commonjsGlobal);
});
// IE polyfill from MDN
(function () {
if (typeof window.CustomEvent === 'function') return false;
function CustomEvent (event, params) {
params = params || {bubbles : false, cancelable : false, detail: undefined};
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
}
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
})();
function emitEvent(eventName, dispatcher=document) {
var evt = new CustomEvent(eventName, {'bubbles': true, 'cancelable': true});
dispatcher.dispatchEvent(evt);
}
/**
* Fast Fourier Transform
* 1D-FFT/IFFT, 2D-FFT/IFFT (radix-2)
*
* @author ryo / github.com/wellflat
* Based on https://github.com/wellflat/jslib with some tiny optimizations
*/
function FFT() {
var _n = 0, // order
_bitrev = null, // bit reversal table
_cstb = null; // sin/cos table
var _tre, _tim;
this.init = function (n) {
if(n !== 0 && (n & (n - 1)) === 0) {
_n = n;
_setVariables();
_makeBitReversal();
_makeCosSinTable();
} else {
throw new Error("init: radix-2 required");
}
};
// 1D-FFT
this.fft1d = function (re, im) {
fft(re, im, 1);
};
// 1D-IFFT
this.ifft1d = function (re, im) {
var n = 1/_n;
fft(re, im, -1);
for(var i=0; i<_n; i++) {
re[i] *= n;
im[i] *= n;
}
};
// 2D-FFT
this.fft2d = function (re, im) {
var i = 0;
// x-axis
for(var y=0; y<_n; y++) {
i = y*_n;
for(var x1=0; x1<_n; x1++) {
_tre[x1] = re[x1 + i];
_tim[x1] = im[x1 + i];
}
this.fft1d(_tre, _tim);
for(var x2=0; x2<_n; x2++) {
re[x2 + i] = _tre[x2];
im[x2 + i] = _tim[x2];
}
}
// y-axis
for(var x=0; x<_n; x++) {
for(var y1=0; y1<_n; y1++) {
i = x + y1*_n;
_tre[y1] = re[i];
_tim[y1] = im[i];
}
this.fft1d(_tre, _tim);
for(var y2=0; y2<_n; y2++) {
i = x + y2*_n;
re[i] = _tre[y2];
im[i] = _tim[y2];
}
}
};
// 2D-IFFT
this.ifft2d = function (re, im) {
var i = 0;
// x-axis
for(var y=0; y<_n; y++) {
i = y*_n;
for(var x1=0; x1<_n; x1++) {
_tre[x1] = re[x1 + i];
_tim[x1] = im[x1 + i];
}
this.ifft1d(_tre, _tim);
for(var x2=0; x2<_n; x2++) {
re[x2 + i] = _tre[x2];
im[x2 + i] = _tim[x2];
}
}
// y-axis
for(var x=0; x<_n; x++) {
for(var y1=0; y1<_n; y1++) {
i = x + y1*_n;
_tre[y1] = re[i];
_tim[y1] = im[i];
}
this.ifft1d(_tre, _tim);
for(var y2=0; y2<_n; y2++) {
i = x + y2*_n;
re[i] = _tre[y2];
im[i] = _tim[y2];
}
}
};
// core operation of FFT
function fft(re, im, inv) {
var d, h, ik, m, tmp, wr, wi, xr, xi,
n4 = _n >> 2;
// bit reversal
for(var l=0; l<_n; l++) {
m = _bitrev[l];
if(l < m) {
tmp = re[l];
re[l] = re[m];
re[m] = tmp;
tmp = im[l];
im[l] = im[m];
im[m] = tmp;
}
}
// butterfly operation
for(var k=1; k<_n; k<<=1) {
h = 0;
d = _n/(k << 1);
for(var j=0; j<k; j++) {
wr = _cstb[h + n4];
wi = inv*_cstb[h];
for(var i=j; i<_n; i+=(k<<1)) {
ik = i + k;
xr = wr*re[ik] + wi*im[ik];
xi = wr*im[ik] - wi*re[ik];
re[ik] = re[i] - xr;
re[i] += xr;
im[ik] = im[i] - xi;
im[i] += xi;
}
h += d;
}
}
}
// set variables
function _setVariables() {
if(typeof Uint8Array !== 'undefined') {
_bitrev = new Uint8Array(_n);
} else {
_bitrev = new Array(_n);
}
if(typeof Float64Array !== 'undefined') {
_cstb = new Float64Array(_n*1.25);
_tre = new Float64Array(_n*_n);
_tim = new Float64Array(_n*_n);
} else {
_cstb = new Array(_n*1.25);
_tre = new Array(_n*_n);
_tim = new Array(_n*_n);
}
}
// make bit reversal table
function _makeBitReversal() {
var i = 0,
j = 0,
k = 0;
_bitrev[0] = 0;
while(++i < _n) {
k = _n >> 1;
while(k <= j) {
j -= k;
k >>= 1;
}
j += k;
_bitrev[i] = j;
}
}
// make trigonometric function table
function _makeCosSinTable() {
var n2 = _n >> 1,
n4 = _n >> 2,
n8 = _n >> 3,
n2p4 = n2 + n4,
t = Math.sin(Math.PI/_n),
dc = 2*t*t,
ds = Math.sqrt(dc*(2 - dc)),
c = _cstb[n4] = 1,
s = _cstb[0] = 0;
t = 2*dc;
for(var i=1; i<n8; i++) {
c -= dc;
dc += t*c;
s += ds;
ds -= t*s;
_cstb[i] = s;
_cstb[n4 - i] = c;
}
if(n8 !== 0) {
_cstb[n8] = Math.sqrt(0.5);
}
for(var j=0; j<n4; j++) {
_cstb[n2 - j] = _cstb[j];
}
for(var k=0; k<n2p4; k++) {
_cstb[k + n2] = -_cstb[k];
}
}
}
var left_eye_filter = {"real": [1.5419219943717721, 0.40010880110578706, -0.79043641265342957, -1.2685464969238938, 0.39878117336167285, -1.0673489992245377, -0.079880838229404019, -0.45374680224191505, -0.043474097938900787, -0.31125662385352687, 0.17092430376098702, -0.29613086164846153, 0.5616469648110296, -1.559786848789493, 0.64513037997492662, -1.2899747976234162, 1.1761667998175334, -1.2899747976233551, 0.64513037997490474, -1.5597868487894897, 0.56164696481102505, -0.29613086164845964, 0.17092430376099094, -0.31125662385352959, -0.043474097938900787, -0.45374680224191177, -0.079880838229404658, -1.0673489992245357, 0.39878117336167307, -1.2685464969238942, -0.79043641265343012, 0.40010880110578717, -1.3820969331049027, 0.069560471269205768, -1.9786339579213206, -1.9807415717551982, -0.78667274410450883, -1.2217002325587256, -0.19150029104902774, -0.35131617290773243, -0.17646388464205803, -0.16672095020503441, -0.092298612924566523, -0.028899376452253527, -0.1314555696102146, -0.32892265898101813, -0.40987148655061206, 0.11741827111366547, -0.67254330182605138, -0.46007833291519956, -0.67215259521101001, -0.44871907432473013, -0.034749316729184583, 0.0055639281302433969, -0.17675902360981591, -0.26196208085032191, -0.36301254306387037, -0.33546767337818123, -0.6458889740799838, -1.1981932989987978, 0.12372650763830917, -1.4996172161865935, -2.4084298023013888, -2.0505291279591722, -1.7249706159518585, -2.277646289702639, -3.1259631743419591, -2.9656385065342015, -2.8480835086962011, -1.4260964500310189, -0.61792590829173544, -0.2611655301498782, -0.38519889843539723, -0.17511899827006483, -0.32808050503227176, 0.0076800871037463036, -0.18710828510427668, 0.1976534820339281, -0.55444453100465052, 0.14583567590328381, -0.69844971117515287, -0.90188577233526623, -0.53500016384583371, -0.044420751861669799, 0.014727914354086128, -0.28084584584371913, -0.29890408748685848, -0.39431380149336548, -0.39569215798819307, -0.74351999988258299, -0.82502198370631752, -1.851491897104155, -0.74302378668934244, 0.21156442062863762, -3.3061472495599986, -1.7990472945779568, -2.2193764251732282, -2.3438802466919251, -3.3615971067123311, -3.5383249085863708, -2.2639673745086588, -2.0271757806780748, -0.75242583405872232, -0.30143411016839378, -0.3625272253546275, -0.25489431004647689, -0.18928491561467081, -0.1179891518538482, 0.027920290231533224, -0.035472107498143821, -0.29008721857562259, -0.3604588674139817, -0.39156143807433802, -0.82222257402876564, -0.44979914971695928, -0.098136330355476253, 0.065628582466229365, -0.33607304327303128, -0.32161201323497779, -0.41856090178723965, -0.64028425429629054, -0.7766428172010218, -1.3946448661671447, -2.2603422126144683, -0.38769722219534525, -0.95341593939478653, -1.412952994959813, -2.3602336858020432, -1.2756392437278019, -2.0983496132652038, -2.5682454610054268, -2.8791053946930378, -2.1809972632688095, -0.84281293847776861, -0.75998936793718697, -0.18584599820380068, -0.30105748355308259, -0.16098142942852958, -0.13792125740417191, -0.089790022871128708, -0.12321821342876504, -0.1128661923016878, -0.3924098378001975, -0.5780902167586397, -0.48685989567066695, -0.53565359443296234, -0.051036689850526382, -0.0068547033925117689, -0.18963405157839419, -0.22514761090777807, -0.35555823460888908, -0.46670603976585517, -0.56179541485257889, -0.7495095888115163, -1.4772075422260349, -1.5836466114968029, -2.3846549454186694, -1.4884613952536236, -1.8237453905245253, -1.6712324532934877, -1.5169157844507295, -1.6930052820597281, -2.1023566589276004, -2.2062031109308458, -1.7945281756942255, -0.26457398838912649, 0.22038139379151148, -0.43479836723775234, -0.19830827357221226, -0.18018565146479498, -0.097060879184795737, -0.10088329756370379, -0.063069709957272527, -0.17970932516041177, -0.1943040732581543, -0.37970560392277619, -0.47302301606251812, -0.30366967948052181, -0.064732391018915397, -0.08902516330269715, -0.082000200083027344, -0.22965854401457736, -0.32035624605031326, -0.31836783196552437, -0.40132058236311119, -0.65601747033470859, -0.59040483751417483, -1.850308466308003
var right_eye_filter = {"real": [1.8229079259010603, 0.097810498648582461, -0.55840092137248587, -0.99970462842356578, 0.18757876559092043, -0.81617694863114465, -0.17457078018685562, 0.13822182613073089, -0.13830885288846723, 0.14088352498892928, -0.11242245121823281, 0.64190144530750459, -0.18081689212517704, 0.84757445423403044, -2.0367692338977426, 2.3450651085370726, -3.2227771639624789, 2.3450651085369945, -2.0367692338977101, 0.84757445423403854, -0.18081689212518082, 0.64190144530750537, -0.11242245121823641, 0.14088352498894169, -0.13830885288846723, 0.13822182613073003, -0.17457078018684977, -0.81617694863113666, 0.18757876559091927, -0.99970462842356267, -0.55840092137248509, 0.097810498648581323, -1.0960340088024074, -1.9119199452512301, -2.4095702665388479, -0.55162352804953241, -0.50505328014021589, -1.3068505835636635, -0.49437187443975589, 0.23127204626685588, 0.043350794355039197, -0.071787406154436809, 0.070854449837205943, 0.17221102955705567, 0.44602122877614064, 0.074148205591900399, -0.015611524439393865, -0.79896724757292914, -0.67155961060437053, -0.49375784053273253, 0.028167647498424205, -0.3191891366103583, 0.53582170174408217, 0.20183473326047152, 0.12710467168208503, -0.071400263514192097, 0.074560604448017792, -0.12451483496807111, 0.051358135035693774, -0.77282398113384443, -0.42160647485916963, -1.1311602269894514, -1.4625324828122208, 0.3337871926813808, -1.77011609742092, -1.4302518240108344, -3.0428213499062116, -0.60631225487833551, -0.13683987631719793, -2.3692424085383519, -0.34105804260324346, -0.25969657852057992, 0.23610433796619859, -0.27685168579683173, 0.16986402710259335, 0.073612585805396993, 0.57704911017089122, -0.059867579479423505, 0.51680219528175042, -1.0666730319382505, -0.0056552094670686828, -0.75809939060745812, -0.064701320250044561, -0.19832318162238824, 0.37732986906226257, 0.20777584924550152, 0.15451076629740465, -0.013991851319401968, 0.13841341497021592, -0.086883949036928532, 0.25261423619714551, -1.1991385138433881, -1.9867837341406693, -2.275962773839737, -3.1079150257531585, -2.3995834975192567, -2.2937692343725722, -2.1872173045799017, -1.3988308931230504, -2.2073957813815439, -1.9667941627002865, -1.6748432066635108, -0.92650772032564344, -0.054197237250052703, -0.18026213329416008, -0.15232124758200827, -0.016555865669302033, 0.31289505893870784, 0.42806542968274719, 0.23124350286854853, -0.087366382764607439, -0.12552132795947232, -0.12547908619418155, -0.38089709050886683, -0.28444076658768042, -0.11944152964360766, 0.12056136689031131, 0.21189843131890268, 0.16581598470154221, 0.13376820638890077, 0.22205496825803592, 0.15120100371874812, 0.12380717441381156, -1.2352596784322261, -2.2222759116849211, -3.3782856809989692, -3.415076124219421, -2.7282977589825297, -1.5576789730825455, -1.6478932560447972, -2.067907968457094, -2.004290735457912, -2.6427456963680775, -1.9309474679838621, -0.16864865516592528, -0.22642518078963322, -0.13321306237600422, -0.20692971953006373, -0.068344938706069003, 0.14493915164047724, 0.46505832474821007, 0.32789481378377733, 0.1852927254910838, -0.1356638873386786, -0.03585192275390197, -0.17203834043005656, -0.15954900238018477, -0.059581713131431221, -0.017228379259871054, 0.12402459410135006, 0.1524538089963059, 0.16271946063708961, 0.24817234249560427, 0.26053579199245763, -0.04769125558408293, -0.81459993031792033, -2.0740660744196808, -3.1544891598954261, -2.9212825837849565, -2.4077419089431702, -1.6411629435379833, -1.576697627349694, -1.8007661961299257, -2.0001525985045707, -1.5107274159689619, -1.2839600483166405, -0.63196711118813498, 0.31071574064221719, -0.21370915949408273, -0.16393119308951343, -0.097481704015839707, 0.13767875532837173, 0.23695911940697742, 0.36158774196732829, -0.00066962538216623158, -0.1026502520704758, -0.18176695609293456, -0.059120611570986824, -0.13702193484548986, -0.0073538013157976303, 0.020281061259494877, 0.15032501459982059, 0.16876214929227357, 0.18780650312631536, 0.16308782299108887, 0.18583847563977354, 0.44907296092364651, -0.020800703185301726, -1.4297091333258476, -2
var mouth_filter = {"real": [4.6340891519992962, 0.7844322938332674, -1.1596739705934982, 3.9933365069793401, 1.0745202382104644, -0.86566739843778528, -0.97931984026536645, -0.55848113024930113, -0.35079784655500912, -0.28441072774545773, -0.088142362922499759, 0.027465161121858393, -0.014037496255053593, -0.0045512610044201119, -0.0097173297219694255, 0.0018722497460425004, 0.00034424707543540862, 0.0018722497460384895, -0.0097173297219602297, -0.0045512610044239907, -0.014037496255053029, 0.02746516112186332, -0.088142362922505241, -0.28441072774544834, -0.35079784655500912, -0.55848113024929857, -0.97931984026536589, -0.86566739843778451, 1.0745202382104642, 3.9933365069793414, -1.1596739705934984, 0.78443229383326629, -0.64146012074713299, -1.4031948309962614, -0.72621528546721359, 2.8301862310857646, 0.22901892606370081, -2.4871893946676962, -0.82292478776907829, -0.038551737265843086, -0.20580868221576679, -0.28505928673030462, -0.18459030185549916, 0.058925447647408556, 0.0086943334915795256, -0.0086001017349623815, -0.0048545170036036192, -0.0004539351773376722, 0.00092194354279838148, 0.0017350493936515445, -0.0021057925479370247, -0.0060275384450162546, -0.01880365799458189, -0.023918178864192268, -0.020757173724755319, -0.18669623657203888, -0.43413705625508531, -0.36480504844763911, -0.32161507141862777, -1.8059188349376913, 0.70639011502857929, 3.4760111666249314, -0.5602942662325473, -0.88313644188618323, -3.1958827705277328, -4.1322391810878196, 0.77904148145098406, 5.0612923845025648, 1.5447671531259652, -2.8176609661232312, -0.63748901957655968, 0.36914599600864362, -0.00037729870766316427, -0.17990982199486863, -0.032569510455235789, 0.0085089063175920673, -0.014523430514595712, -0.012452101483067112, -0.0012625852907501049, 0.00028475514852645983, 0.0011591891684665802, 0.00039450549224649017, -0.002943469227087628, -0.010724474299968166, 0.0061262158881635236, 0.029252238624593387, -0.12159824966625053, -0.31076930784864121, -0.41364470354134941, 0.022306497695738548, 0.074366913048009908, -2.6718092121882169, -0.77719061117874755, 3.9762898076403879, 3.2079354493433021, -4.4012300899429189, -2.5660816993858311, -2.553218193276197, 2.0684625359523285, 4.9974951908094045, 2.143461857355776, -1.7847370377532255, -0.28821333774369001, 0.10766200451394388, 0.18782859841053653, -0.019310891700896299, -0.0062567209274460587, -0.0064371871903130887, 0.0021510630118947156, -0.011505776785749768, -0.0029992319263973479, 0.00030084525589988385, 0.0010941864062154283, 0.00030288821499767468, -0.0032329177128834767, -0.010312595680378463, -0.0068340802376650614, 0.019823041367851263, -0.0078950524544473683, -0.23245655665346024, -0.14923618615195547, 0.056419081419621493, 0.16707514445150673, -2.1849562859013951, -0.54088886065646191, 4.0516538348232194, 4.2406226010125279, -1.7936849281843577, -2.9840428724267536, -3.2115132203593002, -1.9470763746691873, 4.1518693114943472, 2.4862294474678142, -0.30639511041804085, 0.024820417007377235, 0.27577100857260728, 0.055259784589899323, -0.14220319122433717, -0.08642751724431888, 0.023244530667997254, 0.012523451759435138, -0.0058546865987889477, -0.0029976575640192626, -3.5555809550126927e-05, 0.00047377824955015626, 0.00099596206424971642, -0.00098919816572873276, -0.0097580547506740285, -0.020619695697678356, -0.0037015241751264089, -0.003593154009926945, -0.045481667679613515, 0.090305489910112821, 0.19683301699858768, 0.20611623580645685, -0.90233672462032366, 0.065306828187895322, 4.7788333108246484, 2.9026377323781798, -3.2466266324527706, -2.1436478188271333, -2.2561432890218653, -1.9115416020763942, 2.2130343552583907, 1.9915993980953659, -0.056495739083329222, -0.2528646737117784, 0.14962266633073235, -0.0099224078218753502, -0.1479065510292869, -0.07230224268075354, 0.0058318523760505494, 0.0022686064052674618, -0.00013275302826153175, -0.00063102743369309689, 9.1509786481767957e-05, 0.00031972746011452689, 0.00053353867978528325, -0.00058791023420762787, -0.0052408752439335538, -0.0091860766601598153, 0.015159206837947898, 0.016910593952452414, -0.0990178
var nose_filter = {"real": [3.0408379415611857, 0.37822261363137938, 1.1747173276627942, 0.87791572866957501, 0.27429578524536991, -0.26015038230887205, -0.04589694540462394, 0.18194913988848616, -0.19035992880648842, -0.050064472206627651, -0.016354960260506177, 0.073013903204916478, 0.15053197342937383, -0.47378158951033317, -0.33333577915227425, -0.30434085338299055, 0.26372284406307878, -0.30434085338299449, -0.33333577915227836, -0.47378158951033028, 0.15053197342937505, 0.073013903204915576, -0.016354960260505706, -0.050064472206628768, -0.19035992880648842, 0.18194913988848541, -0.045896945404624932, -0.2601503823088735, 0.27429578524536952, 0.87791572866957457, 1.1747173276627942, 0.3782226136313796, 1.5638480130127614, -1.0502161590016221, -0.28144140655806793, 0.66007876209063499, 0.25575295594566605, -0.11471557758718753, 0.22751157962613866, -0.29100003355994186, 0.29242994865853178, 0.14950061311078749, -0.02214037256893809, 0.034503572794411914, -0.17412889405901469, 0.060297128338254534, -0.49717312826403576, -0.10585857030501357, 0.082780177430083327, -0.11056584899062352, -0.72499416196392785, -0.15612863751308359, -0.36586758725441215, -0.19718551141955715, -0.043434328775718851, -0.060442748560529294, 0.1383233017601592, -0.071714399164362744, 0.31725814504248484, 0.16801904131477274, 0.58675004339129755, 1.5155025161072819, 0.99232752650122635, -1.0129349058609656, -1.6725083187014358, -0.66077224091757791, 2.2217962254133496, 0.98390492917013095, -0.16319024909703178, 0.67271651276019184, 0.16380771710007475, 0.21989373735679621, -0.12296413131763459, -0.18224776807046256, -0.011168077595514938, 0.10364961453623285, 0.1359801303077682, -0.26339593722715721, 0.039396952561874886, -0.33866696253626483, -0.0043101841409601402, 0.17740469505625342, -0.10830858623812685, -0.33186051211466239, 0.12060535717228799, 0.084703474730635803, -0.086262426064740078, -0.1297477439897661, -0.28426475792188655, 0.21965961682575447, 0.24955999100642301, 0.46804088594167448, -0.46946217188769823, -0.31724338121882617, 1.7716903674840139, 0.56577881124465312, 0.71512595047089234, 0.4910867492003736, 0.92310119575914651, -1.0939934957719639, 0.18102793706565934, 0.35484595526186652, 0.48676804973393767, -0.097923922056211768, -7.8200063684236368e-05, -0.016095705887683227, -0.084263209727683391, 0.0080331646697531477, -0.044853168166469837, 0.0062170702455977547, -0.15890945005602863, 0.22815908460498888, 0.17110516400703918, -0.29052216822588434, -0.18224178792918044, -0.018421573557969844, 0.032535239746583795, -0.08121081614537759, -0.029175915115094032, 0.092929862040843081, 0.16824405476099044, -0.24679227625704581, 0.00030176170486908785, 0.023943010115746295, -0.43281940369171445, -0.57166836623813821, 1.2482467538506352, 0.74385331371246666, 0.54787745216002559, 0.92898941300038174, 0.54473301805335128, -0.4877077226718825, -0.40370312470951597, 0.39096527623299848, 0.12644205243911047, 0.0424168022733412, 0.049219693586430309, -0.077748186566067037, -0.043614575991677208, -0.0041635061718157101, 0.07897222152752259, 0.053944973270972973, 0.11232623315704468, -0.070445625631503542, -0.072057201177642652, 0.12706805404252855, -0.13757198545862262, -0.31639223989443899, -0.029240486244660611, 0.10973045554309782, 0.04102655016489614, 0.01891084247324943, -0.056922369420476487, 0.030805208457151782, -0.1512000567754726, -0.058122663069861934, -0.30506910575481916, -0.79033868813295383, 0.026308878650124864, 1.7521122327973906, 0.64566220514793682, 0.40042515638418263, -0.33461208848408402, -0.55369429571770823, -0.030140868003777126, 0.27230784814155334, 0.008194429787378334, -0.030645866021173498, 0.023928227792328404, 0.090706510487419734, -0.021569631345745226, -0.0064127815367693367, -0.026343653609827326, 0.0079365608693974798, -0.18791450411345401, 0.14319521757460194, 0.17003550871316017, -0.24661106106331201, -0.21167593067635404, -0.098206750946426211, -0.048592759447365123, 0.0028129255950110439, 0.049868939755416952, 0.039023237394102607, -0.0036267311717218496, -0.12930461632538415, -0.06741132095183785
var face_filter = {"real": [2.5919359538538909, 1.3480085770312511, -0.20482945082417442, 2.2477358192448036, 0.93540843887482139, 0.74314370383748074, 0.44299233336869565, 0.53646864525435445, -0.033677232548862526, -0.1522853308878499, -0.0031113453238400149, 0.052610669730581504, -0.0090421776029276455, 0.14571584983663624, 0.44057103654181279, -0.48335213540388067, -1.3567864542305328, -0.48335213540388222, 0.44057103654181745, 0.14571584983663588, -0.0090421776029276386, 0.052610669730583912, -0.0031113453238437146, -0.1522853308878454, -0.033677232548862526, 0.536468645254354, 0.44299233336869559, 0.74314370383748229, 0.9354084388748215, 2.2477358192448023, -0.20482945082417423, 1.3480085770312495, 2.0152106388329991, 0.85611134878653461, -1.3363494489312076, -0.52148568567931619, 1.2207493971968164, 0.88880185549210589, -0.12851357573552111, -0.1350280522901679, 0.041300904967699482, 0.44502243372725686, 0.029355734210915238, -0.51443976319946505, 0.08745222381708008, 1.2148708003194451, 1.1189080727093581, -0.27220544444671846, -0.36088426941083585, -0.093485947527556318, -0.9769818787641994, -0.68349100625395898, 0.024322257871818426, 0.60512811669399713, 0.15343788102432432, -0.4299366545774243, -0.15452787333937706, 0.9156200895039931, 1.19600272916941, 0.72364825206645089, 0.54200011692086325, 2.3400266438502029, -0.033608374945748302, 0.58898161413145322, 2.0269883277253808, 2.818789893714468, -3.5895244227646144, -3.5314332372596891, 2.0122812700890154, 0.93093181995227969, -0.96305400340897007, -0.73612667628472817, -0.053915776695886194, 0.42730242898842419, 0.029936824487282035, -0.35168293029190251, 0.25108420491884947, 0.8544524900293714, 0.16931894270710782, 0.0092385746333500125, 0.68672569869418298, 0.41915906104063394, -1.0984488703050921, -0.63697851900908631, 0.11186355371520935, 0.47269360156783113, 0.15279475225563477, -0.026106440237006989, -0.032262751173084157, 0.14542662300780329, 0.71981331903700141, 1.4137393979172745, 0.60857711312874896, -3.0736342072317173, -2.5537641666010327, 0.6337650914909162, 1.2343577579270657, 0.25345561236901865, -2.0331393954447585, 1.159193858429254, 3.0170447718709359, 0.49021233060315667, -0.684375328954414, -0.32927583863381799, -0.09284792777273311, -0.14740895498043241, -0.19413825853994604, 0.36919608239644319, 0.30546257655082493, -0.55256449500031701, -1.2130125640575424, 0.066961883917897494, -0.13876096422777703, 0.37902224678367341, 0.22718444978554084, 0.19963817528635963, 0.027529920247751867, -0.24231535965414738, -0.016338923407765684, 0.45136614923078927, 0.28975660783972312, -0.73094055491799104, -1.5465072446477164, -0.070769892332079726, 3.1701479989789885, 0.024916786279245037, -2.8717730703729369, -1.1681626968077414, -0.94600410103718435, -0.85872517244177848, 2.9516513032863374, 2.8131952593882126, -1.5261742763882251, -1.0558844683361728, 1.1680212024537544, 0.98450685108739822, 0.064067265719269059, -0.43727283330478184, -0.044395094277671916, 0.6179734700494115, 0.24878996343187737, -0.63891278340523816, -0.75864993025841965, -0.32304619466454659, -0.73387564471571265, -0.043145833390571785, 0.92391812888689884, 0.89946098537045804, 0.14871674926559622, -0.54822828954183223, -0.26728613142127311, 0.309011363128886, 0.21418689978013769, -0.52105157113820344, -1.0686411834884146, -1.3047927124000203, 1.0355627592914096, 2.9672746843849169, 1.9471218128812939, 0.36030875558033187, 0.22471825920653532, 1.3679256644146878, 2.3784795387427549, 0.73776440177250424, -2.2202952003703751, -0.98667153092188797, 0.60944427589951666, 0.29273424438530327, -0.054064553213066489, -0.1955430963609566, 0.13452976853580562, 0.17688857701463095, -0.02907863269662225, -0.037177619339377604, 0.22892611971691484, -0.22870850340942314, -0.41029268509332983, 0.061215349005760457, 0.37818604838169356, 0.34148146887082653, 0.099938245586444027, -0.099254338381423959, -0.11254516916626593, -0.2039622085642743, -0.20060216516957027, 0.30792957356810446, 1.1721236672075155, 0.56136417541067873, -2.3249600877666992, -2.4287881268668112, 2.0674326900187423, 2.8441
/*
* MOSSE correlation filter
*
* Optional parameters to constructor:
* drawResponse {canvasElement} : draws the correlation filter output on the given canvas element (default is none)
* psrThreshold {number} : peak-to-sidelobe-ratio threshold to use when updating filter while tracking (default is 10)
* eta {number} : adjusts how much new input affects the mosse filter, when updating filter while tracking
* number should be between 0 and 1 (default is 0.1)
* convertToGrayscale {boolean} : whether to convert canvas output to grayscale (default is true)
* if this is set to false, we assume all channels are equal and only grab values from red channel
*
* @author auduno / github.com/auduno
*/
function mosseFilter(params) {
var _filter, _top, _bottom;
var _fft;
var _w,_h;
var _im_part;
var _arrlen;
var _cc;
var _image_array;
this.psr_prev = undefined;
this.peak_prev = undefined;
var updateable = false;
if (!params) params = {};
// setup of canvas for drawing responses, if given
if (params.drawResponse === undefined) {
params.drawResponse = false;
} else {
if (params.drawResponse.tagName != 'CANVAS') {
params.drawResponse = false;
} else {
var responseContext = params.drawResponse.getContext('2d');
}
}
if (params.psrThreshold === undefined) params.psrThreshold = 10;
if (params.eta === undefined) params.eta = 0.10;
if (params.convertToGrayscale === undefined) params.convertToGrayscale = true;
this.load = function(filter) {
// initialize filter width and height
_w = filter.width;
_h = filter.height;
_arrlen = _w*_h;
_filter = [filter.real, filter.imag];
// handling top and bottom when they're not present
if (filter.top && filter.bottom) {
updateable = true;
_top = [filter.top.real, filter.top.imag];
_bottom = [filter.bottom.real, filter.bottom.imag];
}
// initialize fft to given width
_fft = new FFT();
_fft.init(filter.width);
// set up temporary variables
if(typeof Float64Array !== 'undefined') {
_im_part = new Float64Array(_arrlen);
_image_array = new Float64Array(_arrlen);
} else {
_im_part = new Array(_arrlen);
_image_array = new Array(_arrlen);
}
var canvas = document.createElement("canvas");
canvas.setAttribute('width', _w);
canvas.setAttribute('height', _h);
_cc = canvas.getContext('2d');
};
this.init = function(w,h) {
// initialize filter width and height for a blank filter
_w = w;
_h = h;
_arrlen = _w*_h;
_filter = [[],[]];
_top = [[],[]];
_bottom = [[],[]];
for (var i = 0;i < _arrlen;i++) {
_filter[0][i] = 0;
_filter[1][i] = 0;
_top[0][i] = 0;
_top[1][i] = 0;
_bottom[0][i] = 0;
_bottom[1][i] = 0;
}
updateable = true;
// initialize fft to given width
_fft = new FFT();
_fft.init(w);
// set up temporary variables
if(typeof Float64Array !== 'undefined') {
_im_part = new Float64Array(_arrlen);
} else {
_im_part = new Array(_arrlen);
}
var canvas = document.createElement("canvas");
canvas.setAttribute('width', _w);
canvas.setAttribute('height', _h);
_cc = canvas.getContext('2d');
};
// fft function
this.fft = function(array) {
// not in-place
var cn = new Array(_arrlen);
for (var i = 0;i < _arrlen;i++) {
cn[i] = 0.0;
}
_fft.fft2d(array,cn);
return [array, cn];
};
// fft function
this.fft_inplace = function(array) {
// in-place
for (var i = 0;i < _arrlen;i++) {
_im_part[i] = 0.0;
}
_fft.fft2d(array,_im_part);
return [array, _im_part];
};
this.ifft = function(rn, cn) {
// in-place
_fft.ifft2d(rn, cn);
return rn;
};
// peak to sidelobe ratio function (optional)
this.psr = function(array) {
// proper
var sum = 0;
var max = 0;
var maxpos = [0, 0];
var sdo = 0;
var val;
for (var x = 0;x < _w;x++) {
for (var y = 0;y < _h;y++) {
val = array[(y*_w)+x];
sum += val;
sdo += (val*val);
if (max < val) {
max = val;
maxpos = [x,y];
}
}
}
// subtract values around peak
for (var x = -5;x < 6;x++) {
for (var y = -5;y < 6;y++) {
if (Math.sqrt(x*x+y*y) < 5) {
val = array[((maxpos[1]+y)*_w)+(maxpos[0]+x)];
sdo -= (val*val);
sum -= val;
}
}
}
var mean = sum/array.length;
var sd = Math.sqrt((sdo/array.length)-(mean*mean));
// get mean/variance of output around peak
var psr = (max-mean)/sd;
return psr;
};
this.getResponse = function(imageData) {
// in-place
// preprocess
var prepImage = preprocess(imageData);
prepImage = cosine_window(prepImage);
// filter
var res = this.fft_inplace(prepImage);
// elementwise multiplication with filter
complex_mult_inplace(res, _filter);
// do inverse 2d fft
var filtered = this.ifft(res[0],res[1]);
return filtered;
};
this.track = function(input, left, top, width, height, updateFilter, gaussianPrior, calcPSR) {
// finds position of filter in input image
if (!_filter) {
console.log("Mosse-filter needs to be initialized or trained before starting tracking.");
return false;
}
if (input.tagName == "VIDEO" || input.tagName == "IMG") {
// scale selection according to original source image
var videoLeft = Math.round((left/input.width)*input.videoWidth);
var videoTop = Math.round((top/input.height)*input.videoHeight);
var videoWidth = Math.round((width/input.width)*input.videoWidth);
var videoHeight = Math.round((height/input.height)*input.videoHeight);
_cc.drawImage(input, videoLeft, videoTop, videoWidth, videoHeight, 0, 0, _w, _h);
} else if (input.tagName == "CANVAS") {
_cc.drawImage(input, left, top, width, height, 0, 0, _w, _h);
}
var image = _cc.getImageData(0,0,_w,_h);
var id = image.data;
if (params.convertToGrayscale) {
// convert to grayscale
for (var i = 0;i < _arrlen;i++) {
_image_array[i] = id[(4*i)]*0.3;
_image_array[i] += id[(4*i)+1]*0.59;
_image_array[i] += id[(4*i)+2]*0.11;
}
} else {
// use only one channel
for (var i = 0;i < _arrlen;i++) {
_image_array[i] = id[(4*i)];
}
}
// preprocess
var prepImage = preprocess(_image_array);
prepImage = cosine_window(prepImage);
// filter
var res = this.fft_inplace(prepImage);
// elementwise multiplication with filter
var nures = complex_mult(res, _filter);
// do inverse 2d fft
var filtered = this.ifft(nures[0],nures[1]);
// find max and min
var max = 0;
var min = 0;
var maxpos = [0, 0];
//method using centered gaussian prior
if (gaussianPrior) {
var prior, dx, dy;
var variance = 128;
for (var x = 0;x < _w;x++) {
for (var y = 0;y < _h;y++) {
dx = x - _w/2;
dy = y - _h/2;
prior = Math.exp(-0.5*((dx*dx)+(dy*dy))/variance);
if ((filtered[(y*_w)+x]*prior) > max) {
max = filtered[(y*_w)+x]*prior;
maxpos = [x,y];
}
if (filtered[(y*_w)+x] < min) {
min = filtered[(y*_w)+x];
}
}
}
} else {
for (var x = 0;x < _w;x++) {
for (var y = 0;y < _h;y++) {
if (filtered[(y*_w)+x] > max) {
max = filtered[(y*_w)+x];
maxpos = [x,y];
}
if (filtered[(y*_w)+x] < min) {
min = filtered[(y*_w)+x];
}
}
}
}
this.peak_prev = max;
if (params.drawResponse) {
// draw response
var diff = max-min;
var dc = document.createElement('canvas');
dc.setAttribute('width', 32);
dc.setAttribute('height', 32);
var dcc = dc.getContext('2d');
var psci = dcc.createImageData(32, 32);
var pscidata = psci.data;
for (var j = 0;j < 32*32;j++) {
//draw with priors
//var val = filtered[j]*Math.exp(-0.5*(((j%_w - _w/2)*(j%_w -_w/2))+((Math.floor(j/_h)-(_h/2))*(Math.floor(j/_h)-(_h/2))))/128);
var val = filtered[j];
val = Math.round((val+Math.abs(min))*(255/diff));
pscidata[j*4] = val;
pscidata[(j*4)+1] = val;
pscidata[(j*4)+2] = val;
pscidata[(j*4)+3] = 255;
}
dcc.putImageData(psci, 0, 0);
responseContext.drawImage(dc, left, top, width, width);
}
if (calcPSR) {
this.psr_prev = this.psr(filtered);
}
if (updateFilter) {
if (!updateable) {
console.log("The loaded filter does not support updating. Ignoring parameter 'updateFilter'.");
} else {
if (calcPSR) {
var psr = this.psr_prev;
} else {
var psr = this.psr(filtered);
}
if (psr > params.psrThreshold) {
// create target
var target = [];
var nux = maxpos[0];
var nuy = maxpos[1];
for (var x = 0;x < _w;x++) {
for (var y = 0;y < _h;y++) {
target[(y*_w)+x] = Math.exp(-(((x-nux)*(x-nux))+((y-nuy)*(y-nuy)))/(2*2));
}
}
//fft target
target = this.fft(target);
// create filter
var res_conj = complex_conj(res);
var fuTop = complex_mult(target,res_conj);
var fuBottom = complex_mult(res,res_conj);
// add up
var eta = params.eta;
for (var i = 0;i < _arrlen;i++) {
_top[0][i] = eta*fuTop[0][i] + (1-eta)*_top[0][i];
_top[1][i] = eta*fuTop[1][i] + (1-eta)*_top[1][i];
_bottom[0][i] = eta*fuBottom[0][i] + (1-eta)*_bottom[0][i];
_bottom[1][i] = eta*fuBottom[1][i] + (1-eta)*_bottom[1][i];
}
_filter = complex_div(_top,_bottom);
}
}
}
/*if (psr < 5) {
maxpos = [_w/2,_h/2];
}*/
maxpos[0] = maxpos[0]*(width/_w);
maxpos[1] = maxpos[1]*(width/_h);
// check if output is strong enough
// if not, return false?
if (max < 0) {
return false;
} else {
return maxpos;
}
};
this.train = function(input, left, top, width, height) {
if (!updateable) {
console.log("The loaded filter does not support updating. Unable to do training.");
return false;
}
if (input.tagName == "VIDEO" || input.tagName == "IMG") {
// scale selection according to original source image
var videoLeft = Math.round((left/input.width)*input.videoWidth);
var videoTop = Math.round((top/input.height)*input.videoHeight);
var videoWidth = Math.round((width/input.width)*input.videoWidth);
var videoHeight = Math.round((height/input.height)*input.videoHeight);
_cc.drawImage(input, videoLeft, videoTop, videoWidth, videoHeight, 0, 0, _w, _h);
} else if (input.tagName == "CANVAS") {
_cc.drawImage(input, left, top, width, height, 0, 0, _w, _h);
}
var image = _cc.getImageData(0,0,_w,_h);
var id = image.data;
// convert to grayscale
for (var i = 0;i < _arrlen;i++) {
_image_array[i] = id[(4*i)]*0.3;
_image_array[i] += id[(4*i)+1]*0.59;
_image_array[i] += id[(4*i)+2]*0.11;
}
// preprocess
var prepImage = preprocess(_image_array);
prepImage = cosine_window(prepImage);
// create target
var target = [];
var nux = _w/2;
var nuy = _h/2;
for (var x = 0;x < _w;x++) {
for (var y = 0;y < _h;y++) {
target[(y*_w)+x] = Math.exp(-(((x-nux)*(x-nux))+((y-nuy)*(y-nuy)))/(2*2));
}
}
//fft target
target = this.fft(target);
// filter
var res = this.fft(prepImage);
// create filter
var res_conj = complex_conj(res);
var fuTop = complex_mult(target,res_conj);
var fuBottom = complex_mult(res,res_conj);
// add up
var eta = params.eta;
for (var i = 0;i < _arrlen;i++) {
_top[0][i] = eta*fuTop[0][i] + (1-eta)*_top[0][i];
_top[1][i] = eta*fuTop[1][i] + (1-eta)*_top[1][i];
_bottom[0][i] = eta*fuBottom[0][i] + (1-eta)*_bottom[0][i];
_bottom[1][i] = eta*fuBottom[1][i] + (1-eta)*_bottom[1][i];
}
_filter = complex_div(_top,_bottom);
return true;
};
var preprocess = function(array) {
// in-place
// log adjusting
for (var i = 0;i < _arrlen;i++) {
array[i] = Math.log(array[i]+1);
}
// normalize to mean 0 and norm 1
var mean = 0;
for (var i = 0;i < _arrlen;i++) {
mean += array[i];
}
mean /= _arrlen;
for (var i = 0;i < _arrlen;i++) {
array[i] -= mean;
}
var norm = 0.0;
for (var i = 0;i < _arrlen;i++) {
norm += (array[i]*array[i]);
}
norm = Math.sqrt(norm);
if (norm !== 0) {
for (var i = 0;i < _arrlen;i++) {
array[i] /= norm;
}
}
return array;
};
var cosine_window = function(array) {
// calculate rect cosine window (in-place)
var pos = 0;
for (var i = 0;i < _w;i++) {
for (var j = 0;j < _h;j++) {
//pos = (i%_w)+(j*_w);
var cww = Math.sin((Math.PI*i)/(_w-1));
var cwh = Math.sin((Math.PI*j)/(_h-1));
array[pos] = Math.min(cww,cwh)*array[pos];
pos++;
}
}
return array;
};
var complex_mult = function(cn1, cn2) {
// not in-place
var re_part = new Array(_w);
var im_part = new Array(_w);
var nucn = [re_part, im_part];
for (var r = 0;r < _arrlen;r++) {
nucn[0][r] = (cn1[0][r]*cn2[0][r]) - (cn1[1][r]*cn2[1][r]);
nucn[1][r] = (cn1[0][r]*cn2[1][r]) + (cn1[1][r]*cn2[0][r]);
}
return nucn;
};
var complex_mult_inplace = function(cn1, cn2) {
// in-place
var temp1, temp2;
for (var r = 0;r < _arrlen;r++) {
temp1 = (cn1[0][r]*cn2[0][r]) - (cn1[1][r]*cn2[1][r]);
temp2 = (cn1[0][r]*cn2[1][r]) + (cn1[1][r]*cn2[0][r]);
cn1[0][r] = temp1;
cn1[1][r] = temp2;
}
};
var complex_conj = function(cn) {
// not in-place (TODO)
var nucn = [[],[]];
for (var i = 0;i < _arrlen;i++) {
nucn[0][i] = cn[0][i];
nucn[1][i] = -cn[1][i];
}
return nucn;
};
var complex_div = function(cn1, cn2) {
// not in-place (TODO)
var nucn = [[],[]];
for (var r = 0;r < _arrlen;r++) {
nucn[0][r] = ((cn1[0][r]*cn2[0][r])+(cn1[1][r]*cn2[1][r])) / ((cn2[0][r]*cn2[0][r]) + (cn2[1][r]*cn2[1][r]));
nucn[1][r] = ((cn1[1][r]*cn2[0][r])-(cn1[0][r]*cn2[1][r])) / ((cn2[0][r]*cn2[0][r]) + (cn2[1][r]*cn2[1][r]));
}
return nucn;
};
}
var mosse = {
mosseFilter : mosseFilter,
filters : {
left_eye_filter : left_eye_filter,
right_eye_filter : right_eye_filter,
mouth_filter : mouth_filter,
nose_filter : nose_filter,
face_filter : face_filter
}
};
var jsfeat_1 = createCommonjsModule(function (module) {
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*/
// namespace ?
var jsfeat = jsfeat || { REVISION: 'ALPHA' };
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*/
(function(global) {
"use strict";
//
// CONSTANTS
var EPSILON = 0.0000001192092896;
var FLT_MIN = 1E-37;
// implementation from CCV project
// currently working only with u8,s32,f32
var U8_t = 0x0100,
S32_t = 0x0200,
F32_t = 0x0400,
S64_t = 0x0800,
F64_t = 0x1000;
var C1_t = 0x01,
C2_t = 0x02,
C3_t = 0x03,
C4_t = 0x04;
var _data_type_size = new Int32Array([ -1, 1, 4, -1, 4, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, 8 ]);
var get_data_type = (function () {
return function(type) {
return (type & 0xFF00);
}
})();
var get_channel = (function () {
return function(type) {
return (type & 0xFF);
}
})();
var get_data_type_size = (function () {
return function(type) {
return _data_type_size[(type & 0xFF00) >> 8];
}
})();
// color conversion
var COLOR_RGBA2GRAY = 0;
var COLOR_RGB2GRAY = 1;
var COLOR_BGRA2GRAY = 2;
var COLOR_BGR2GRAY = 3;
// box blur option
var BOX_BLUR_NOSCALE = 0x01;
// svd options
var SVD_U_T = 0x01;
var SVD_V_T = 0x02;
var data_t = (function () {
function data_t(size_in_bytes, buffer) {
// we need align size to multiple of 8
this.size = ((size_in_bytes + 7) | 0) & -8;
if (typeof buffer === "undefined") {
this.buffer = new ArrayBuffer(this.size);
} else {
this.buffer = buffer;
this.size = buffer.length;
}
this.u8 = new Uint8Array(this.buffer);
this.i32 = new Int32Array(this.buffer);
this.f32 = new Float32Array(this.buffer);
this.f64 = new Float64Array(this.buffer);
}
return data_t;
})();
var matrix_t = (function () {
// columns, rows, data_type
function matrix_t(c, r, data_type, data_buffer) {
this.type = get_data_type(data_type)|0;
this.channel = get_channel(data_type)|0;
this.cols = c|0;
this.rows = r|0;
if (typeof data_buffer === "undefined") {
this.allocate();
} else {
this.buffer = data_buffer;
// data user asked for
this.data = this.type&U8_t ? this.buffer.u8 : (this.type&S32_t ? this.buffer.i32 : (this.type&F32_t ? this.buffer.f32 : this.buffer.f64));
}
}
matrix_t.prototype.allocate = function() {
// clear references
delete this.data;
delete this.buffer;
//
this.buffer = new data_t((this.cols * get_data_type_size(this.type) * this.channel) * this.rows);
this.data = this.type&U8_t ? this.buffer.u8 : (this.type&S32_t ? this.buffer.i32 : (this.type&F32_t ? this.buffer.f32 : this.buffer.f64));
};
matrix_t.prototype.copy_to = function(other) {
var od = other.data, td = this.data;
var i = 0, n = (this.cols*this.rows*this.channel)|0;
for(; i < n-4; i+=4) {
od[i] = td[i];
od[i+1] = td[i+1];
od[i+2] = td[i+2];
od[i+3] = td[i+3];
}
for(; i < n; ++i) {
od[i] = td[i];
}
};
matrix_t.prototype.resize = function(c, r, ch) {
if (typeof ch === "undefined") { ch = this.channel; }
// relocate buffer only if new size doesnt fit
var new_size = (c * get_data_type_size(this.type) * ch) * r;
if(new_size > this.buffer.size) {
this.cols = c;
this.rows = r;
this.channel = ch;
this.allocate();
} else {
this.cols = c;
this.rows = r;
this.channel = ch;
}
};
return matrix_t;
})();
var pyramid_t = (function () {
function pyramid_t(levels) {
this.levels = levels|0;
this.data = new Array(levels);
this.pyrdown = jsfeat.imgproc.pyrdown;
}
pyramid_t.prototype.allocate = function(start_w, start_h, data_type) {
var i = this.levels;
while(--i >= 0) {
this.data[i] = new matrix_t(start_w >> i, start_h >> i, data_type);
}
};
pyramid_t.prototype.build = function(input, skip_first_level) {
if (typeof skip_first_level === "undefined") { skip_first_level = true; }
// just copy data to first level
var i = 2, a = input, b = this.data[0];
if(!skip_first_level) {
var j=input.cols*input.rows;
while(--j >= 0) {
b.data[j] = input.data[j];
}
}
b = this.data[1];
this.pyrdown(a, b);
for(; i < this.levels; ++i) {
a = b;
b = this.data[i];
this.pyrdown(a, b);
}
};
return pyramid_t;
})();
var keypoint_t = (function () {
function keypoint_t(x,y,score,level,angle) {
if (typeof x === "undefined") { x=0; }
if (typeof y === "undefined") { y=0; }
if (typeof score === "undefined") { score=0; }
if (typeof level === "undefined") { level=0; }
if (typeof angle === "undefined") { angle=-1.0; }
this.x = x;
this.y = y;
this.score = score;
this.level = level;
this.angle = angle;
}
return keypoint_t;
})();
// data types
global.U8_t = U8_t;
global.S32_t = S32_t;
global.F32_t = F32_t;
global.S64_t = S64_t;
global.F64_t = F64_t;
// data channels
global.C1_t = C1_t;
global.C2_t = C2_t;
global.C3_t = C3_t;
global.C4_t = C4_t;
// popular formats
global.U8C1_t = U8_t | C1_t;
global.U8C3_t = U8_t | C3_t;
global.U8C4_t = U8_t | C4_t;
global.F32C1_t = F32_t | C1_t;
global.F32C2_t = F32_t | C2_t;
global.S32C1_t = S32_t | C1_t;
global.S32C2_t = S32_t | C2_t;
// constants
global.EPSILON = EPSILON;
global.FLT_MIN = FLT_MIN;
// color convert
global.COLOR_RGBA2GRAY = COLOR_RGBA2GRAY;
global.COLOR_RGB2GRAY = COLOR_RGB2GRAY;
global.COLOR_BGRA2GRAY = COLOR_BGRA2GRAY;
global.COLOR_BGR2GRAY = COLOR_BGR2GRAY;
// options
global.BOX_BLUR_NOSCALE = BOX_BLUR_NOSCALE;
global.SVD_U_T = SVD_U_T;
global.SVD_V_T = SVD_V_T;
global.get_data_type = get_data_type;
global.get_channel = get_channel;
global.get_data_type_size = get_data_type_size;
global.data_t = data_t;
global.matrix_t = matrix_t;
global.pyramid_t = pyramid_t;
global.keypoint_t = keypoint_t;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*/
(function(global) {
"use strict";
//
var cache = (function() {
// very primitive array cache, still need testing if it helps
// of course V8 has its own powerful cache sys but i'm not sure
// it caches several multichannel 640x480 buffer creations each frame
var _pool_node_t = (function () {
function _pool_node_t(size_in_bytes) {
this.next = null;
this.data = new jsfeat.data_t(size_in_bytes);
this.size = this.data.size;
this.buffer = this.data.buffer;
this.u8 = this.data.u8;
this.i32 = this.data.i32;
this.f32 = this.data.f32;
this.f64 = this.data.f64;
}
_pool_node_t.prototype.resize = function(size_in_bytes) {
delete this.data;
this.data = new jsfeat.data_t(size_in_bytes);
this.size = this.data.size;
this.buffer = this.data.buffer;
this.u8 = this.data.u8;
this.i32 = this.data.i32;
this.f32 = this.data.f32;
this.f64 = this.data.f64;
};
return _pool_node_t;
})();
var _pool_head, _pool_tail;
var _pool_size = 0;
return {
allocate: function(capacity, data_size) {
_pool_head = _pool_tail = new _pool_node_t(data_size);
for (var i = 0; i < capacity; ++i) {
var node = new _pool_node_t(data_size);
_pool_tail = _pool_tail.next = node;
_pool_size++;
}
},
get_buffer: function(size_in_bytes) {
// assume we have enough free nodes
var node = _pool_head;
_pool_head = _pool_head.next;
_pool_size--;
if(size_in_bytes > node.size) {
node.resize(size_in_bytes);
}
return node;
},
put_buffer: function(node) {
_pool_tail = _pool_tail.next = node;
_pool_size++;
}
};
})();
global.cache = cache;
// for now we dont need more than 30 buffers
// if having cache sys really helps we can add auto extending sys
cache.allocate(30, 640*4);
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*/
(function(global) {
"use strict";
//
var math = (function() {
var qsort_stack = new Int32Array(48*2);
return {
get_gaussian_kernel: function(size, sigma, kernel, data_type) {
var i=0,x=0.0,t=0.0,sigma_x=0.0,scale_2x=0.0;
var sum = 0.0;
var kern_node = jsfeat.cache.get_buffer(size<<2);
var _kernel = kern_node.f32;//new Float32Array(size);
if((size&1) == 1 && size <= 7 && sigma <= 0) {
switch(size>>1) {
case 0:
_kernel[0] = 1.0;
sum = 1.0;
break;
case 1:
_kernel[0] = 0.25, _kernel[1] = 0.5, _kernel[2] = 0.25;
sum = 0.25+0.5+0.25;
break;
case 2:
_kernel[0] = 0.0625, _kernel[1] = 0.25, _kernel[2] = 0.375,
_kernel[3] = 0.25, _kernel[4] = 0.0625;
sum = 0.0625+0.25+0.375+0.25+0.0625;
break;
case 3:
_kernel[0] = 0.03125, _kernel[1] = 0.109375, _kernel[2] = 0.21875,
_kernel[3] = 0.28125, _kernel[4] = 0.21875, _kernel[5] = 0.109375, _kernel[6] = 0.03125;
sum = 0.03125+0.109375+0.21875+0.28125+0.21875+0.109375+0.03125;
break;
}
} else {
sigma_x = sigma > 0 ? sigma : ((size-1)*0.5 - 1.0)*0.3 + 0.8;
scale_2x = -0.5/(sigma_x*sigma_x);
for( ; i < size; ++i )
{
x = i - (size-1)*0.5;
t = Math.exp(scale_2x*x*x);
_kernel[i] = t;
sum += t;
}
}
if(data_type & jsfeat.U8_t) {
// int based kernel
sum = 256.0/sum;
for (i = 0; i < size; ++i) {
kernel[i] = (_kernel[i] * sum + 0.5)|0;
}
} else {
// classic kernel
sum = 1.0/sum;
for (i = 0; i < size; ++i) {
kernel[i] = _kernel[i] * sum;
}
}
jsfeat.cache.put_buffer(kern_node);
},
// model is 3x3 matrix_t
perspective_4point_transform: function(model, src_x0, src_y0, dst_x0, dst_y0,
src_x1, src_y1, dst_x1, dst_y1,
src_x2, src_y2, dst_x2, dst_y2,
src_x3, src_y3, dst_x3, dst_y3) {
var t1 = src_x0;
var t2 = src_x2;
var t4 = src_y1;
var t5 = t1 * t2 * t4;
var t6 = src_y3;
var t7 = t1 * t6;
var t8 = t2 * t7;
var t9 = src_y2;
var t10 = t1 * t9;
var t11 = src_x1;
var t14 = src_y0;
var t15 = src_x3;
var t16 = t14 * t15;
var t18 = t16 * t11;
var t20 = t15 * t11 * t9;
var t21 = t15 * t4;
var t24 = t15 * t9;
var t25 = t2 * t4;
var t26 = t6 * t2;
var t27 = t6 * t11;
var t28 = t9 * t11;
var t30 = 1.0 / (t21-t24 - t25 + t26 - t27 + t28);
var t32 = t1 * t15;
var t35 = t14 * t11;
var t41 = t4 * t1;
var t42 = t6 * t41;
var t43 = t14 * t2;
var t46 = t16 * t9;
var t48 = t14 * t9 * t11;
var t51 = t4 * t6 * t2;
var t55 = t6 * t14;
var Hr0 = -(t8-t5 + t10 * t11 - t11 * t7 - t16 * t2 + t18 - t20 + t21 * t2) * t30;
var Hr1 = (t5 - t8 - t32 * t4 + t32 * t9 + t18 - t2 * t35 + t27 * t2 - t20) * t30;
var Hr2 = t1;
var Hr3 = (-t9 * t7 + t42 + t43 * t4 - t16 * t4 + t46 - t48 + t27 * t9 - t51) * t30;
var Hr4 = (-t42 + t41 * t9 - t55 * t2 + t46 - t48 + t55 * t11 + t51 - t21 * t9) * t30;
var Hr5 = t14;
var Hr6 = (-t10 + t41 + t43 - t35 + t24 - t21 - t26 + t27) * t30;
var Hr7 = (-t7 + t10 + t16 - t43 + t27 - t28 - t21 + t25) * t30;
t1 = dst_x0;
t2 = dst_x2;
t4 = dst_y1;
t5 = t1 * t2 * t4;
t6 = dst_y3;
t7 = t1 * t6;
t8 = t2 * t7;
t9 = dst_y2;
t10 = t1 * t9;
t11 = dst_x1;
t14 = dst_y0;
t15 = dst_x3;
t16 = t14 * t15;
t18 = t16 * t11;
t20 = t15 * t11 * t9;
t21 = t15 * t4;
t24 = t15 * t9;
t25 = t2 * t4;
t26 = t6 * t2;
t27 = t6 * t11;
t28 = t9 * t11;
t30 = 1.0 / (t21-t24 - t25 + t26 - t27 + t28);
t32 = t1 * t15;
t35 = t14 * t11;
t41 = t4 * t1;
t42 = t6 * t41;
t43 = t14 * t2;
t46 = t16 * t9;
t48 = t14 * t9 * t11;
t51 = t4 * t6 * t2;
t55 = t6 * t14;
var Hl0 = -(t8-t5 + t10 * t11 - t11 * t7 - t16 * t2 + t18 - t20 + t21 * t2) * t30;
var Hl1 = (t5 - t8 - t32 * t4 + t32 * t9 + t18 - t2 * t35 + t27 * t2 - t20) * t30;
var Hl2 = t1;
var Hl3 = (-t9 * t7 + t42 + t43 * t4 - t16 * t4 + t46 - t48 + t27 * t9 - t51) * t30;
var Hl4 = (-t42 + t41 * t9 - t55 * t2 + t46 - t48 + t55 * t11 + t51 - t21 * t9) * t30;
var Hl5 = t14;
var Hl6 = (-t10 + t41 + t43 - t35 + t24 - t21 - t26 + t27) * t30;
var Hl7 = (-t7 + t10 + t16 - t43 + t27 - t28 - t21 + t25) * t30;
// the following code computes R = Hl * inverse Hr
t2 = Hr4-Hr7*Hr5;
t4 = Hr0*Hr4;
t5 = Hr0*Hr5;
t7 = Hr3*Hr1;
t8 = Hr2*Hr3;
t10 = Hr1*Hr6;
var t12 = Hr2*Hr6;
t15 = 1.0 / (t4-t5*Hr7-t7+t8*Hr7+t10*Hr5-t12*Hr4);
t18 = -Hr3+Hr5*Hr6;
var t23 = -Hr3*Hr7+Hr4*Hr6;
t28 = -Hr1+Hr2*Hr7;
var t31 = Hr0-t12;
t35 = Hr0*Hr7-t10;
t41 = -Hr1*Hr5+Hr2*Hr4;
var t44 = t5-t8;
var t47 = t4-t7;
t48 = t2*t15;
var t49 = t28*t15;
var t50 = t41*t15;
var mat = model.data;
mat[0] = Hl0*t48+Hl1*(t18*t15)-Hl2*(t23*t15);
mat[1] = Hl0*t49+Hl1*(t31*t15)-Hl2*(t35*t15);
mat[2] = -Hl0*t50-Hl1*(t44*t15)+Hl2*(t47*t15);
mat[3] = Hl3*t48+Hl4*(t18*t15)-Hl5*(t23*t15);
mat[4] = Hl3*t49+Hl4*(t31*t15)-Hl5*(t35*t15);
mat[5] = -Hl3*t50-Hl4*(t44*t15)+Hl5*(t47*t15);
mat[6] = Hl6*t48+Hl7*(t18*t15)-t23*t15;
mat[7] = Hl6*t49+Hl7*(t31*t15)-t35*t15;
mat[8] = -Hl6*t50-Hl7*(t44*t15)+t47*t15;
},
// The current implementation was derived from *BSD system qsort():
// Copyright (c) 1992, 1993
// The Regents of the University of California. All rights reserved.
qsort: function(array, low, high, cmp) {
var isort_thresh = 7;
var t,ta,tb,tc;
var sp = 0,left=0,right=0,i=0,n=0,m=0,ptr=0,ptr2=0,d=0;
var left0=0,left1=0,right0=0,right1=0,pivot=0,a=0,b=0,c=0,swap_cnt=0;
var stack = qsort_stack;
if( (high-low+1) <= 1 ) return;
stack[0] = low;
stack[1] = high;
while( sp >= 0 ) {
left = stack[sp<<1];
right = stack[(sp<<1)+1];
sp--;
for(;;) {
n = (right - left) + 1;
if( n <= isort_thresh ) {
//insert_sort:
for( ptr = left + 1; ptr <= right; ptr++ ) {
for( ptr2 = ptr; ptr2 > left && cmp(array[ptr2],array[ptr2-1]); ptr2--) {
t = array[ptr2];
array[ptr2] = array[ptr2-1];
array[ptr2-1] = t;
}
}
break;
} else {
swap_cnt = 0;
left0 = left;
right0 = right;
pivot = left + (n>>1);
if( n > 40 ) {
d = n >> 3;
a = left, b = left + d, c = left + (d<<1);
ta = array[a],tb = array[b],tc = array[c];
left = cmp(ta, tb) ? (cmp(tb, tc) ? b : (cmp(ta, tc) ? c : a))
: (cmp(tc, tb) ? b : (cmp(ta, tc) ? a : c));
a = pivot - d, b = pivot, c = pivot + d;
ta = array[a],tb = array[b],tc = array[c];
pivot = cmp(ta, tb) ? (cmp(tb, tc) ? b : (cmp(ta, tc) ? c : a))
: (cmp(tc, tb) ? b : (cmp(ta, tc) ? a : c));
a = right - (d<<1), b = right - d, c = right;
ta = array[a],tb = array[b],tc = array[c];
right = cmp(ta, tb) ? (cmp(tb, tc) ? b : (cmp(ta, tc) ? c : a))
: (cmp(tc, tb) ? b : (cmp(ta, tc) ? a : c));
}
a = left, b = pivot, c = right;
ta = array[a],tb = array[b],tc = array[c];
pivot = cmp(ta, tb) ? (cmp(tb, tc) ? b : (cmp(ta, tc) ? c : a))
: (cmp(tc, tb) ? b : (cmp(ta, tc) ? a : c));
if( pivot != left0 ) {
t = array[pivot];
array[pivot] = array[left0];
array[left0] = t;
pivot = left0;
}
left = left1 = left0 + 1;
right = right1 = right0;
ta = array[pivot];
for(;;) {
while( left <= right && !cmp(ta, array[left]) ) {
if( !cmp(array[left], ta) ) {
if( left > left1 ) {
t = array[left1];
array[left1] = array[left];
array[left] = t;
}
swap_cnt = 1;
left1++;
}
left++;
}
while( left <= right && !cmp(array[right], ta) ) {
if( !cmp(ta, array[right]) ) {
if( right < right1 ) {
t = array[right1];
array[right1] = array[right];
array[right] = t;
}
swap_cnt = 1;
right1--;
}
right--;
}
if( left > right ) break;
t = array[left];
array[left] = array[right];
array[right] = t;
swap_cnt = 1;
left++;
right--;
}
if( swap_cnt == 0 ) {
left = left0, right = right0;
//goto insert_sort;
for( ptr = left + 1; ptr <= right; ptr++ ) {
for( ptr2 = ptr; ptr2 > left && cmp(array[ptr2],array[ptr2-1]); ptr2--) {
t = array[ptr2];
array[ptr2] = array[ptr2-1];
array[ptr2-1] = t;
}
}
break;
}
n = Math.min( (left1 - left0), (left - left1) );
m = (left-n)|0;
for( i = 0; i < n; ++i,++m ) {
t = array[left0+i];
array[left0+i] = array[m];
array[m] = t;
}
n = Math.min( (right0 - right1), (right1 - right) );
m = (right0-n+1)|0;
for( i = 0; i < n; ++i,++m ) {
t = array[left+i];
array[left+i] = array[m];
array[m] = t;
}
n = (left - left1);
m = (right1 - right);
if( n > 1 ) {
if( m > 1 ) {
if( n > m ) {
++sp;
stack[sp<<1] = left0;
stack[(sp<<1)+1] = left0 + n - 1;
left = right0 - m + 1, right = right0;
} else {
++sp;
stack[sp<<1] = right0 - m + 1;
stack[(sp<<1)+1] = right0;
left = left0, right = left0 + n - 1;
}
} else {
left = left0, right = left0 + n - 1;
}
}
else if( m > 1 )
left = right0 - m + 1, right = right0;
else
break;
}
}
}
},
median: function(array, low, high) {
var w;
var middle=0,ll=0,hh=0,median=(low+high)>>1;
for (;;) {
if (high <= low) return array[median];
if (high == (low + 1)) {
if (array[low] > array[high]) {
w = array[low];
array[low] = array[high];
array[high] = w;
}
return array[median];
}
middle = ((low + high) >> 1);
if (array[middle] > array[high]) {
w = array[middle];
array[middle] = array[high];
array[high] = w;
}
if (array[low] > array[high]) {
w = array[low];
array[low] = array[high];
array[high] = w;
}
if (array[middle] > array[low]) {
w = array[middle];
array[middle] = array[low];
array[low] = w;
}
ll = (low + 1);
w = array[middle];
array[middle] = array[ll];
array[ll] = w;
hh = high;
for (;;) {
do ++ll; while (array[low] > array[ll]);
do --hh; while (array[hh] > array[low]);
if (hh < ll) break;
w = array[ll];
array[ll] = array[hh];
array[hh] = w;
}
w = array[low];
array[low] = array[hh];
array[hh] = w;
if (hh <= median)
low = ll;
else if (hh >= median)
high = (hh - 1);
}
return 0;
}
};
})();
global.math = math;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*
*/
(function(global) {
"use strict";
//
var matmath = (function() {
return {
identity: function(M, value) {
if (typeof value === "undefined") { value=1; }
var src=M.data;
var rows=M.rows, cols=M.cols, cols_1=(cols+1)|0;
var len = rows * cols;
var k = len;
while(--len >= 0) src[len] = 0.0;
len = k;
k = 0;
while(k < len) {
src[k] = value;
k = k + cols_1;
}
},
transpose: function(At, A) {
var i=0,j=0,nrows=A.rows,ncols=A.cols;
var Ai=0,Ati=0,pAt=0;
var ad=A.data,atd=At.data;
for (; i < nrows; Ati += 1, Ai += ncols, i++) {
pAt = Ati;
for (j = 0; j < ncols; pAt += nrows, j++) atd[pAt] = ad[Ai+j];
}
},
// C = A * B
multiply: function(C, A, B) {
var i=0,j=0,k=0;
var Ap=0,pA=0,pB=0,p_B=0,Cp=0;
var ncols=A.cols,nrows=A.rows,mcols=B.cols;
var ad=A.data,bd=B.data,cd=C.data;
var sum=0.0;
for (; i < nrows; Ap += ncols, i++) {
for (p_B = 0, j = 0; j < mcols; Cp++, p_B++, j++) {
pB = p_B;
pA = Ap;
sum = 0.0;
for (k = 0; k < ncols; pA++, pB += mcols, k++) {
sum += ad[pA] * bd[pB];
}
cd[Cp] = sum;
}
}
},
// C = A * B'
multiply_ABt: function(C, A, B) {
var i=0,j=0,k=0;
var Ap=0,pA=0,pB=0,Cp=0;
var ncols=A.cols,nrows=A.rows,mrows=B.rows;
var ad=A.data,bd=B.data,cd=C.data;
var sum=0.0;
for (; i < nrows; Ap += ncols, i++) {
for (pB = 0, j = 0; j < mrows; Cp++, j++) {
pA = Ap;
sum = 0.0;
for (k = 0; k < ncols; pA++, pB++, k++) {
sum += ad[pA] * bd[pB];
}
cd[Cp] = sum;
}
}
},
// C = A' * B
multiply_AtB: function(C, A, B) {
var i=0,j=0,k=0;
var Ap=0,pA=0,pB=0,p_B=0,Cp=0;
var ncols=A.cols,nrows=A.rows,mcols=B.cols;
var ad=A.data,bd=B.data,cd=C.data;
var sum=0.0;
for (; i < ncols; Ap++, i++) {
for (p_B = 0, j = 0; j < mcols; Cp++, p_B++, j++) {
pB = p_B;
pA = Ap;
sum = 0.0;
for (k = 0; k < nrows; pA += ncols, pB += mcols, k++) {
sum += ad[pA] * bd[pB];
}
cd[Cp] = sum;
}
}
},
// C = A * A'
multiply_AAt: function(C, A) {
var i=0,j=0,k=0;
var pCdiag=0,p_A=0,pA=0,pB=0,pC=0,pCt=0;
var ncols=A.cols,nrows=A.rows;
var ad=A.data,cd=C.data;
var sum=0.0;
for (; i < nrows; pCdiag += nrows + 1, p_A = pA, i++) {
pC = pCdiag;
pCt = pCdiag;
pB = p_A;
for (j = i; j < nrows; pC++, pCt += nrows, j++) {
pA = p_A;
sum = 0.0;
for (k = 0; k < ncols; k++) {
sum += ad[pA++] * ad[pB++];
}
cd[pC] = sum;
cd[pCt] = sum;
}
}
},
// C = A' * A
multiply_AtA: function(C, A) {
var i=0,j=0,k=0;
var p_A=0,pA=0,pB=0,p_C=0,pC=0,p_CC=0;
var ncols=A.cols,nrows=A.rows;
var ad=A.data,cd=C.data;
var sum=0.0;
for (; i < ncols; p_C += ncols, i++) {
p_A = i;
p_CC = p_C + i;
pC = p_CC;
for (j = i; j < ncols; pC++, p_CC += ncols, j++) {
pA = p_A;
pB = j;
sum = 0.0;
for (k = 0; k < nrows; pA += ncols, pB += ncols, k++) {
sum += ad[pA] * ad[pB];
}
cd[pC] = sum;
cd[p_CC] = sum;
}
}
},
// various small matrix operations
identity_3x3: function(M, value) {
if (typeof value === "undefined") { value=1; }
var dt=M.data;
dt[0] = dt[4] = dt[8] = value;
dt[1] = dt[2] = dt[3] = 0;
dt[5] = dt[6] = dt[7] = 0;
},
invert_3x3: function(from, to) {
var A = from.data, invA = to.data;
var t1 = A[4];
var t2 = A[8];
var t4 = A[5];
var t5 = A[7];
var t8 = A[0];
var t9 = t8*t1;
var t11 = t8*t4;
var t13 = A[3];
var t14 = A[1];
var t15 = t13*t14;
var t17 = A[2];
var t18 = t13*t17;
var t20 = A[6];
var t21 = t20*t14;
var t23 = t20*t17;
var t26 = 1.0/(t9*t2-t11*t5-t15*t2+t18*t5+t21*t4-t23*t1);
invA[0] = (t1*t2-t4*t5)*t26;
invA[1] = -(t14*t2-t17*t5)*t26;
invA[2] = -(-t14*t4+t17*t1)*t26;
invA[3] = -(t13*t2-t4*t20)*t26;
invA[4] = (t8*t2-t23)*t26;
invA[5] = -(t11-t18)*t26;
invA[6] = -(-t13*t5+t1*t20)*t26;
invA[7] = -(t8*t5-t21)*t26;
invA[8] = (t9-t15)*t26;
},
// C = A * B
multiply_3x3: function(C, A, B) {
var Cd=C.data, Ad=A.data, Bd=B.data;
var m1_0 = Ad[0], m1_1 = Ad[1], m1_2 = Ad[2];
var m1_3 = Ad[3], m1_4 = Ad[4], m1_5 = Ad[5];
var m1_6 = Ad[6], m1_7 = Ad[7], m1_8 = Ad[8];
var m2_0 = Bd[0], m2_1 = Bd[1], m2_2 = Bd[2];
var m2_3 = Bd[3], m2_4 = Bd[4], m2_5 = Bd[5];
var m2_6 = Bd[6], m2_7 = Bd[7], m2_8 = Bd[8];
Cd[0] = m1_0 * m2_0 + m1_1 * m2_3 + m1_2 * m2_6;
Cd[1] = m1_0 * m2_1 + m1_1 * m2_4 + m1_2 * m2_7;
Cd[2] = m1_0 * m2_2 + m1_1 * m2_5 + m1_2 * m2_8;
Cd[3] = m1_3 * m2_0 + m1_4 * m2_3 + m1_5 * m2_6;
Cd[4] = m1_3 * m2_1 + m1_4 * m2_4 + m1_5 * m2_7;
Cd[5] = m1_3 * m2_2 + m1_4 * m2_5 + m1_5 * m2_8;
Cd[6] = m1_6 * m2_0 + m1_7 * m2_3 + m1_8 * m2_6;
Cd[7] = m1_6 * m2_1 + m1_7 * m2_4 + m1_8 * m2_7;
Cd[8] = m1_6 * m2_2 + m1_7 * m2_5 + m1_8 * m2_8;
},
mat3x3_determinant: function(M) {
var md=M.data;
return md[0] * md[4] * md[8] -
md[0] * md[5] * md[7] -
md[3] * md[1] * md[8] +
md[3] * md[2] * md[7] +
md[6] * md[1] * md[5] -
md[6] * md[2] * md[4];
},
determinant_3x3: function(M11, M12, M13,
M21, M22, M23,
M31, M32, M33) {
return M11 * M22 * M33 - M11 * M23 * M32 -
M21 * M12 * M33 + M21 * M13 * M32 +
M31 * M12 * M23 - M31 * M13 * M22;
}
};
})();
global.matmath = matmath;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*
*/
(function(global) {
"use strict";
//
var linalg = (function() {
var swap = function(A, i0, i1, t) {
t = A[i0];
A[i0] = A[i1];
A[i1] = t;
};
var hypot = function(a, b) {
a = Math.abs(a);
b = Math.abs(b);
if( a > b ) {
b /= a;
return a*Math.sqrt(1.0 + b*b);
}
if( b > 0 ) {
a /= b;
return b*Math.sqrt(1.0 + a*a);
}
return 0.0;
};
var JacobiImpl = function(A, astep, W, V, vstep, n) {
var eps = jsfeat.EPSILON;
var i=0,j=0,k=0,m=0,l=0,idx=0,_in=0,_in2=0;
var iters=0,max_iter=n*n*30;
var mv=0.0,val=0.0,p=0.0,y=0.0,t=0.0,s=0.0,c=0.0,a0=0.0,b0=0.0;
var indR_buff = jsfeat.cache.get_buffer(n<<2);
var indC_buff = jsfeat.cache.get_buffer(n<<2);
var indR = indR_buff.i32;
var indC = indC_buff.i32;
if(V) {
for(; i < n; i++) {
k = i*vstep;
for(j = 0; j < n; j++) {
V[k + j] = 0.0;
}
V[k + i] = 1.0;
}
}
for(k = 0; k < n; k++) {
W[k] = A[(astep + 1)*k];
if(k < n - 1) {
for(m = k+1, mv = Math.abs(A[astep*k + m]), i = k+2; i < n; i++) {
val = Math.abs(A[astep*k+i]);
if(mv < val)
mv = val, m = i;
}
indR[k] = m;
}
if(k > 0) {
for(m = 0, mv = Math.abs(A[k]), i = 1; i < k; i++) {
val = Math.abs(A[astep*i+k]);
if(mv < val)
mv = val, m = i;
}
indC[k] = m;
}
}
if(n > 1) for( ; iters < max_iter; iters++) {
// find index (k,l) of pivot p
for(k = 0, mv = Math.abs(A[indR[0]]), i = 1; i < n-1; i++) {
val = Math.abs(A[astep*i + indR[i]]);
if( mv < val )
mv = val, k = i;
}
l = indR[k];
for(i = 1; i < n; i++) {
val = Math.abs(A[astep*indC[i] + i]);
if( mv < val )
mv = val, k = indC[i], l = i;
}
p = A[astep*k + l];
if(Math.abs(p) <= eps) break;
y = (W[l] - W[k])*0.5;
t = Math.abs(y) + hypot(p, y);
s = hypot(p, t);
c = t/s;
s = p/s; t = (p/t)*p;
if(y < 0)
s = -s, t = -t;
A[astep*k + l] = 0;
W[k] -= t;
W[l] += t;
// rotate rows and columns k and l
for (i = 0; i < k; i++) {
_in = (astep * i + k);
_in2 = (astep * i + l);
a0 = A[_in];
b0 = A[_in2];
A[_in] = a0 * c - b0 * s;
A[_in2] = a0 * s + b0 * c;
}
for (i = (k + 1); i < l; i++) {
_in = (astep * k + i);
_in2 = (astep * i + l);
a0 = A[_in];
b0 = A[_in2];
A[_in] = a0 * c - b0 * s;
A[_in2] = a0 * s + b0 * c;
}
i = l + 1;
_in = (astep * k + i);
_in2 = (astep * l + i);
for (; i < n; i++, _in++, _in2++) {
a0 = A[_in];
b0 = A[_in2];
A[_in] = a0 * c - b0 * s;
A[_in2] = a0 * s + b0 * c;
}
// rotate eigenvectors
if (V) {
_in = vstep * k;
_in2 = vstep * l;
for (i = 0; i < n; i++, _in++, _in2++) {
a0 = V[_in];
b0 = V[_in2];
V[_in] = a0 * c - b0 * s;
V[_in2] = a0 * s + b0 * c;
}
}
for(j = 0; j < 2; j++) {
idx = j == 0 ? k : l;
if(idx < n - 1) {
for(m = idx+1, mv = Math.abs(A[astep*idx + m]), i = idx+2; i < n; i++) {
val = Math.abs(A[astep*idx+i]);
if( mv < val )
mv = val, m = i;
}
indR[idx] = m;
}
if(idx > 0) {
for(m = 0, mv = Math.abs(A[idx]), i = 1; i < idx; i++) {
val = Math.abs(A[astep*i+idx]);
if( mv < val )
mv = val, m = i;
}
indC[idx] = m;
}
}
}
// sort eigenvalues & eigenvectors
for(k = 0; k < n-1; k++) {
m = k;
for(i = k+1; i < n; i++) {
if(W[m] < W[i])
m = i;
}
if(k != m) {
swap(W, m, k, mv);
if(V) {
for(i = 0; i < n; i++) {
swap(V, vstep*m + i, vstep*k + i, mv);
}
}
}
}
jsfeat.cache.put_buffer(indR_buff);
jsfeat.cache.put_buffer(indC_buff);
};
var JacobiSVDImpl = function(At, astep, _W, Vt, vstep, m, n, n1) {
var eps = jsfeat.EPSILON * 2.0;
var minval = jsfeat.FLT_MIN;
var i=0,j=0,k=0,iter=0,max_iter=Math.max(m, 30);
var Ai=0,Aj=0,Vi=0,Vj=0,changed=0;
var c=0.0, s=0.0, t=0.0;
var t0=0.0,t1=0.0,sd=0.0,beta=0.0,gamma=0.0,delta=0.0,a=0.0,p=0.0,b=0.0;
var seed = 0x1234;
var val=0.0,val0=0.0,asum=0.0;
var W_buff = jsfeat.cache.get_buffer(n<<3);
var W = W_buff.f64;
for(; i < n; i++) {
for(k = 0, sd = 0; k < m; k++) {
t = At[i*astep + k];
sd += t*t;
}
W[i] = sd;
if(Vt) {
for(k = 0; k < n; k++) {
Vt[i*vstep + k] = 0;
}
Vt[i*vstep + i] = 1;
}
}
for(; iter < max_iter; iter++) {
changed = 0;
for(i = 0; i < n-1; i++) {
for(j = i+1; j < n; j++) {
Ai = (i*astep)|0, Aj = (j*astep)|0;
a = W[i], p = 0, b = W[j];
k = 2;
p += At[Ai]*At[Aj];
p += At[Ai+1]*At[Aj+1];
for(; k < m; k++)
p += At[Ai+k]*At[Aj+k];
if(Math.abs(p) <= eps*Math.sqrt(a*b)) continue;
p *= 2.0;
beta = a - b, gamma = hypot(p, beta);
if( beta < 0 ) {
delta = (gamma - beta)*0.5;
s = Math.sqrt(delta/gamma);
c = (p/(gamma*s*2.0));
} else {
c = Math.sqrt((gamma + beta)/(gamma*2.0));
s = (p/(gamma*c*2.0));
}
a=0.0, b=0.0;
k = 2; // unroll
t0 = c*At[Ai] + s*At[Aj];
t1 = -s*At[Ai] + c*At[Aj];
At[Ai] = t0; At[Aj] = t1;
a += t0*t0; b += t1*t1;
t0 = c*At[Ai+1] + s*At[Aj+1];
t1 = -s*At[Ai+1] + c*At[Aj+1];
At[Ai+1] = t0; At[Aj+1] = t1;
a += t0*t0; b += t1*t1;
for( ; k < m; k++ )
{
t0 = c*At[Ai+k] + s*At[Aj+k];
t1 = -s*At[Ai+k] + c*At[Aj+k];
At[Ai+k] = t0; At[Aj+k] = t1;
a += t0*t0; b += t1*t1;
}
W[i] = a; W[j] = b;
changed = 1;
if(Vt) {
Vi = (i*vstep)|0, Vj = (j*vstep)|0;
k = 2;
t0 = c*Vt[Vi] + s*Vt[Vj];
t1 = -s*Vt[Vi] + c*Vt[Vj];
Vt[Vi] = t0; Vt[Vj] = t1;
t0 = c*Vt[Vi+1] + s*Vt[Vj+1];
t1 = -s*Vt[Vi+1] + c*Vt[Vj+1];
Vt[Vi+1] = t0; Vt[Vj+1] = t1;
for(; k < n; k++) {
t0 = c*Vt[Vi+k] + s*Vt[Vj+k];
t1 = -s*Vt[Vi+k] + c*Vt[Vj+k];
Vt[Vi+k] = t0; Vt[Vj+k] = t1;
}
}
}
}
if(changed == 0) break;
}
for(i = 0; i < n; i++) {
for(k = 0, sd = 0; k < m; k++) {
t = At[i*astep + k];
sd += t*t;
}
W[i] = Math.sqrt(sd);
}
for(i = 0; i < n-1; i++) {
j = i;
for(k = i+1; k < n; k++) {
if(W[j] < W[k])
j = k;
}
if(i != j) {
swap(W, i, j, sd);
if(Vt) {
for(k = 0; k < m; k++) {
swap(At, i*astep + k, j*astep + k, t);
}
for(k = 0; k < n; k++) {
swap(Vt, i*vstep + k, j*vstep + k, t);
}
}
}
}
for(i = 0; i < n; i++) {
_W[i] = W[i];
}
if(!Vt) {
jsfeat.cache.put_buffer(W_buff);
return;
}
for(i = 0; i < n1; i++) {
sd = i < n ? W[i] : 0;
while(sd <= minval) {
// if we got a zero singular value, then in order to get the corresponding left singular vector
// we generate a random vector, project it to the previously computed left singular vectors,
// subtract the projection and normalize the difference.
val0 = (1.0/m);
for(k = 0; k < m; k++) {
seed = (seed * 214013 + 2531011);
val = (((seed >> 16) & 0x7fff) & 256) != 0 ? val0 : -val0;
At[i*astep + k] = val;
}
for(iter = 0; iter < 2; iter++) {
for(j = 0; j < i; j++) {
sd = 0;
for(k = 0; k < m; k++) {
sd += At[i*astep + k]*At[j*astep + k];
}
asum = 0.0;
for(k = 0; k < m; k++) {
t = (At[i*astep + k] - sd*At[j*astep + k]);
At[i*astep + k] = t;
asum += Math.abs(t);
}
asum = asum ? 1.0/asum : 0;
for(k = 0; k < m; k++) {
At[i*astep + k] *= asum;
}
}
}
sd = 0;
for(k = 0; k < m; k++) {
t = At[i*astep + k];
sd += t*t;
}
sd = Math.sqrt(sd);
}
s = (1.0/sd);
for(k = 0; k < m; k++) {
At[i*astep + k] *= s;
}
}
jsfeat.cache.put_buffer(W_buff);
};
return {
lu_solve: function(A, B) {
var i=0,j=0,k=0,p=1,astep=A.cols;
var ad=A.data, bd=B.data;
var t,alpha,d,s;
for(i = 0; i < astep; i++) {
k = i;
for(j = i+1; j < astep; j++) {
if(Math.abs(ad[j*astep + i]) > Math.abs(ad[k*astep+i])) {
k = j;
}
}
if(Math.abs(ad[k*astep+i]) < jsfeat.EPSILON) {
return 0; // FAILED
}
if(k != i) {
for(j = i; j < astep; j++ ) {
swap(ad, i*astep+j, k*astep+j, t);
}
swap(bd, i, k, t);
p = -p;
}
d = -1.0/ad[i*astep+i];
for(j = i+1; j < astep; j++) {
alpha = ad[j*astep+i]*d;
for(k = i+1; k < astep; k++) {
ad[j*astep+k] += alpha*ad[i*astep+k];
}
bd[j] += alpha*bd[i];
}
ad[i*astep+i] = -d;
}
for(i = astep-1; i >= 0; i--) {
s = bd[i];
for(k = i+1; k < astep; k++) {
s -= ad[i*astep+k]*bd[k];
}
bd[i] = s*ad[i*astep+i];
}
return 1; // OK
},
cholesky_solve: function(A, B) {
var col=0,row=0,col2=0,cs=0,rs=0,i=0,j=0;
var size = A.cols;
var ad=A.data, bd=B.data;
var val,inv_diag;
for (col = 0; col < size; col++) {
inv_diag = 1.0;
cs = (col * size);
rs = cs;
for (row = col; row < size; row++)
{
// correct for the parts of cholesky already computed
val = ad[(rs+col)];
for (col2 = 0; col2 < col; col2++) {
val -= ad[(col2*size+col)] * ad[(rs+col2)];
}
if (row == col) {
// this is the diagonal element so don't divide
ad[(rs+col)] = val;
if(val == 0) {
return 0;
}
inv_diag = 1.0 / val;
} else {
// cache the value without division in the upper half
ad[(cs+row)] = val;
// divide my the diagonal element for all others
ad[(rs+col)] = val * inv_diag;
}
rs = (rs + size);
}
}
// first backsub through L
cs = 0;
for (i = 0; i < size; i++) {
val = bd[i];
for (j = 0; j < i; j++) {
val -= ad[(cs+j)] * bd[j];
}
bd[i] = val;
cs = (cs + size);
}
// backsub through diagonal
cs = 0;
for (i = 0; i < size; i++) {
bd[i] /= ad[(cs + i)];
cs = (cs + size);
}
// backsub through L Transpose
i = (size-1);
for (; i >= 0; i--) {
val = bd[i];
j = (i + 1);
cs = (j * size);
for (; j < size; j++) {
val -= ad[(cs + i)] * bd[j];
cs = (cs + size);
}
bd[i] = val;
}
return 1;
},
svd_decompose: function(A, W, U, V, options) {
if (typeof options === "undefined") { options = 0; }
var at=0,i=0,j=0,_m=A.rows,_n=A.cols,m=_m,n=_n;
var dt = A.type | jsfeat.C1_t; // we only work with single channel
if(m < n) {
at = 1;
i = m;
m = n;
n = i;
}
var a_buff = jsfeat.cache.get_buffer((m*m)<<3);
var w_buff = jsfeat.cache.get_buffer(n<<3);
var v_buff = jsfeat.cache.get_buffer((n*n)<<3);
var a_mt = new jsfeat.matrix_t(m, m, dt, a_buff.data);
var w_mt = new jsfeat.matrix_t(1, n, dt, w_buff.data);
var v_mt = new jsfeat.matrix_t(n, n, dt, v_buff.data);
if(at == 0) {
// transpose
jsfeat.matmath.transpose(a_mt, A);
} else {
for(i = 0; i < _n*_m; i++) {
a_mt.data[i] = A.data[i];
}
for(; i < n*m; i++) {
a_mt.data[i] = 0;
}
}
JacobiSVDImpl(a_mt.data, m, w_mt.data, v_mt.data, n, m, n, m);
if(W) {
for(i=0; i < n; i++) {
W.data[i] = w_mt.data[i];
}
for(; i < _n; i++) {
W.data[i] = 0;
}
}
if (at == 0) {
if(U && (options & jsfeat.SVD_U_T)) {
i = m*m;
while(--i >= 0) {
U.data[i] = a_mt.data[i];
}
} else if(U) {
jsfeat.matmath.transpose(U, a_mt);
}
if(V && (options & jsfeat.SVD_V_T)) {
i = n*n;
while(--i >= 0) {
V.data[i] = v_mt.data[i];
}
} else if(V) {
jsfeat.matmath.transpose(V, v_mt);
}
} else {
if(U && (options & jsfeat.SVD_U_T)) {
i = n*n;
while(--i >= 0) {
U.data[i] = v_mt.data[i];
}
} else if(U) {
jsfeat.matmath.transpose(U, v_mt);
}
if(V && (options & jsfeat.SVD_V_T)) {
i = m*m;
while(--i >= 0) {
V.data[i] = a_mt.data[i];
}
} else if(V) {
jsfeat.matmath.transpose(V, a_mt);
}
}
jsfeat.cache.put_buffer(a_buff);
jsfeat.cache.put_buffer(w_buff);
jsfeat.cache.put_buffer(v_buff);
},
svd_solve: function(A, X, B) {
var i=0,j=0,k=0;
var pu=0,pv=0;
var nrows=A.rows,ncols=A.cols;
var sum=0.0,xsum=0.0,tol=0.0;
var dt = A.type | jsfeat.C1_t;
var u_buff = jsfeat.cache.get_buffer((nrows*nrows)<<3);
var w_buff = jsfeat.cache.get_buffer(ncols<<3);
var v_buff = jsfeat.cache.get_buffer((ncols*ncols)<<3);
var u_mt = new jsfeat.matrix_t(nrows, nrows, dt, u_buff.data);
var w_mt = new jsfeat.matrix_t(1, ncols, dt, w_buff.data);
var v_mt = new jsfeat.matrix_t(ncols, ncols, dt, v_buff.data);
var bd = B.data, ud = u_mt.data, wd = w_mt.data, vd = v_mt.data;
this.svd_decompose(A, w_mt, u_mt, v_mt, 0);
tol = jsfeat.EPSILON * wd[0] * ncols;
for (; i < ncols; i++, pv += ncols) {
xsum = 0.0;
for(j = 0; j < ncols; j++) {
if(wd[j] > tol) {
for(k = 0, sum = 0.0, pu = 0; k < nrows; k++, pu += ncols) {
sum += ud[pu + j] * bd[k];
}
xsum += sum * vd[pv + j] / wd[j];
}
}
X.data[i] = xsum;
}
jsfeat.cache.put_buffer(u_buff);
jsfeat.cache.put_buffer(w_buff);
jsfeat.cache.put_buffer(v_buff);
},
svd_invert: function(Ai, A) {
var i=0,j=0,k=0;
var pu=0,pv=0,pa=0;
var nrows=A.rows,ncols=A.cols;
var sum=0.0,tol=0.0;
var dt = A.type | jsfeat.C1_t;
var u_buff = jsfeat.cache.get_buffer((nrows*nrows)<<3);
var w_buff = jsfeat.cache.get_buffer(ncols<<3);
var v_buff = jsfeat.cache.get_buffer((ncols*ncols)<<3);
var u_mt = new jsfeat.matrix_t(nrows, nrows, dt, u_buff.data);
var w_mt = new jsfeat.matrix_t(1, ncols, dt, w_buff.data);
var v_mt = new jsfeat.matrix_t(ncols, ncols, dt, v_buff.data);
var id = Ai.data, ud = u_mt.data, wd = w_mt.data, vd = v_mt.data;
this.svd_decompose(A, w_mt, u_mt, v_mt, 0);
tol = jsfeat.EPSILON * wd[0] * ncols;
for (; i < ncols; i++, pv += ncols) {
for (j = 0, pu = 0; j < nrows; j++, pa++) {
for (k = 0, sum = 0.0; k < ncols; k++, pu++) {
if (wd[k] > tol) sum += vd[pv + k] * ud[pu] / wd[k];
}
id[pa] = sum;
}
}
jsfeat.cache.put_buffer(u_buff);
jsfeat.cache.put_buffer(w_buff);
jsfeat.cache.put_buffer(v_buff);
},
eigenVV: function(A, vects, vals) {
var n=A.cols,i=n*n;
var dt = A.type | jsfeat.C1_t;
var a_buff = jsfeat.cache.get_buffer((n*n)<<3);
var w_buff = jsfeat.cache.get_buffer(n<<3);
var a_mt = new jsfeat.matrix_t(n, n, dt, a_buff.data);
var w_mt = new jsfeat.matrix_t(1, n, dt, w_buff.data);
while(--i >= 0) {
a_mt.data[i] = A.data[i];
}
JacobiImpl(a_mt.data, n, w_mt.data, vects ? vects.data : null, n, n);
if(vals) {
while(--n >= 0) {
vals.data[n] = w_mt.data[n];
}
}
jsfeat.cache.put_buffer(a_buff);
jsfeat.cache.put_buffer(w_buff);
}
};
})();
global.linalg = linalg;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*
*/
(function(global) {
"use strict";
//
var motion_model = (function() {
var sqr = function(x) {
return x*x;
};
// does isotropic normalization
var iso_normalize_points = function(from, to, T0, T1, count) {
var i=0;
var cx0=0.0, cy0=0.0, d0=0.0, s0=0.0;
var cx1=0.0, cy1=0.0, d1=0.0, s1=0.0;
var dx=0.0,dy=0.0;
for (; i < count; ++i) {
cx0 += from[i].x;
cy0 += from[i].y;
cx1 += to[i].x;
cy1 += to[i].y;
}
cx0 /= count; cy0 /= count;
cx1 /= count; cy1 /= count;
for (i = 0; i < count; ++i) {
dx = from[i].x - cx0;
dy = from[i].y - cy0;
d0 += Math.sqrt(dx*dx + dy*dy);
dx = to[i].x - cx1;
dy = to[i].y - cy1;
d1 += Math.sqrt(dx*dx + dy*dy);
}
d0 /= count; d1 /= count;
s0 = Math.SQRT2 / d0; s1 = Math.SQRT2 / d1;
T0[0] = T0[4] = s0;
T0[2] = -cx0*s0;
T0[5] = -cy0*s0;
T0[1] = T0[3] = T0[6] = T0[7] = 0.0;
T0[8] = 1.0;
T1[0] = T1[4] = s1;
T1[2] = -cx1*s1;
T1[5] = -cy1*s1;
T1[1] = T1[3] = T1[6] = T1[7] = 0.0;
T1[8] = 1.0;
};
var have_collinear_points = function(points, count) {
var j=0,k=0,i=(count-1)|0;
var dx1=0.0,dy1=0.0,dx2=0.0,dy2=0.0;
// check that the i-th selected point does not belong
// to a line connecting some previously selected points
for(; j < i; ++j) {
dx1 = points[j].x - points[i].x;
dy1 = points[j].y - points[i].y;
for(k = 0; k < j; ++k) {
dx2 = points[k].x - points[i].x;
dy2 = points[k].y - points[i].y;
if( Math.abs(dx2*dy1 - dy2*dx1) <= jsfeat.EPSILON*(Math.abs(dx1) + Math.abs(dy1) + Math.abs(dx2) + Math.abs(dy2)))
return true;
}
}
return false;
};
var T0 = new jsfeat.matrix_t(3, 3, jsfeat.F32_t|jsfeat.C1_t);
var T1 = new jsfeat.matrix_t(3, 3, jsfeat.F32_t|jsfeat.C1_t);
var AtA = new jsfeat.matrix_t(6, 6, jsfeat.F32_t|jsfeat.C1_t);
var AtB = new jsfeat.matrix_t(6, 1, jsfeat.F32_t|jsfeat.C1_t);
var affine2d = (function () {
function affine2d() {
// empty constructor
}
affine2d.prototype.run = function(from, to, model, count) {
var i=0,j=0;
var dt=model.type|jsfeat.C1_t;
var md=model.data, t0d=T0.data, t1d=T1.data;
var pt0,pt1,px=0.0,py=0.0;
iso_normalize_points(from, to, t0d, t1d, count);
var a_buff = jsfeat.cache.get_buffer((2*count*6)<<3);
var b_buff = jsfeat.cache.get_buffer((2*count)<<3);
var a_mt = new jsfeat.matrix_t(6, 2*count, dt, a_buff.data);
var b_mt = new jsfeat.matrix_t(1, 2*count, dt, b_buff.data);
var ad=a_mt.data, bd=b_mt.data;
for (; i < count; ++i) {
pt0 = from[i];
pt1 = to[i];
px = t0d[0]*pt0.x + t0d[1]*pt0.y + t0d[2];
py = t0d[3]*pt0.x + t0d[4]*pt0.y + t0d[5];
j = i*2*6;
ad[j]=px, ad[j+1]=py, ad[j+2]=1.0, ad[j+3]=0.0, ad[j+4]=0.0, ad[j+5]=0.0;
j += 6;
ad[j]=0.0, ad[j+1]=0.0, ad[j+2]=0.0, ad[j+3]=px, ad[j+4]=py, ad[j+5]=1.0;
bd[i<<1] = t1d[0]*pt1.x + t1d[1]*pt1.y + t1d[2];
bd[(i<<1)+1] = t1d[3]*pt1.x + t1d[4]*pt1.y + t1d[5];
}
jsfeat.matmath.multiply_AtA(AtA, a_mt);
jsfeat.matmath.multiply_AtB(AtB, a_mt, b_mt);
jsfeat.linalg.lu_solve(AtA, AtB);
md[0] = AtB.data[0], md[1]=AtB.data[1], md[2]=AtB.data[2];
md[3] = AtB.data[3], md[4]=AtB.data[4], md[5]=AtB.data[5];
md[6] = 0.0, md[7] = 0.0, md[8] = 1.0; // fill last row
// denormalize
jsfeat.matmath.invert_3x3(T1, T1);
jsfeat.matmath.multiply_3x3(model, T1, model);
jsfeat.matmath.multiply_3x3(model, model, T0);
// free buffer
jsfeat.cache.put_buffer(a_buff);
jsfeat.cache.put_buffer(b_buff);
return 1;
};
affine2d.prototype.error = function(from, to, model, err, count) {
var i=0;
var pt0,pt1;
var m=model.data;
for (; i < count; ++i) {
pt0 = from[i];
pt1 = to[i];
err[i] = sqr(pt1.x - m[0]*pt0.x - m[1]*pt0.y - m[2]) +
sqr(pt1.y - m[3]*pt0.x - m[4]*pt0.y - m[5]);
}
};
affine2d.prototype.check_subset = function(from, to, count) {
return true; // all good
};
return affine2d;
})();
var mLtL = new jsfeat.matrix_t(9, 9, jsfeat.F32_t|jsfeat.C1_t);
var Evec = new jsfeat.matrix_t(9, 9, jsfeat.F32_t|jsfeat.C1_t);
var homography2d = (function () {
function homography2d() {
// empty constructor
//this.T0 = new jsfeat.matrix_t(3, 3, jsfeat.F32_t|jsfeat.C1_t);
//this.T1 = new jsfeat.matrix_t(3, 3, jsfeat.F32_t|jsfeat.C1_t);
//this.mLtL = new jsfeat.matrix_t(9, 9, jsfeat.F32_t|jsfeat.C1_t);
//this.Evec = new jsfeat.matrix_t(9, 9, jsfeat.F32_t|jsfeat.C1_t);
}
homography2d.prototype.run = function(from, to, model, count) {
var i=0,j=0;
var md=model.data, t0d=T0.data, t1d=T1.data;
var LtL=mLtL.data, evd=Evec.data;
var x=0.0,y=0.0,X=0.0,Y=0.0;
// norm
var smx=0.0, smy=0.0, cmx=0.0, cmy=0.0, sMx=0.0, sMy=0.0, cMx=0.0, cMy=0.0;
for(; i < count; ++i) {
cmx += to[i].x;
cmy += to[i].y;
cMx += from[i].x;
cMy += from[i].y;
}
cmx /= count; cmy /= count;
cMx /= count; cMy /= count;
for(i = 0; i < count; ++i)
{
smx += Math.abs(to[i].x - cmx);
smy += Math.abs(to[i].y - cmy);
sMx += Math.abs(from[i].x - cMx);
sMy += Math.abs(from[i].y - cMy);
}
if( Math.abs(smx) < jsfeat.EPSILON
|| Math.abs(smy) < jsfeat.EPSILON
|| Math.abs(sMx) < jsfeat.EPSILON
|| Math.abs(sMy) < jsfeat.EPSILON ) return 0;
smx = count/smx; smy = count/smy;
sMx = count/sMx; sMy = count/sMy;
t0d[0] = sMx; t0d[1] = 0; t0d[2] = -cMx*sMx;
t0d[3] = 0; t0d[4] = sMy; t0d[5] = -cMy*sMy;
t0d[6] = 0; t0d[7] = 0; t0d[8] = 1;
t1d[0] = 1.0/smx; t1d[1] = 0; t1d[2] = cmx;
t1d[3] = 0; t1d[4] = 1.0/smy; t1d[5] = cmy;
t1d[6] = 0; t1d[7] = 0; t1d[8] = 1;
//
// construct system
i = 81;
while(--i >= 0) {
LtL[i] = 0.0;
}
for(i = 0; i < count; ++i) {
x = (to[i].x - cmx) * smx;
y = (to[i].y - cmy) * smy;
X = (from[i].x - cMx) * sMx;
Y = (from[i].y - cMy) * sMy;
LtL[0] += X*X;
LtL[1] += X*Y;
LtL[2] += X;
LtL[6] += X*-x*X;
LtL[7] += X*-x*Y;
LtL[8] += X*-x;
LtL[10] += Y*Y;
LtL[11] += Y;
LtL[15] += Y*-x*X;
LtL[16] += Y*-x*Y;
LtL[17] += Y*-x;
LtL[20] += 1.0;
LtL[24] += -x*X;
LtL[25] += -x*Y;
LtL[26] += -x;
LtL[30] += X*X;
LtL[31] += X*Y;
LtL[32] += X;
LtL[33] += X*-y*X;
LtL[34] += X*-y*Y;
LtL[35] += X*-y;
LtL[40] += Y*Y;
LtL[41] += Y;
LtL[42] += Y*-y*X;
LtL[43] += Y*-y*Y;
LtL[44] += Y*-y;
LtL[50] += 1.0;
LtL[51] += -y*X;
LtL[52] += -y*Y;
LtL[53] += -y;
LtL[60] += -x*X*-x*X + -y*X*-y*X;
LtL[61] += -x*X*-x*Y + -y*X*-y*Y;
LtL[62] += -x*X*-x + -y*X*-y;
LtL[70] += -x*Y*-x*Y + -y*Y*-y*Y;
LtL[71] += -x*Y*-x + -y*Y*-y;
LtL[80] += -x*-x + -y*-y;
}
//
// symmetry
for(i = 0; i < 9; ++i) {
for(j = 0; j < i; ++j)
LtL[i*9+j] = LtL[j*9+i];
}
jsfeat.linalg.eigenVV(mLtL, Evec);
md[0]=evd[72], md[1]=evd[73], md[2]=evd[74];
md[3]=evd[75], md[4]=evd[76], md[5]=evd[77];
md[6]=evd[78], md[7]=evd[79], md[8]=evd[80];
// denormalize
jsfeat.matmath.multiply_3x3(model, T1, model);
jsfeat.matmath.multiply_3x3(model, model, T0);
// set bottom right to 1.0
x = 1.0/md[8];
md[0] *= x; md[1] *= x; md[2] *= x;
md[3] *= x; md[4] *= x; md[5] *= x;
md[6] *= x; md[7] *= x; md[8] = 1.0;
return 1;
};
homography2d.prototype.error = function(from, to, model, err, count) {
var i=0;
var pt0,pt1,ww=0.0,dx=0.0,dy=0.0;
var m=model.data;
for (; i < count; ++i) {
pt0 = from[i];
pt1 = to[i];
ww = 1.0/(m[6]*pt0.x + m[7]*pt0.y + 1.0);
dx = (m[0]*pt0.x + m[1]*pt0.y + m[2])*ww - pt1.x;
dy = (m[3]*pt0.x + m[4]*pt0.y + m[5])*ww - pt1.y;
err[i] = (dx*dx + dy*dy);
}
};
homography2d.prototype.check_subset = function(from, to, count) {
// seems to reject good subsets actually
//if( have_collinear_points(from, count) || have_collinear_points(to, count) ) {
//return false;
//}
if( count == 4 ) {
var negative = 0;
var fp0=from[0],fp1=from[1],fp2=from[2],fp3=from[3];
var tp0=to[0],tp1=to[1],tp2=to[2],tp3=to[3];
// set1
var A11=fp0.x, A12=fp0.y, A13=1.0;
var A21=fp1.x, A22=fp1.y, A23=1.0;
var A31=fp2.x, A32=fp2.y, A33=1.0;
var B11=tp0.x, B12=tp0.y, B13=1.0;
var B21=tp1.x, B22=tp1.y, B23=1.0;
var B31=tp2.x, B32=tp2.y, B33=1.0;
var detA = jsfeat.matmath.determinant_3x3(A11,A12,A13, A21,A22,A23, A31,A32,A33);
var detB = jsfeat.matmath.determinant_3x3(B11,B12,B13, B21,B22,B23, B31,B32,B33);
if(detA*detB < 0) negative++;
// set2
A11=fp1.x, A12=fp1.y;
A21=fp2.x, A22=fp2.y;
A31=fp3.x, A32=fp3.y;
B11=tp1.x, B12=tp1.y;
B21=tp2.x, B22=tp2.y;
B31=tp3.x, B32=tp3.y;
detA = jsfeat.matmath.determinant_3x3(A11,A12,A13, A21,A22,A23, A31,A32,A33);
detB = jsfeat.matmath.determinant_3x3(B11,B12,B13, B21,B22,B23, B31,B32,B33);
if(detA*detB < 0) negative++;
// set3
A11=fp0.x, A12=fp0.y;
A21=fp2.x, A22=fp2.y;
A31=fp3.x, A32=fp3.y;
B11=tp0.x, B12=tp0.y;
B21=tp2.x, B22=tp2.y;
B31=tp3.x, B32=tp3.y;
detA = jsfeat.matmath.determinant_3x3(A11,A12,A13, A21,A22,A23, A31,A32,A33);
detB = jsfeat.matmath.determinant_3x3(B11,B12,B13, B21,B22,B23, B31,B32,B33);
if(detA*detB < 0) negative++;
// set4
A11=fp0.x, A12=fp0.y;
A21=fp1.x, A22=fp1.y;
A31=fp3.x, A32=fp3.y;
B11=tp0.x, B12=tp0.y;
B21=tp1.x, B22=tp1.y;
B31=tp3.x, B32=tp3.y;
detA = jsfeat.matmath.determinant_3x3(A11,A12,A13, A21,A22,A23, A31,A32,A33);
detB = jsfeat.matmath.determinant_3x3(B11,B12,B13, B21,B22,B23, B31,B32,B33);
if(detA*detB < 0) negative++;
if(negative != 0 && negative != 4) {
return false;
}
}
return true; // all good
};
return homography2d;
})();
return {
affine2d:affine2d,
homography2d:homography2d
};
})();
var ransac_params_t = (function () {
function ransac_params_t(size, thresh, eps, prob) {
if (typeof size === "undefined") { size=0; }
if (typeof thresh === "undefined") { thresh=0.5; }
if (typeof eps === "undefined") { eps=0.5; }
if (typeof prob === "undefined") { prob=0.99; }
this.size = size;
this.thresh = thresh;
this.eps = eps;
this.prob = prob;
}
ransac_params_t.prototype.update_iters = function(_eps, max_iters) {
var num = Math.log(1 - this.prob);
var denom = Math.log(1 - Math.pow(1 - _eps, this.size));
return (denom >= 0 || -num >= max_iters*(-denom) ? max_iters : Math.round(num/denom))|0;
};
return ransac_params_t;
})();
var motion_estimator = (function() {
var get_subset = function(kernel, from, to, need_cnt, max_cnt, from_sub, to_sub) {
var max_try = 1000;
var indices = [];
var i=0, j=0, ssiter=0, idx_i=0, ok=false;
for(; ssiter < max_try; ++ssiter) {
i = 0;
for (; i < need_cnt && ssiter < max_try;) {
ok = false;
idx_i = 0;
while (!ok) {
ok = true;
idx_i = indices[i] = Math.floor(Math.random() * max_cnt)|0;
for (j = 0; j < i; ++j) {
if (idx_i == indices[j])
{ ok = false; break; }
}
}
from_sub[i] = from[idx_i];
to_sub[i] = to[idx_i];
if( !kernel.check_subset( from_sub, to_sub, i+1 ) ) {
ssiter++;
continue;
}
++i;
}
break;
}
return (i == need_cnt && ssiter < max_try);
};
var find_inliers = function(kernel, model, from, to, count, thresh, err, mask) {
var numinliers = 0, i=0, f=0;
var t = thresh*thresh;
kernel.error(from, to, model, err, count);
for(; i < count; ++i) {
f = err[i] <= t;
mask[i] = f;
numinliers += f;
}
return numinliers;
};
return {
ransac: function(params, kernel, from, to, count, model, mask, max_iters) {
if (typeof max_iters === "undefined") { max_iters=1000; }
if(count < params.size) return false;
var model_points = params.size;
var niters = max_iters, iter=0;
var result = false;
var subset0 = [];
var subset1 = [];
var found = false;
var mc=model.cols,mr=model.rows;
var dt = model.type | jsfeat.C1_t;
var m_buff = jsfeat.cache.get_buffer((mc*mr)<<3);
var ms_buff = jsfeat.cache.get_buffer(count);
var err_buff = jsfeat.cache.get_buffer(count<<2);
var M = new jsfeat.matrix_t(mc, mr, dt, m_buff.data);
var curr_mask = new jsfeat.matrix_t(count, 1, jsfeat.U8C1_t, ms_buff.data);
var inliers_max = -1, numinliers=0;
var nmodels = 0;
var err = err_buff.f32;
// special case
if(count == model_points) {
if(kernel.run(from, to, M, count) <= 0) {
jsfeat.cache.put_buffer(m_buff);
jsfeat.cache.put_buffer(ms_buff);
jsfeat.cache.put_buffer(err_buff);
return false;
}
M.copy_to(model);
if(mask) {
while(--count >= 0) {
mask.data[count] = 1;
}
}
jsfeat.cache.put_buffer(m_buff);
jsfeat.cache.put_buffer(ms_buff);
jsfeat.cache.put_buffer(err_buff);
return true;
}
for (; iter < niters; ++iter) {
// generate subset
found = get_subset(kernel, from, to, model_points, count, subset0, subset1);
if(!found) {
if(iter == 0) {
jsfeat.cache.put_buffer(m_buff);
jsfeat.cache.put_buffer(ms_buff);
jsfeat.cache.put_buffer(err_buff);
return false;
}
break;
}
nmodels = kernel.run( subset0, subset1, M, model_points );
if(nmodels <= 0)
continue;
// TODO handle multimodel output
numinliers = find_inliers(kernel, M, from, to, count, params.thresh, err, curr_mask.data);
if( numinliers > Math.max(inliers_max, model_points-1) ) {
M.copy_to(model);
inliers_max = numinliers;
if(mask) curr_mask.copy_to(mask);
niters = params.update_iters((count - numinliers)/count, niters);
result = true;
}
}
jsfeat.cache.put_buffer(m_buff);
jsfeat.cache.put_buffer(ms_buff);
jsfeat.cache.put_buffer(err_buff);
return result;
},
lmeds: function(params, kernel, from, to, count, model, mask, max_iters) {
if (typeof max_iters === "undefined") { max_iters=1000; }
if(count < params.size) return false;
var model_points = params.size;
var niters = max_iters, iter=0;
var result = false;
var subset0 = [];
var subset1 = [];
var found = false;
var mc=model.cols,mr=model.rows;
var dt = model.type | jsfeat.C1_t;
var m_buff = jsfeat.cache.get_buffer((mc*mr)<<3);
var ms_buff = jsfeat.cache.get_buffer(count);
var err_buff = jsfeat.cache.get_buffer(count<<2);
var M = new jsfeat.matrix_t(mc, mr, dt, m_buff.data);
var curr_mask = new jsfeat.matrix_t(count, 1, jsfeat.U8_t|jsfeat.C1_t, ms_buff.data);
var numinliers=0;
var nmodels = 0;
var err = err_buff.f32;
var min_median = 1000000000.0, sigma=0.0, median=0.0;
params.eps = 0.45;
niters = params.update_iters(params.eps, niters);
// special case
if(count == model_points) {
if(kernel.run(from, to, M, count) <= 0) {
jsfeat.cache.put_buffer(m_buff);
jsfeat.cache.put_buffer(ms_buff);
jsfeat.cache.put_buffer(err_buff);
return false;
}
M.copy_to(model);
if(mask) {
while(--count >= 0) {
mask.data[count] = 1;
}
}
jsfeat.cache.put_buffer(m_buff);
jsfeat.cache.put_buffer(ms_buff);
jsfeat.cache.put_buffer(err_buff);
return true;
}
for (; iter < niters; ++iter) {
// generate subset
found = get_subset(kernel, from, to, model_points, count, subset0, subset1);
if(!found) {
if(iter == 0) {
jsfeat.cache.put_buffer(m_buff);
jsfeat.cache.put_buffer(ms_buff);
jsfeat.cache.put_buffer(err_buff);
return false;
}
break;
}
nmodels = kernel.run( subset0, subset1, M, model_points );
if(nmodels <= 0)
continue;
// TODO handle multimodel output
kernel.error(from, to, M, err, count);
median = jsfeat.math.median(err, 0, count-1);
if(median < min_median) {
min_median = median;
M.copy_to(model);
result = true;
}
}
if(result) {
sigma = 2.5*1.4826*(1 + 5.0/(count - model_points))*Math.sqrt(min_median);
sigma = Math.max(sigma, 0.001);
numinliers = find_inliers(kernel, model, from, to, count, sigma, err, curr_mask.data);
if(mask) curr_mask.copy_to(mask);
result = numinliers >= model_points;
}
jsfeat.cache.put_buffer(m_buff);
jsfeat.cache.put_buffer(ms_buff);
jsfeat.cache.put_buffer(err_buff);
return result;
}
};
})();
global.ransac_params_t = ransac_params_t;
global.motion_model = motion_model;
global.motion_estimator = motion_estimator;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*/
(function(global) {
"use strict";
//
var imgproc = (function() {
var _resample_u8 = function(src, dst, nw, nh) {
var xofs_count=0;
var ch=src.channel,w=src.cols,h=src.rows;
var src_d=src.data,dst_d=dst.data;
var scale_x = w / nw, scale_y = h / nh;
var inv_scale_256 = (scale_x * scale_y * 0x10000)|0;
var dx=0,dy=0,sx=0,sy=0,sx1=0,sx2=0,i=0,k=0,fsx1=0.0,fsx2=0.0;
var a=0,b=0,dxn=0,alpha=0,beta=0,beta1=0;
var buf_node = jsfeat.cache.get_buffer((nw*ch)<<2);
var sum_node = jsfeat.cache.get_buffer((nw*ch)<<2);
var xofs_node = jsfeat.cache.get_buffer((w*2*3)<<2);
var buf = buf_node.i32;
var sum = sum_node.i32;
var xofs = xofs_node.i32;
for (; dx < nw; dx++) {
fsx1 = dx * scale_x, fsx2 = fsx1 + scale_x;
sx1 = (fsx1 + 1.0 - 1e-6)|0, sx2 = fsx2|0;
sx1 = Math.min(sx1, w - 1);
sx2 = Math.min(sx2, w - 1);
if(sx1 > fsx1) {
xofs[k++] = (dx * ch)|0;
xofs[k++] = ((sx1 - 1)*ch)|0;
xofs[k++] = ((sx1 - fsx1) * 0x100)|0;
xofs_count++;
}
for(sx = sx1; sx < sx2; sx++){
xofs_count++;
xofs[k++] = (dx * ch)|0;
xofs[k++] = (sx * ch)|0;
xofs[k++] = 256;
}
if(fsx2 - sx2 > 1e-3) {
xofs_count++;
xofs[k++] = (dx * ch)|0;
xofs[k++] = (sx2 * ch)|0;
xofs[k++] = ((fsx2 - sx2) * 256)|0;
}
}
for (dx = 0; dx < nw * ch; dx++) {
buf[dx] = sum[dx] = 0;
}
dy = 0;
for (sy = 0; sy < h; sy++) {
a = w * sy;
for (k = 0; k < xofs_count; k++) {
dxn = xofs[k*3];
sx1 = xofs[k*3+1];
alpha = xofs[k*3+2];
for (i = 0; i < ch; i++) {
buf[dxn + i] += src_d[a+sx1+i] * alpha;
}
}
if ((dy + 1) * scale_y <= sy + 1 || sy == h - 1) {
beta = (Math.max(sy + 1 - (dy + 1) * scale_y, 0.0) * 256)|0;
beta1 = 256 - beta;
b = nw * dy;
if (beta <= 0) {
for (dx = 0; dx < nw * ch; dx++) {
dst_d[b+dx] = Math.min(Math.max((sum[dx] + buf[dx] * 256) / inv_scale_256, 0), 255);
sum[dx] = buf[dx] = 0;
}
} else {
for (dx = 0; dx < nw * ch; dx++) {
dst_d[b+dx] = Math.min(Math.max((sum[dx] + buf[dx] * beta1) / inv_scale_256, 0), 255);
sum[dx] = buf[dx] * beta;
buf[dx] = 0;
}
}
dy++;
} else {
for(dx = 0; dx < nw * ch; dx++) {
sum[dx] += buf[dx] * 256;
buf[dx] = 0;
}
}
}
jsfeat.cache.put_buffer(sum_node);
jsfeat.cache.put_buffer(buf_node);
jsfeat.cache.put_buffer(xofs_node);
};
var _resample = function(src, dst, nw, nh) {
var xofs_count=0;
var ch=src.channel,w=src.cols,h=src.rows;
var src_d=src.data,dst_d=dst.data;
var scale_x = w / nw, scale_y = h / nh;
var scale = 1.0 / (scale_x * scale_y);
var dx=0,dy=0,sx=0,sy=0,sx1=0,sx2=0,i=0,k=0,fsx1=0.0,fsx2=0.0;
var a=0,b=0,dxn=0,alpha=0.0,beta=0.0,beta1=0.0;
var buf_node = jsfeat.cache.get_buffer((nw*ch)<<2);
var sum_node = jsfeat.cache.get_buffer((nw*ch)<<2);
var xofs_node = jsfeat.cache.get_buffer((w*2*3)<<2);
var buf = buf_node.f32;
var sum = sum_node.f32;
var xofs = xofs_node.f32;
for (; dx < nw; dx++) {
fsx1 = dx * scale_x, fsx2 = fsx1 + scale_x;
sx1 = (fsx1 + 1.0 - 1e-6)|0, sx2 = fsx2|0;
sx1 = Math.min(sx1, w - 1);
sx2 = Math.min(sx2, w - 1);
if(sx1 > fsx1) {
xofs_count++;
xofs[k++] = ((sx1 - 1)*ch)|0;
xofs[k++] = (dx * ch)|0;
xofs[k++] = (sx1 - fsx1) * scale;
}
for(sx = sx1; sx < sx2; sx++){
xofs_count++;
xofs[k++] = (sx * ch)|0;
xofs[k++] = (dx * ch)|0;
xofs[k++] = scale;
}
if(fsx2 - sx2 > 1e-3) {
xofs_count++;
xofs[k++] = (sx2 * ch)|0;
xofs[k++] = (dx * ch)|0;
xofs[k++] = (fsx2 - sx2) * scale;
}
}
for (dx = 0; dx < nw * ch; dx++) {
buf[dx] = sum[dx] = 0;
}
dy = 0;
for (sy = 0; sy < h; sy++) {
a = w * sy;
for (k = 0; k < xofs_count; k++) {
sx1 = xofs[k*3]|0;
dxn = xofs[k*3+1]|0;
alpha = xofs[k*3+2];
for (i = 0; i < ch; i++) {
buf[dxn + i] += src_d[a+sx1+i] * alpha;
}
}
if ((dy + 1) * scale_y <= sy + 1 || sy == h - 1) {
beta = Math.max(sy + 1 - (dy + 1) * scale_y, 0.0);
beta1 = 1.0 - beta;
b = nw * dy;
if (Math.abs(beta) < 1e-3) {
for (dx = 0; dx < nw * ch; dx++) {
dst_d[b+dx] = sum[dx] + buf[dx];
sum[dx] = buf[dx] = 0;
}
} else {
for (dx = 0; dx < nw * ch; dx++) {
dst_d[b+dx] = sum[dx] + buf[dx] * beta1;
sum[dx] = buf[dx] * beta;
buf[dx] = 0;
}
}
dy++;
} else {
for(dx = 0; dx < nw * ch; dx++) {
sum[dx] += buf[dx];
buf[dx] = 0;
}
}
}
jsfeat.cache.put_buffer(sum_node);
jsfeat.cache.put_buffer(buf_node);
jsfeat.cache.put_buffer(xofs_node);
};
var _convol_u8 = function(buf, src_d, dst_d, w, h, filter, kernel_size, half_kernel) {
var i=0,j=0,k=0,sp=0,dp=0,sum=0,sum1=0,sum2=0,sum3=0,f0=filter[0],fk=0;
var w2=w<<1,w3=w*3,w4=w<<2;
// hor pass
for (; i < h; ++i) {
sum = src_d[sp];
for (j = 0; j < half_kernel; ++j) {
buf[j] = sum;
}
for (j = 0; j <= w-2; j+=2) {
buf[j + half_kernel] = src_d[sp+j];
buf[j + half_kernel+1] = src_d[sp+j+1];
}
for (; j < w; ++j) {
buf[j + half_kernel] = src_d[sp+j];
}
sum = src_d[sp+w-1];
for (j = w; j < half_kernel + w; ++j) {
buf[j + half_kernel] = sum;
}
for (j = 0; j <= w-4; j+=4) {
sum = buf[j] * f0,
sum1 = buf[j+1] * f0,
sum2 = buf[j+2] * f0,
sum3 = buf[j+3] * f0;
for (k = 1; k < kernel_size; ++k) {
fk = filter[k];
sum += buf[k + j] * fk;
sum1 += buf[k + j+1] * fk;
sum2 += buf[k + j+2] * fk;
sum3 += buf[k + j+3] * fk;
}
dst_d[dp+j] = Math.min(sum >> 8, 255);
dst_d[dp+j+1] = Math.min(sum1 >> 8, 255);
dst_d[dp+j+2] = Math.min(sum2 >> 8, 255);
dst_d[dp+j+3] = Math.min(sum3 >> 8, 255);
}
for (; j < w; ++j) {
sum = buf[j] * f0;
for (k = 1; k < kernel_size; ++k) {
sum += buf[k + j] * filter[k];
}
dst_d[dp+j] = Math.min(sum >> 8, 255);
}
sp += w;
dp += w;
}
// vert pass
for (i = 0; i < w; ++i) {
sum = dst_d[i];
for (j = 0; j < half_kernel; ++j) {
buf[j] = sum;
}
k = i;
for (j = 0; j <= h-2; j+=2, k+=w2) {
buf[j+half_kernel] = dst_d[k];
buf[j+half_kernel+1] = dst_d[k+w];
}
for (; j < h; ++j, k+=w) {
buf[j+half_kernel] = dst_d[k];
}
sum = dst_d[(h-1)*w + i];
for (j = h; j < half_kernel + h; ++j) {
buf[j + half_kernel] = sum;
}
dp = i;
for (j = 0; j <= h-4; j+=4, dp+=w4) {
sum = buf[j] * f0,
sum1 = buf[j+1] * f0,
sum2 = buf[j+2] * f0,
sum3 = buf[j+3] * f0;
for (k = 1; k < kernel_size; ++k) {
fk = filter[k];
sum += buf[k + j] * fk;
sum1 += buf[k + j+1] * fk;
sum2 += buf[k + j+2] * fk;
sum3 += buf[k + j+3] * fk;
}
dst_d[dp] = Math.min(sum >> 8, 255);
dst_d[dp+w] = Math.min(sum1 >> 8, 255);
dst_d[dp+w2] = Math.min(sum2 >> 8, 255);
dst_d[dp+w3] = Math.min(sum3 >> 8, 255);
}
for (; j < h; ++j, dp+=w) {
sum = buf[j] * f0;
for (k = 1; k < kernel_size; ++k) {
sum += buf[k + j] * filter[k];
}
dst_d[dp] = Math.min(sum >> 8, 255);
}
}
};
var _convol = function(buf, src_d, dst_d, w, h, filter, kernel_size, half_kernel) {
var i=0,j=0,k=0,sp=0,dp=0,sum=0.0,sum1=0.0,sum2=0.0,sum3=0.0,f0=filter[0],fk=0.0;
var w2=w<<1,w3=w*3,w4=w<<2;
// hor pass
for (; i < h; ++i) {
sum = src_d[sp];
for (j = 0; j < half_kernel; ++j) {
buf[j] = sum;
}
for (j = 0; j <= w-2; j+=2) {
buf[j + half_kernel] = src_d[sp+j];
buf[j + half_kernel+1] = src_d[sp+j+1];
}
for (; j < w; ++j) {
buf[j + half_kernel] = src_d[sp+j];
}
sum = src_d[sp+w-1];
for (j = w; j < half_kernel + w; ++j) {
buf[j + half_kernel] = sum;
}
for (j = 0; j <= w-4; j+=4) {
sum = buf[j] * f0,
sum1 = buf[j+1] * f0,
sum2 = buf[j+2] * f0,
sum3 = buf[j+3] * f0;
for (k = 1; k < kernel_size; ++k) {
fk = filter[k];
sum += buf[k + j] * fk;
sum1 += buf[k + j+1] * fk;
sum2 += buf[k + j+2] * fk;
sum3 += buf[k + j+3] * fk;
}
dst_d[dp+j] = sum;
dst_d[dp+j+1] = sum1;
dst_d[dp+j+2] = sum2;
dst_d[dp+j+3] = sum3;
}
for (; j < w; ++j) {
sum = buf[j] * f0;
for (k = 1; k < kernel_size; ++k) {
sum += buf[k + j] * filter[k];
}
dst_d[dp+j] = sum;
}
sp += w;
dp += w;
}
// vert pass
for (i = 0; i < w; ++i) {
sum = dst_d[i];
for (j = 0; j < half_kernel; ++j) {
buf[j] = sum;
}
k = i;
for (j = 0; j <= h-2; j+=2, k+=w2) {
buf[j+half_kernel] = dst_d[k];
buf[j+half_kernel+1] = dst_d[k+w];
}
for (; j < h; ++j, k+=w) {
buf[j+half_kernel] = dst_d[k];
}
sum = dst_d[(h-1)*w + i];
for (j = h; j < half_kernel + h; ++j) {
buf[j + half_kernel] = sum;
}
dp = i;
for (j = 0; j <= h-4; j+=4, dp+=w4) {
sum = buf[j] * f0,
sum1 = buf[j+1] * f0,
sum2 = buf[j+2] * f0,
sum3 = buf[j+3] * f0;
for (k = 1; k < kernel_size; ++k) {
fk = filter[k];
sum += buf[k + j] * fk;
sum1 += buf[k + j+1] * fk;
sum2 += buf[k + j+2] * fk;
sum3 += buf[k + j+3] * fk;
}
dst_d[dp] = sum;
dst_d[dp+w] = sum1;
dst_d[dp+w2] = sum2;
dst_d[dp+w3] = sum3;
}
for (; j < h; ++j, dp+=w) {
sum = buf[j] * f0;
for (k = 1; k < kernel_size; ++k) {
sum += buf[k + j] * filter[k];
}
dst_d[dp] = sum;
}
}
};
return {
// TODO: add support for RGB/BGR order
// for raw arrays
grayscale: function(src, w, h, dst, code) {
// this is default image data representation in browser
if (typeof code === "undefined") { code = jsfeat.COLOR_RGBA2GRAY; }
var x=0, y=0, i=0, j=0, ir=0,jr=0;
var coeff_r = 4899, coeff_g = 9617, coeff_b = 1868, cn = 4;
if(code == jsfeat.COLOR_BGRA2GRAY || code == jsfeat.COLOR_BGR2GRAY) {
coeff_r = 1868;
coeff_b = 4899;
}
if(code == jsfeat.COLOR_RGB2GRAY || code == jsfeat.COLOR_BGR2GRAY) {
cn = 3;
}
var cn2 = cn<<1, cn3 = (cn*3)|0;
dst.resize(w, h, 1);
var dst_u8 = dst.data;
for(y = 0; y < h; ++y, j+=w, i+=w*cn) {
for(x = 0, ir = i, jr = j; x <= w-4; x+=4, ir+=cn<<2, jr+=4) {
dst_u8[jr] = (src[ir] * coeff_r + src[ir+1] * coeff_g + src[ir+2] * coeff_b + 8192) >> 14;
dst_u8[jr + 1] = (src[ir+cn] * coeff_r + src[ir+cn+1] * coeff_g + src[ir+cn+2] * coeff_b + 8192) >> 14;
dst_u8[jr + 2] = (src[ir+cn2] * coeff_r + src[ir+cn2+1] * coeff_g + src[ir+cn2+2] * coeff_b + 8192) >> 14;
dst_u8[jr + 3] = (src[ir+cn3] * coeff_r + src[ir+cn3+1] * coeff_g + src[ir+cn3+2] * coeff_b + 8192) >> 14;
}
for (; x < w; ++x, ++jr, ir+=cn) {
dst_u8[jr] = (src[ir] * coeff_r + src[ir+1] * coeff_g + src[ir+2] * coeff_b + 8192) >> 14;
}
}
},
// derived from CCV library
resample: function(src, dst, nw, nh) {
var h=src.rows,w=src.cols;
if (h > nh && w > nw) {
dst.resize(nw, nh, src.channel);
// using the fast alternative (fix point scale, 0x100 to avoid overflow)
if (src.type&jsfeat.U8_t && dst.type&jsfeat.U8_t && h * w / (nh * nw) < 0x100) {
_resample_u8(src, dst, nw, nh);
} else {
_resample(src, dst, nw, nh);
}
}
},
box_blur_gray: function(src, dst, radius, options) {
if (typeof options === "undefined") { options = 0; }
var w=src.cols, h=src.rows, h2=h<<1, w2=w<<1;
var i=0,x=0,y=0,end=0;
var windowSize = ((radius << 1) + 1)|0;
var radiusPlusOne = (radius + 1)|0, radiusPlus2 = (radiusPlusOne+1)|0;
var scale = options&jsfeat.BOX_BLUR_NOSCALE ? 1 : (1.0 / (windowSize*windowSize));
var tmp_buff = jsfeat.cache.get_buffer((w*h)<<2);
var sum=0, dstIndex=0, srcIndex = 0, nextPixelIndex=0, previousPixelIndex=0;
var data_i32 = tmp_buff.i32; // to prevent overflow
var data_u8 = src.data;
var hold=0;
dst.resize(w, h, src.channel);
// first pass
// no need to scale
//data_u8 = src.data;
//data_i32 = tmp;
for (y = 0; y < h; ++y) {
dstIndex = y;
sum = radiusPlusOne * data_u8[srcIndex];
for(i = (srcIndex+1)|0, end=(srcIndex+radius)|0; i <= end; ++i) {
sum += data_u8[i];
}
nextPixelIndex = (srcIndex + radiusPlusOne)|0;
previousPixelIndex = srcIndex;
hold = data_u8[previousPixelIndex];
for(x = 0; x < radius; ++x, dstIndex += h) {
data_i32[dstIndex] = sum;
sum += data_u8[nextPixelIndex]- hold;
nextPixelIndex ++;
}
for(; x < w-radiusPlus2; x+=2, dstIndex += h2) {
data_i32[dstIndex] = sum;
sum += data_u8[nextPixelIndex]- data_u8[previousPixelIndex];
data_i32[dstIndex+h] = sum;
sum += data_u8[nextPixelIndex+1]- data_u8[previousPixelIndex+1];
nextPixelIndex +=2;
previousPixelIndex +=2;
}
for(; x < w-radiusPlusOne; ++x, dstIndex += h) {
data_i32[dstIndex] = sum;
sum += data_u8[nextPixelIndex]- data_u8[previousPixelIndex];
nextPixelIndex ++;
previousPixelIndex ++;
}
hold = data_u8[nextPixelIndex-1];
for(; x < w; ++x, dstIndex += h) {
data_i32[dstIndex] = sum;
sum += hold- data_u8[previousPixelIndex];
previousPixelIndex ++;
}
srcIndex += w;
}
//
// second pass
srcIndex = 0;
//data_i32 = tmp; // this is a transpose
data_u8 = dst.data;
// dont scale result
if(scale == 1) {
for (y = 0; y < w; ++y) {
dstIndex = y;
sum = radiusPlusOne * data_i32[srcIndex];
for(i = (srcIndex+1)|0, end=(srcIndex+radius)|0; i <= end; ++i) {
sum += data_i32[i];
}
nextPixelIndex = srcIndex + radiusPlusOne;
previousPixelIndex = srcIndex;
hold = data_i32[previousPixelIndex];
for(x = 0; x < radius; ++x, dstIndex += w) {
data_u8[dstIndex] = sum;
sum += data_i32[nextPixelIndex]- hold;
nextPixelIndex ++;
}
for(; x < h-radiusPlus2; x+=2, dstIndex += w2) {
data_u8[dstIndex] = sum;
sum += data_i32[nextPixelIndex]- data_i32[previousPixelIndex];
data_u8[dstIndex+w] = sum;
sum += data_i32[nextPixelIndex+1]- data_i32[previousPixelIndex+1];
nextPixelIndex +=2;
previousPixelIndex +=2;
}
for(; x < h-radiusPlusOne; ++x, dstIndex += w) {
data_u8[dstIndex] = sum;
sum += data_i32[nextPixelIndex]- data_i32[previousPixelIndex];
nextPixelIndex ++;
previousPixelIndex ++;
}
hold = data_i32[nextPixelIndex-1];
for(; x < h; ++x, dstIndex += w) {
data_u8[dstIndex] = sum;
sum += hold- data_i32[previousPixelIndex];
previousPixelIndex ++;
}
srcIndex += h;
}
} else {
for (y = 0; y < w; ++y) {
dstIndex = y;
sum = radiusPlusOne * data_i32[srcIndex];
for(i = (srcIndex+1)|0, end=(srcIndex+radius)|0; i <= end; ++i) {
sum += data_i32[i];
}
nextPixelIndex = srcIndex + radiusPlusOne;
previousPixelIndex = srcIndex;
hold = data_i32[previousPixelIndex];
for(x = 0; x < radius; ++x, dstIndex += w) {
data_u8[dstIndex] = sum*scale;
sum += data_i32[nextPixelIndex]- hold;
nextPixelIndex ++;
}
for(; x < h-radiusPlus2; x+=2, dstIndex += w2) {
data_u8[dstIndex] = sum*scale;
sum += data_i32[nextPixelIndex]- data_i32[previousPixelIndex];
data_u8[dstIndex+w] = sum*scale;
sum += data_i32[nextPixelIndex+1]- data_i32[previousPixelIndex+1];
nextPixelIndex +=2;
previousPixelIndex +=2;
}
for(; x < h-radiusPlusOne; ++x, dstIndex += w) {
data_u8[dstIndex] = sum*scale;
sum += data_i32[nextPixelIndex]- data_i32[previousPixelIndex];
nextPixelIndex ++;
previousPixelIndex ++;
}
hold = data_i32[nextPixelIndex-1];
for(; x < h; ++x, dstIndex += w) {
data_u8[dstIndex] = sum*scale;
sum += hold- data_i32[previousPixelIndex];
previousPixelIndex ++;
}
srcIndex += h;
}
}
jsfeat.cache.put_buffer(tmp_buff);
},
gaussian_blur: function(src, dst, kernel_size, sigma) {
if (typeof sigma === "undefined") { sigma = 0.0; }
if (typeof kernel_size === "undefined") { kernel_size = 0; }
kernel_size = kernel_size == 0 ? (Math.max(1, (4.0 * sigma + 1.0 - 1e-8)) * 2 + 1)|0 : kernel_size;
var half_kernel = kernel_size >> 1;
var w = src.cols, h = src.rows;
var data_type = src.type, is_u8 = data_type&jsfeat.U8_t;
dst.resize(w, h, src.channel);
var src_d = src.data, dst_d = dst.data;
var buf,filter,buf_sz=(kernel_size + Math.max(h, w))|0;
var buf_node = jsfeat.cache.get_buffer(buf_sz<<2);
var filt_node = jsfeat.cache.get_buffer(kernel_size<<2);
if(is_u8) {
buf = buf_node.i32;
filter = filt_node.i32;
} else if(data_type&jsfeat.S32_t) {
buf = buf_node.i32;
filter = filt_node.f32;
} else {
buf = buf_node.f32;
filter = filt_node.f32;
}
jsfeat.math.get_gaussian_kernel(kernel_size, sigma, filter, data_type);
if(is_u8) {
_convol_u8(buf, src_d, dst_d, w, h, filter, kernel_size, half_kernel);
} else {
_convol(buf, src_d, dst_d, w, h, filter, kernel_size, half_kernel);
}
jsfeat.cache.put_buffer(buf_node);
jsfeat.cache.put_buffer(filt_node);
},
hough_transform: function( img, rho_res, theta_res, threshold ) {
var image = img.data;
var width = img.cols;
var height = img.rows;
var step = width;
min_theta = 0.0;
max_theta = Math.PI;
numangle = Math.round((max_theta - min_theta) / theta_res);
numrho = Math.round(((width + height) * 2 + 1) / rho_res);
irho = 1.0 / rho_res;
var accum = new Int32Array((numangle+2) * (numrho+2)); //typed arrays are initialized to 0
var tabSin = new Float32Array(numangle);
var tabCos = new Float32Array(numangle);
var n=0;
var ang = min_theta;
for(; n < numangle; n++ ) {
tabSin[n] = Math.sin(ang) * irho;
tabCos[n] = Math.cos(ang) * irho;
ang += theta_res;
}
// stage 1. fill accumulator
for( var i = 0; i < height; i++ ) {
for( var j = 0; j < width; j++ ) {
if( image[i * step + j] != 0 ) {
//console.log(r, (n+1) * (numrho+2) + r+1, tabCos[n], tabSin[n]);
for(var n = 0; n < numangle; n++ ) {
var r = Math.round( j * tabCos[n] + i * tabSin[n] );
r += (numrho - 1) / 2;
accum[(n+1) * (numrho+2) + r+1] += 1;
}
}
}
}
// stage 2. find local maximums
//TODO: Consider making a vector class that uses typed arrays
_sort_buf = new Array();
for(var r = 0; r < numrho; r++ ) {
for(var n = 0; n < numangle; n++ ) {
var base = (n+1) * (numrho+2) + r+1;
if( accum[base] > threshold &&
accum[base] > accum[base - 1] && accum[base] >= accum[base + 1] &&
accum[base] > accum[base - numrho - 2] && accum[base] >= accum[base + numrho + 2] ) {
_sort_buf.push(base);
}
}
}
// stage 3. sort the detected lines by accumulator value
_sort_buf.sort(function(l1, l2) {
return accum[l1] > accum[l2] || (accum[l1] == accum[l2] && l1 < l2);
});
// stage 4. store the first min(total,linesMax) lines to the output buffer
linesMax = Math.min(numangle*numrho, _sort_buf.length);
scale = 1.0 / (numrho+2);
lines = new Array();
for( var i = 0; i < linesMax; i++ ) {
var idx = _sort_buf[i];
var n = Math.floor(idx*scale) - 1;
var r = idx - (n+1)*(numrho+2) - 1;
var lrho = (r - (numrho - 1)*0.5) * rho_res;
var langle = n * theta_res;
lines.push([lrho, langle]);
}
return lines;
},
// assume we always need it for u8 image
pyrdown: function(src, dst, sx, sy) {
// this is needed for bbf
if (typeof sx === "undefined") { sx = 0; }
if (typeof sy === "undefined") { sy = 0; }
var w = src.cols, h = src.rows;
var w2 = w >> 1, h2 = h >> 1;
var _w2 = w2 - (sx << 1), _h2 = h2 - (sy << 1);
var x=0,y=0,sptr=sx+sy*w,sline=0,dptr=0,dline=0;
dst.resize(w2, h2, src.channel);
var src_d = src.data, dst_d = dst.data;
for(y = 0; y < _h2; ++y) {
sline = sptr;
dline = dptr;
for(x = 0; x <= _w2-2; x+=2, dline+=2, sline += 4) {
dst_d[dline] = (src_d[sline] + src_d[sline+1] +
src_d[sline+w] + src_d[sline+w+1] + 2) >> 2;
dst_d[dline+1] = (src_d[sline+2] + src_d[sline+3] +
src_d[sline+w+2] + src_d[sline+w+3] + 2) >> 2;
}
for(; x < _w2; ++x, ++dline, sline += 2) {
dst_d[dline] = (src_d[sline] + src_d[sline+1] +
src_d[sline+w] + src_d[sline+w+1] + 2) >> 2;
}
sptr += w << 1;
dptr += w2;
}
},
// dst: [gx,gy,...]
scharr_derivatives: function(src, dst) {
var w = src.cols, h = src.rows;
var dstep = w<<1,x=0,y=0,x1=0,a,b,c,d,e,f;
var srow0=0,srow1=0,srow2=0,drow=0;
var trow0,trow1;
dst.resize(w, h, 2); // 2 channel output gx, gy
var img = src.data, gxgy=dst.data;
var buf0_node = jsfeat.cache.get_buffer((w+2)<<2);
var buf1_node = jsfeat.cache.get_buffer((w+2)<<2);
if(src.type&jsfeat.U8_t || src.type&jsfeat.S32_t) {
trow0 = buf0_node.i32;
trow1 = buf1_node.i32;
} else {
trow0 = buf0_node.f32;
trow1 = buf1_node.f32;
}
for(; y < h; ++y, srow1+=w) {
srow0 = ((y > 0 ? y-1 : 1)*w)|0;
srow2 = ((y < h-1 ? y+1 : h-2)*w)|0;
drow = (y*dstep)|0;
// do vertical convolution
for(x = 0, x1 = 1; x <= w-2; x+=2, x1+=2) {
a = img[srow0+x], b = img[srow2+x];
trow0[x1] = ( (a + b)*3 + (img[srow1+x])*10 );
trow1[x1] = ( b - a );
//
a = img[srow0+x+1], b = img[srow2+x+1];
trow0[x1+1] = ( (a + b)*3 + (img[srow1+x+1])*10 );
trow1[x1+1] = ( b - a );
}
for(; x < w; ++x, ++x1) {
a = img[srow0+x], b = img[srow2+x];
trow0[x1] = ( (a + b)*3 + (img[srow1+x])*10 );
trow1[x1] = ( b - a );
}
// make border
x = (w + 1)|0;
trow0[0] = trow0[1]; trow0[x] = trow0[w];
trow1[0] = trow1[1]; trow1[x] = trow1[w];
// do horizontal convolution, interleave the results and store them
for(x = 0; x <= w-4; x+=4) {
a = trow1[x+2], b = trow1[x+1], c = trow1[x+3], d = trow1[x+4],
e = trow0[x+2], f = trow0[x+3];
gxgy[drow++] = ( e - trow0[x] );
gxgy[drow++] = ( (a + trow1[x])*3 + b*10 );
gxgy[drow++] = ( f - trow0[x+1] );
gxgy[drow++] = ( (c + b)*3 + a*10 );
gxgy[drow++] = ( (trow0[x+4] - e) );
gxgy[drow++] = ( ((d + a)*3 + c*10) );
gxgy[drow++] = ( (trow0[x+5] - f) );
gxgy[drow++] = ( ((trow1[x+5] + c)*3 + d*10) );
}
for(; x < w; ++x) {
gxgy[drow++] = ( (trow0[x+2] - trow0[x]) );
gxgy[drow++] = ( ((trow1[x+2] + trow1[x])*3 + trow1[x+1]*10) );
}
}
jsfeat.cache.put_buffer(buf0_node);
jsfeat.cache.put_buffer(buf1_node);
},
// compute gradient using Sobel kernel [1 2 1] * [-1 0 1]^T
// dst: [gx,gy,...]
sobel_derivatives: function(src, dst) {
var w = src.cols, h = src.rows;
var dstep = w<<1,x=0,y=0,x1=0,a,b,c,d,e,f;
var srow0=0,srow1=0,srow2=0,drow=0;
var trow0,trow1;
dst.resize(w, h, 2); // 2 channel output gx, gy
var img = src.data, gxgy=dst.data;
var buf0_node = jsfeat.cache.get_buffer((w+2)<<2);
var buf1_node = jsfeat.cache.get_buffer((w+2)<<2);
if(src.type&jsfeat.U8_t || src.type&jsfeat.S32_t) {
trow0 = buf0_node.i32;
trow1 = buf1_node.i32;
} else {
trow0 = buf0_node.f32;
trow1 = buf1_node.f32;
}
for(; y < h; ++y, srow1+=w) {
srow0 = ((y > 0 ? y-1 : 1)*w)|0;
srow2 = ((y < h-1 ? y+1 : h-2)*w)|0;
drow = (y*dstep)|0;
// do vertical convolution
for(x = 0, x1 = 1; x <= w-2; x+=2, x1+=2) {
a = img[srow0+x], b = img[srow2+x];
trow0[x1] = ( (a + b) + (img[srow1+x]*2) );
trow1[x1] = ( b - a );
//
a = img[srow0+x+1], b = img[srow2+x+1];
trow0[x1+1] = ( (a + b) + (img[srow1+x+1]*2) );
trow1[x1+1] = ( b - a );
}
for(; x < w; ++x, ++x1) {
a = img[srow0+x], b = img[srow2+x];
trow0[x1] = ( (a + b) + (img[srow1+x]*2) );
trow1[x1] = ( b - a );
}
// make border
x = (w + 1)|0;
trow0[0] = trow0[1]; trow0[x] = trow0[w];
trow1[0] = trow1[1]; trow1[x] = trow1[w];
// do horizontal convolution, interleave the results and store them
for(x = 0; x <= w-4; x+=4) {
a = trow1[x+2], b = trow1[x+1], c = trow1[x+3], d = trow1[x+4],
e = trow0[x+2], f = trow0[x+3];
gxgy[drow++] = ( e - trow0[x] );
gxgy[drow++] = ( a + trow1[x] + b*2 );
gxgy[drow++] = ( f - trow0[x+1] );
gxgy[drow++] = ( c + b + a*2 );
gxgy[drow++] = ( trow0[x+4] - e );
gxgy[drow++] = ( d + a + c*2 );
gxgy[drow++] = ( trow0[x+5] - f );
gxgy[drow++] = ( trow1[x+5] + c + d*2 );
}
for(; x < w; ++x) {
gxgy[drow++] = ( trow0[x+2] - trow0[x] );
gxgy[drow++] = ( trow1[x+2] + trow1[x] + trow1[x+1]*2 );
}
}
jsfeat.cache.put_buffer(buf0_node);
jsfeat.cache.put_buffer(buf1_node);
},
// please note:
// dst_(type) size should be cols = src.cols+1, rows = src.rows+1
compute_integral_image: function(src, dst_sum, dst_sqsum, dst_tilted) {
var w0=src.cols|0,h0=src.rows|0,src_d=src.data;
var w1=(w0+1)|0;
var s=0,s2=0,p=0,pup=0,i=0,j=0,v=0,k=0;
if(dst_sum && dst_sqsum) {
// fill first row with zeros
for(; i < w1; ++i) {
dst_sum[i] = 0, dst_sqsum[i] = 0;
}
p = (w1+1)|0, pup = 1;
for(i = 0, k = 0; i < h0; ++i, ++p, ++pup) {
s = s2 = 0;
for(j = 0; j <= w0-2; j+=2, k+=2, p+=2, pup+=2) {
v = src_d[k];
s += v, s2 += v*v;
dst_sum[p] = dst_sum[pup] + s;
dst_sqsum[p] = dst_sqsum[pup] + s2;
v = src_d[k+1];
s += v, s2 += v*v;
dst_sum[p+1] = dst_sum[pup+1] + s;
dst_sqsum[p+1] = dst_sqsum[pup+1] + s2;
}
for(; j < w0; ++j, ++k, ++p, ++pup) {
v = src_d[k];
s += v, s2 += v*v;
dst_sum[p] = dst_sum[pup] + s;
dst_sqsum[p] = dst_sqsum[pup] + s2;
}
}
} else if(dst_sum) {
// fill first row with zeros
for(; i < w1; ++i) {
dst_sum[i] = 0;
}
p = (w1+1)|0, pup = 1;
for(i = 0, k = 0; i < h0; ++i, ++p, ++pup) {
s = 0;
for(j = 0; j <= w0-2; j+=2, k+=2, p+=2, pup+=2) {
s += src_d[k];
dst_sum[p] = dst_sum[pup] + s;
s += src_d[k+1];
dst_sum[p+1] = dst_sum[pup+1] + s;
}
for(; j < w0; ++j, ++k, ++p, ++pup) {
s += src_d[k];
dst_sum[p] = dst_sum[pup] + s;
}
}
} else if(dst_sqsum) {
// fill first row with zeros
for(; i < w1; ++i) {
dst_sqsum[i] = 0;
}
p = (w1+1)|0, pup = 1;
for(i = 0, k = 0; i < h0; ++i, ++p, ++pup) {
s2 = 0;
for(j = 0; j <= w0-2; j+=2, k+=2, p+=2, pup+=2) {
v = src_d[k];
s2 += v*v;
dst_sqsum[p] = dst_sqsum[pup] + s2;
v = src_d[k+1];
s2 += v*v;
dst_sqsum[p+1] = dst_sqsum[pup+1] + s2;
}
for(; j < w0; ++j, ++k, ++p, ++pup) {
v = src_d[k];
s2 += v*v;
dst_sqsum[p] = dst_sqsum[pup] + s2;
}
}
}
if(dst_tilted) {
// fill first row with zeros
for(i = 0; i < w1; ++i) {
dst_tilted[i] = 0;
}
// diagonal
p = (w1+1)|0, pup = 0;
for(i = 0, k = 0; i < h0; ++i, ++p, ++pup) {
for(j = 0; j <= w0-2; j+=2, k+=2, p+=2, pup+=2) {
dst_tilted[p] = src_d[k] + dst_tilted[pup];
dst_tilted[p+1] = src_d[k+1] + dst_tilted[pup+1];
}
for(; j < w0; ++j, ++k, ++p, ++pup) {
dst_tilted[p] = src_d[k] + dst_tilted[pup];
}
}
// diagonal
p = (w1+w0)|0, pup = w0;
for(i = 0; i < h0; ++i, p+=w1, pup+=w1) {
dst_tilted[p] += dst_tilted[pup];
}
for(j = w0-1; j > 0; --j) {
p = j+h0*w1, pup=p-w1;
for(i = h0; i > 0; --i, p-=w1, pup-=w1) {
dst_tilted[p] += dst_tilted[pup] + dst_tilted[pup+1];
}
}
}
},
equalize_histogram: function(src, dst) {
var w=src.cols,h=src.rows,src_d=src.data;
dst.resize(w, h, src.channel);
var dst_d=dst.data,size=w*h;
var i=0,prev=0,hist0,norm;
var hist0_node = jsfeat.cache.get_buffer(256<<2);
hist0 = hist0_node.i32;
for(; i < 256; ++i) hist0[i] = 0;
for (i = 0; i < size; ++i) {
++hist0[src_d[i]];
}
prev = hist0[0];
for (i = 1; i < 256; ++i) {
prev = hist0[i] += prev;
}
norm = 255 / size;
for (i = 0; i < size; ++i) {
dst_d[i] = (hist0[src_d[i]] * norm + 0.5)|0;
}
jsfeat.cache.put_buffer(hist0_node);
},
canny: function(src, dst, low_thresh, high_thresh) {
var w=src.cols,h=src.rows,src_d=src.data;
dst.resize(w, h, src.channel);
var dst_d=dst.data;
var i=0,j=0,grad=0,w2=w<<1,_grad=0,suppress=0,f=0,x=0,y=0,s=0;
var tg22x=0,tg67x=0;
// cache buffers
var dxdy_node = jsfeat.cache.get_buffer((h * w2)<<2);
var buf_node = jsfeat.cache.get_buffer((3 * (w + 2))<<2);
var map_node = jsfeat.cache.get_buffer(((h+2) * (w + 2))<<2);
var stack_node = jsfeat.cache.get_buffer((h * w)<<2);
var buf = buf_node.i32;
var map = map_node.i32;
var stack = stack_node.i32;
var dxdy = dxdy_node.i32;
var dxdy_m = new jsfeat.matrix_t(w, h, jsfeat.S32C2_t, dxdy_node.data);
var row0=1,row1=(w+2+1)|0,row2=(2*(w+2)+1)|0,map_w=(w+2)|0,map_i=(map_w+1)|0,stack_i=0;
this.sobel_derivatives(src, dxdy_m);
if(low_thresh > high_thresh) {
i = low_thresh;
low_thresh = high_thresh;
high_thresh = i;
}
i = (3 * (w + 2))|0;
while(--i>=0) {
buf[i] = 0;
}
i = ((h+2) * (w + 2))|0;
while(--i>=0) {
map[i] = 0;
}
for (; j < w; ++j, grad+=2) {
//buf[row1+j] = Math.abs(dxdy[grad]) + Math.abs(dxdy[grad+1]);
x = dxdy[grad], y = dxdy[grad+1];
//buf[row1+j] = x*x + y*y;
buf[row1+j] = ((x ^ (x >> 31)) - (x >> 31)) + ((y ^ (y >> 31)) - (y >> 31));
}
for(i=1; i <= h; ++i, grad+=w2) {
if(i == h) {
j = row2+w;
while(--j>=row2) {
buf[j] = 0;
}
} else {
for (j = 0; j < w; j++) {
//buf[row2+j] = Math.abs(dxdy[grad+(j<<1)]) + Math.abs(dxdy[grad+(j<<1)+1]);
x = dxdy[grad+(j<<1)], y = dxdy[grad+(j<<1)+1];
//buf[row2+j] = x*x + y*y;
buf[row2+j] = ((x ^ (x >> 31)) - (x >> 31)) + ((y ^ (y >> 31)) - (y >> 31));
}
}
_grad = (grad - w2)|0;
map[map_i-1] = 0;
suppress = 0;
for(j = 0; j < w; ++j, _grad+=2) {
f = buf[row1+j];
if (f > low_thresh) {
x = dxdy[_grad];
y = dxdy[_grad+1];
s = x ^ y;
// seems ot be faster than Math.abs
x = ((x ^ (x >> 31)) - (x >> 31))|0;
y = ((y ^ (y >> 31)) - (y >> 31))|0;
//x * tan(22.5) x * tan(67.5) == 2 * x + x * tan(22.5)
tg22x = x * 13573;
tg67x = tg22x + ((x + x) << 15);
y <<= 15;
if (y < tg22x) {
if (f > buf[row1+j-1] && f >= buf[row1+j+1]) {
if (f > high_thresh && !suppress && map[map_i+j-map_w] != 2) {
map[map_i+j] = 2;
suppress = 1;
stack[stack_i++] = map_i + j;
} else {
map[map_i+j] = 1;
}
continue;
}
} else if (y > tg67x) {
if (f > buf[row0+j] && f >= buf[row2+j]) {
if (f > high_thresh && !suppress && map[map_i+j-map_w] != 2) {
map[map_i+j] = 2;
suppress = 1;
stack[stack_i++] = map_i + j;
} else {
map[map_i+j] = 1;
}
continue;
}
} else {
s = s < 0 ? -1 : 1;
if (f > buf[row0+j-s] && f > buf[row2+j+s]) {
if (f > high_thresh && !suppress && map[map_i+j-map_w] != 2) {
map[map_i+j] = 2;
suppress = 1;
stack[stack_i++] = map_i + j;
} else {
map[map_i+j] = 1;
}
continue;
}
}
}
map[map_i+j] = 0;
suppress = 0;
}
map[map_i+w] = 0;
map_i += map_w;
j = row0;
row0 = row1;
row1 = row2;
row2 = j;
}
j = map_i - map_w - 1;
for(i = 0; i < map_w; ++i, ++j) {
map[j] = 0;
}
// path following
while(stack_i > 0) {
map_i = stack[--stack_i];
map_i -= map_w+1;
if(map[map_i] == 1) map[map_i] = 2, stack[stack_i++] = map_i;
map_i += 1;
if(map[map_i] == 1) map[map_i] = 2, stack[stack_i++] = map_i;
map_i += 1;
if(map[map_i] == 1) map[map_i] = 2, stack[stack_i++] = map_i;
map_i += map_w;
if(map[map_i] == 1) map[map_i] = 2, stack[stack_i++] = map_i;
map_i -= 2;
if(map[map_i] == 1) map[map_i] = 2, stack[stack_i++] = map_i;
map_i += map_w;
if(map[map_i] == 1) map[map_i] = 2, stack[stack_i++] = map_i;
map_i += 1;
if(map[map_i] == 1) map[map_i] = 2, stack[stack_i++] = map_i;
map_i += 1;
if(map[map_i] == 1) map[map_i] = 2, stack[stack_i++] = map_i;
}
map_i = map_w + 1;
row0 = 0;
for(i = 0; i < h; ++i, map_i+=map_w) {
for(j = 0; j < w; ++j) {
dst_d[row0++] = (map[map_i+j] == 2) * 0xff;
}
}
// free buffers
jsfeat.cache.put_buffer(dxdy_node);
jsfeat.cache.put_buffer(buf_node);
jsfeat.cache.put_buffer(map_node);
jsfeat.cache.put_buffer(stack_node);
},
// transform is 3x3 matrix_t
warp_perspective: function(src, dst, transform, fill_value) {
if (typeof fill_value === "undefined") { fill_value = 0; }
var src_width=src.cols|0, src_height=src.rows|0, dst_width=dst.cols|0, dst_height=dst.rows|0;
var src_d=src.data, dst_d=dst.data;
var x=0,y=0,off=0,ixs=0,iys=0,xs=0.0,ys=0.0,xs0=0.0,ys0=0.0,ws=0.0,sc=0.0,a=0.0,b=0.0,p0=0.0,p1=0.0;
var td=transform.data;
var m00=td[0],m01=td[1],m02=td[2],
m10=td[3],m11=td[4],m12=td[5],
m20=td[6],m21=td[7],m22=td[8];
for(var dptr = 0; y < dst_height; ++y) {
xs0 = m01 * y + m02,
ys0 = m11 * y + m12,
ws = m21 * y + m22;
for(x = 0; x < dst_width; ++x, ++dptr, xs0+=m00, ys0+=m10, ws+=m20) {
sc = 1.0 / ws;
xs = xs0 * sc, ys = ys0 * sc;
ixs = xs | 0, iys = ys | 0;
if(xs > 0 && ys > 0 && ixs < (src_width - 1) && iys < (src_height - 1)) {
a = Math.max(xs - ixs, 0.0);
b = Math.max(ys - iys, 0.0);
off = (src_width*iys + ixs)|0;
p0 = src_d[off] + a * (src_d[off+1] - src_d[off]);
p1 = src_d[off+src_width] + a * (src_d[off+src_width+1] - src_d[off+src_width]);
dst_d[dptr] = p0 + b * (p1 - p0);
}
else dst_d[dptr] = fill_value;
}
}
},
// transform is 3x3 or 2x3 matrix_t only first 6 values referenced
warp_affine: function(src, dst, transform, fill_value) {
if (typeof fill_value === "undefined") { fill_value = 0; }
var src_width=src.cols, src_height=src.rows, dst_width=dst.cols, dst_height=dst.rows;
var src_d=src.data, dst_d=dst.data;
var x=0,y=0,off=0,ixs=0,iys=0,xs=0.0,ys=0.0,a=0.0,b=0.0,p0=0.0,p1=0.0;
var td=transform.data;
var m00=td[0],m01=td[1],m02=td[2],
m10=td[3],m11=td[4],m12=td[5];
for(var dptr = 0; y < dst_height; ++y) {
xs = m01 * y + m02;
ys = m11 * y + m12;
for(x = 0; x < dst_width; ++x, ++dptr, xs+=m00, ys+=m10) {
ixs = xs | 0; iys = ys | 0;
if(ixs >= 0 && iys >= 0 && ixs < (src_width - 1) && iys < (src_height - 1)) {
a = xs - ixs;
b = ys - iys;
off = src_width*iys + ixs;
p0 = src_d[off] + a * (src_d[off+1] - src_d[off]);
p1 = src_d[off+src_width] + a * (src_d[off+src_width+1] - src_d[off+src_width]);
dst_d[dptr] = p0 + b * (p1 - p0);
}
else dst_d[dptr] = fill_value;
}
}
},
// Basic RGB Skin detection filter
// from http://popscan.blogspot.fr/2012/08/skin-detection-in-digital-images.html
skindetector: function(src,dst) {
var r,g,b,j;
var i = src.width*src.height;
while(i--){
j = i*4;
r = src.data[j];
g = src.data[j+1];
b = src.data[j+2];
if((r>95)&&(g>40)&&(b>20)
&&(r>g)&&(r>b)
&&(r-Math.min(g,b)>15)
&&(Math.abs(r-g)>15)){
dst[i] = 255;
} else {
dst[i] = 0;
}
}
}
};
})();
global.imgproc = imgproc;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*
* This is FAST corner detector, contributed to OpenCV by the author, Edward Rosten.
*/
/*
The references are:
* Machine learning for high-speed corner detection,
E. Rosten and T. Drummond, ECCV 2006
* Faster and better: A machine learning approach to corner detection
E. Rosten, R. Porter and T. Drummond, PAMI, 2009
*/
(function(global) {
"use strict";
//
var fast_corners = (function() {
var offsets16 = new Int32Array([0, 3, 1, 3, 2, 2, 3, 1, 3, 0, 3, -1, 2, -2, 1, -3, 0, -3, -1, -3, -2, -2, -3, -1, -3, 0, -3, 1, -2, 2, -1, 3]);
var threshold_tab = new Uint8Array(512);
var pixel_off = new Int32Array(25);
var score_diff = new Int32Array(25);
// private functions
var _cmp_offsets = function(pixel, step, pattern_size) {
var k = 0;
var offsets = offsets16;
for( ; k < pattern_size; ++k ) {
pixel[k] = offsets[k<<1] + offsets[(k<<1)+1] * step;
}
for( ; k < 25; ++k ) {
pixel[k] = pixel[k - pattern_size];
}
},
_cmp_score_16 = function(src, off, pixel, d, threshold) {
var N = 25, k = 0, v = src[off];
var a0 = threshold,a=0,b0=0,b=0;
for( ; k < N; ++k ) {
d[k] = v - src[off+pixel[k]];
}
for( k = 0; k < 16; k += 2 ) {
a = Math.min(d[k+1], d[k+2]);
a = Math.min(a, d[k+3]);
if( a <= a0 ) continue;
a = Math.min(a, d[k+4]);
a = Math.min(a, d[k+5]);
a = Math.min(a, d[k+6]);
a = Math.min(a, d[k+7]);
a = Math.min(a, d[k+8]);
a0 = Math.max(a0, Math.min(a, d[k]));
a0 = Math.max(a0, Math.min(a, d[k+9]));
}
b0 = -a0;
for( k = 0; k < 16; k += 2 ) {
b = Math.max(d[k+1], d[k+2]);
b = Math.max(b, d[k+3]);
b = Math.max(b, d[k+4]);
b = Math.max(b, d[k+5]);
if( b >= b0 ) continue;
b = Math.max(b, d[k+6]);
b = Math.max(b, d[k+7]);
b = Math.max(b, d[k+8]);
b0 = Math.min(b0, Math.max(b, d[k]));
b0 = Math.min(b0, Math.max(b, d[k+9]));
}
return -b0-1;
};
var _threshold = 20;
return {
set_threshold: function(threshold) {
_threshold = Math.min(Math.max(threshold, 0), 255);
for (var i = -255; i <= 255; ++i) {
threshold_tab[(i + 255)] = (i < -_threshold ? 1 : (i > _threshold ? 2 : 0));
}
return _threshold;
},
detect: function(src, corners, border) {
if (typeof border === "undefined") { border = 3; }
var K = 8, N = 25;
var img = src.data, w = src.cols, h = src.rows;
var i=0, j=0, k=0, vt=0, x=0, m3=0;
var buf_node = jsfeat.cache.get_buffer(3 * w);
var cpbuf_node = jsfeat.cache.get_buffer(((w+1)*3)<<2);
var buf = buf_node.u8;
var cpbuf = cpbuf_node.i32;
var pixel = pixel_off;
var sd = score_diff;
var sy = Math.max(3, border);
var ey = Math.min((h-2), (h-border));
var sx = Math.max(3, border);
var ex = Math.min((w - 3), (w - border));
var _count = 0, corners_cnt = 0, pt;
var score_func = _cmp_score_16;
var thresh_tab = threshold_tab;
var threshold = _threshold;
var v=0,tab=0,d=0,ncorners=0,cornerpos=0,curr=0,ptr=0,prev=0,pprev=0;
var jp1=0,jm1=0,score=0;
_cmp_offsets(pixel, w, 16);
// local vars are faster?
var pixel0 = pixel[0];
var pixel1 = pixel[1];
var pixel2 = pixel[2];
var pixel3 = pixel[3];
var pixel4 = pixel[4];
var pixel5 = pixel[5];
var pixel6 = pixel[6];
var pixel7 = pixel[7];
var pixel8 = pixel[8];
var pixel9 = pixel[9];
var pixel10 = pixel[10];
var pixel11 = pixel[11];
var pixel12 = pixel[12];
var pixel13 = pixel[13];
var pixel14 = pixel[14];
var pixel15 = pixel[15];
for(i = 0; i < w*3; ++i) {
buf[i] = 0;
}
for(i = sy; i < ey; ++i) {
ptr = ((i * w) + sx)|0;
m3 = (i - 3)%3;
curr = (m3*w)|0;
cornerpos = (m3*(w+1))|0;
for (j = 0; j < w; ++j) buf[curr+j] = 0;
ncorners = 0;
if( i < (ey - 1) ) {
j = sx;
for( ; j < ex; ++j, ++ptr ) {
v = img[ptr];
tab = ( - v + 255 );
d = ( thresh_tab[tab+img[ptr+pixel0]] | thresh_tab[tab+img[ptr+pixel8]] );
if( d == 0 ) {
continue;
}
d &= ( thresh_tab[tab+img[ptr+pixel2]] | thresh_tab[tab+img[ptr+pixel10]] );
d &= ( thresh_tab[tab+img[ptr+pixel4]] | thresh_tab[tab+img[ptr+pixel12]] );
d &= ( thresh_tab[tab+img[ptr+pixel6]] | thresh_tab[tab+img[ptr+pixel14]] );
if( d == 0 ) {
continue;
}
d &= ( thresh_tab[tab+img[ptr+pixel1]] | thresh_tab[tab+img[ptr+pixel9]] );
d &= ( thresh_tab[tab+img[ptr+pixel3]] | thresh_tab[tab+img[ptr+pixel11]] );
d &= ( thresh_tab[tab+img[ptr+pixel5]] | thresh_tab[tab+img[ptr+pixel13]] );
d &= ( thresh_tab[tab+img[ptr+pixel7]] | thresh_tab[tab+img[ptr+pixel15]] );
if( d & 1 ) {
vt = (v - threshold);
_count = 0;
for( k = 0; k < N; ++k ) {
x = img[(ptr+pixel[k])];
if(x < vt) {
++_count;
if( _count > K ) {
++ncorners;
cpbuf[cornerpos+ncorners] = j;
buf[curr+j] = score_func(img, ptr, pixel, sd, threshold);
break;
}
}
else {
_count = 0;
}
}
}
if( d & 2 ) {
vt = (v + threshold);
_count = 0;
for( k = 0; k < N; ++k ) {
x = img[(ptr+pixel[k])];
if(x > vt) {
++_count;
if( _count > K ) {
++ncorners;
cpbuf[cornerpos+ncorners] = j;
buf[curr+j] = score_func(img, ptr, pixel, sd, threshold);
break;
}
}
else {
_count = 0;
}
}
}
}
}
cpbuf[cornerpos+w] = ncorners;
if ( i == sy ) {
continue;
}
m3 = (i - 4 + 3)%3;
prev = (m3*w)|0;
cornerpos = (m3*(w+1))|0;
m3 = (i - 5 + 3)%3;
pprev = (m3*w)|0;
ncorners = cpbuf[cornerpos+w];
for( k = 0; k < ncorners; ++k ) {
j = cpbuf[cornerpos+k];
jp1 = (j+1)|0;
jm1 = (j-1)|0;
score = buf[prev+j];
if( (score > buf[prev+jp1] && score > buf[prev+jm1] &&
score > buf[pprev+jm1] && score > buf[pprev+j] && score > buf[pprev+jp1] &&
score > buf[curr+jm1] && score > buf[curr+j] && score > buf[curr+jp1]) ) {
// save corner
pt = corners[corners_cnt];
pt.x = j, pt.y = (i-1), pt.score = score;
corners_cnt++;
}
}
} // y loop
jsfeat.cache.put_buffer(buf_node);
jsfeat.cache.put_buffer(cpbuf_node);
return corners_cnt;
}
};
})();
global.fast_corners = fast_corners;
fast_corners.set_threshold(20); // set default
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*
* Copyright 2007 Computer Vision Lab,
* Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.
* @author Vincent Lepetit (http://cvlab.epfl.ch/~lepetit)
*/
(function(global) {
"use strict";
//
var yape06 = (function() {
var compute_laplacian = function(src, dst, w, h, Dxx, Dyy, sx,sy, ex,ey) {
var y=0,x=0,yrow=(sy*w+sx)|0,row=yrow;
for(y = sy; y < ey; ++y, yrow+=w, row = yrow) {
for(x = sx; x < ex; ++x, ++row) {
dst[row] = -4 * src[row] + src[row+Dxx] + src[row-Dxx] + src[row+Dyy] + src[row-Dyy];
}
}
};
var hessian_min_eigen_value = function(src, off, tr, Dxx, Dyy, Dxy, Dyx) {
var Ixx = -2 * src[off] + src[off + Dxx] + src[off - Dxx];
var Iyy = -2 * src[off] + src[off + Dyy] + src[off - Dyy];
var Ixy = src[off + Dxy] + src[off - Dxy] - src[off + Dyx] - src[off - Dyx];
var sqrt_delta = ( Math.sqrt(((Ixx - Iyy) * (Ixx - Iyy) + 4 * Ixy * Ixy) ) )|0;
return Math.min(Math.abs(tr - sqrt_delta), Math.abs(-(tr + sqrt_delta)));
};
return {
laplacian_threshold: 30,
min_eigen_value_threshold: 25,
detect: function(src, points, border) {
if (typeof border === "undefined") { border = 5; }
var x=0,y=0;
var w=src.cols, h=src.rows, srd_d=src.data;
var Dxx = 5, Dyy = (5 * w)|0;
var Dxy = (3 + 3 * w)|0, Dyx = (3 - 3 * w)|0;
var lap_buf = jsfeat.cache.get_buffer((w*h)<<2);
var laplacian = lap_buf.i32;
var lv=0, row=0,rowx=0,min_eigen_value=0,pt;
var number_of_points = 0;
var lap_thresh = this.laplacian_threshold;
var eigen_thresh = this.min_eigen_value_threshold;
var sx = Math.max(5, border)|0;
var sy = Math.max(3, border)|0;
var ex = Math.min(w-5, w-border)|0;
var ey = Math.min(h-3, h-border)|0;
x = w*h;
while(--x>=0) {laplacian[x]=0;}
compute_laplacian(srd_d, laplacian, w, h, Dxx, Dyy, sx,sy, ex,ey);
row = (sy*w+sx)|0;
for(y = sy; y < ey; ++y, row += w) {
for(x = sx, rowx=row; x < ex; ++x, ++rowx) {
lv = laplacian[rowx];
if ((lv < -lap_thresh &&
lv < laplacian[rowx - 1] && lv < laplacian[rowx + 1] &&
lv < laplacian[rowx - w] && lv < laplacian[rowx + w] &&
lv < laplacian[rowx - w - 1] && lv < laplacian[rowx + w - 1] &&
lv < laplacian[rowx - w + 1] && lv < laplacian[rowx + w + 1])
||
(lv > lap_thresh &&
lv > laplacian[rowx - 1] && lv > laplacian[rowx + 1] &&
lv > laplacian[rowx - w] && lv > laplacian[rowx + w] &&
lv > laplacian[rowx - w - 1] && lv > laplacian[rowx + w - 1] &&
lv > laplacian[rowx - w + 1] && lv > laplacian[rowx + w + 1])
) {
min_eigen_value = hessian_min_eigen_value(srd_d, rowx, lv, Dxx, Dyy, Dxy, Dyx);
if (min_eigen_value > eigen_thresh) {
pt = points[number_of_points];
pt.x = x, pt.y = y, pt.score = min_eigen_value;
++number_of_points;
++x, ++rowx; // skip next pixel since this is maxima in 3x3
}
}
}
}
jsfeat.cache.put_buffer(lap_buf);
return number_of_points;
}
};
})();
global.yape06 = yape06;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*
* Copyright 2007 Computer Vision Lab,
* Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.
*/
(function(global) {
"use strict";
//
var yape = (function() {
var precompute_directions = function(step, dirs, R) {
var i = 0;
var x, y;
x = R;
for(y = 0; y < x; y++, i++)
{
x = (Math.sqrt((R * R - y * y)) + 0.5)|0;
dirs[i] = (x + step * y);
}
for(x-- ; x < y && x >= 0; x--, i++)
{
y = (Math.sqrt((R * R - x * x)) + 0.5)|0;
dirs[i] = (x + step * y);
}
for( ; -x < y; x--, i++)
{
y = (Math.sqrt((R * R - x * x)) + 0.5)|0;
dirs[i] = (x + step * y);
}
for(y-- ; y >= 0; y--, i++)
{
x = (-Math.sqrt((R * R - y * y)) - 0.5)|0;
dirs[i] = (x + step * y);
}
for(; y > x; y--, i++)
{
x = (-Math.sqrt((R * R - y * y)) - 0.5)|0;
dirs[i] = (x + step * y);
}
for(x++ ; x <= 0; x++, i++)
{
y = (-Math.sqrt((R * R - x * x)) - 0.5)|0;
dirs[i] = (x + step * y);
}
for( ; x < -y; x++, i++)
{
y = (-Math.sqrt((R * R - x * x)) - 0.5)|0;
dirs[i] = (x + step * y);
}
for(y++ ; y < 0; y++, i++)
{
x = (Math.sqrt((R * R - y * y)) + 0.5)|0;
dirs[i] = (x + step * y);
}
dirs[i] = dirs[0];
dirs[i + 1] = dirs[1];
return i;
};
var third_check = function (Sb, off, step) {
var n = 0;
if(Sb[off+1] != 0) n++;
if(Sb[off-1] != 0) n++;
if(Sb[off+step] != 0) n++;
if(Sb[off+step+1] != 0) n++;
if(Sb[off+step-1] != 0) n++;
if(Sb[off-step] != 0) n++;
if(Sb[off-step+1] != 0) n++;
if(Sb[off-step-1] != 0) n++;
return n;
};
var is_local_maxima = function(p, off, v, step, neighborhood) {
var x, y;
if (v > 0) {
off -= step*neighborhood;
for (y= -neighborhood; y<=neighborhood; ++y) {
for (x= -neighborhood; x<=neighborhood; ++x) {
if (p[off+x] > v) return false;
}
off += step;
}
} else {
off -= step*neighborhood;
for (y= -neighborhood; y<=neighborhood; ++y) {
for (x= -neighborhood; x<=neighborhood; ++x) {
if (p[off+x] < v) return false;
}
off += step;
}
}
return true;
};
var perform_one_point = function(I, x, Scores, Im, Ip, dirs, opposite, dirs_nb) {
var score = 0;
var a = 0, b = (opposite - 1)|0;
var A=0, B0=0, B1=0, B2=0;
var state=0;
// WE KNOW THAT NOT(A ~ I0 & B1 ~ I0):
A = I[x+dirs[a]];
if ((A <= Ip)) {
if ((A >= Im)) { // A ~ I0
B0 = I[x+dirs[b]];
if ((B0 <= Ip)) {
if ((B0 >= Im)) { Scores[x] = 0; return; }
else {
b++; B1 = I[x+dirs[b]];
if ((B1 > Ip)) {
b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) state = 3;
else if ((B2 < Im)) state = 6;
else { Scores[x] = 0; return; } // A ~ I0, B2 ~ I0
}
else/* if ((B1 < Im))*/ {
b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) state = 7;
else if ((B2 < Im)) state = 2;
else { Scores[x] = 0; return; } // A ~ I0, B2 ~ I0
}
//else { Scores[x] = 0; return; } // A ~ I0, B1 ~ I0
}
}
else { // B0 < I0
b++; B1 = I[x+dirs[b]];
if ((B1 > Ip)) {
b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) state = 3;
else if ((B2 < Im)) state = 6;
else { Scores[x] = 0; return; } // A ~ I0, B2 ~ I0
}
else if ((B1 < Im)) {
b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) state = 7;
else if ((B2 < Im)) state = 2;
else { Scores[x] = 0; return; } // A ~ I0, B2 ~ I0
}
else { Scores[x] = 0; return; } // A ~ I0, B1 ~ I0
}
}
else { // A > I0
B0 = I[x+dirs[b]];
if ((B0 > Ip)) { Scores[x] = 0; return; }
b++; B1 = I[x+dirs[b]];
if ((B1 > Ip)) { Scores[x] = 0; return; }
b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) { Scores[x] = 0; return; }
state = 1;
}
}
else // A < I0
{
B0 = I[x+dirs[b]];
if ((B0 < Im)) { Scores[x] = 0; return; }
b++; B1 = I[x+dirs[b]];
if ((B1 < Im)) { Scores[x] = 0; return; }
b++; B2 = I[x+dirs[b]];
if ((B2 < Im)) { Scores[x] = 0; return; }
state = 0;
}
for(a = 1; a <= opposite; a++)
{
A = I[x+dirs[a]];
switch(state)
{
case 0:
if ((A > Ip)) {
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 < Im)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 0; break; }
}
if ((A < Im)) {
if ((B1 > Ip)) { Scores[x] = 0; return; }
if ((B2 > Ip)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 8; break; }
}
// A ~ I0
if ((B1 <= Ip)) { Scores[x] = 0; return; }
if ((B2 <= Ip)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) { score -= A + B1; state = 3; break; };
if ((B2 < Im)) { score -= A + B1; state = 6; break; };
{ Scores[x] = 0; return; }
case 1:
if ((A < Im)) {
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 1; break; }
}
if ((A > Ip)) {
if ((B1 < Im)) { Scores[x] = 0; return; }
if ((B2 < Im)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 < Im)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 9; break; }
}
// A ~ I0
if ((B1 >= Im)) { Scores[x] = 0; return; }
if ((B2 >= Im)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 < Im)) { score -= A + B1; state = 2; break; };
if ((B2 > Ip)) { score -= A + B1; state = 7; break; };
{ Scores[x] = 0; return; }
case 2:
if ((A > Ip)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((A < Im))
{
if ((B2 > Ip)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 4; break; }
}
// A ~ I0
if ((B2 > Ip)) { score -= A + B1; state = 7; break; };
if ((B2 < Im)) { score -= A + B1; state = 2; break; };
{ Scores[x] = 0; return; } // A ~ I0, B2 ~ I0
case 3:
if ((A < Im)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((A > Ip)) {
if ((B2 < Im)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 5; break; }
}
// A ~ I0
if ((B2 > Ip)) { score -= A + B1; state = 3; break; };
if ((B2 < Im)) { score -= A + B1; state = 6; break; };
{ Scores[x] = 0; return; }
case 4:
if ((A > Ip)) { Scores[x] = 0; return; }
if ((A < Im)) {
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 1; break; }
}
if ((B2 >= Im)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 < Im)) { score -= A + B1; state = 2; break; };
if ((B2 > Ip)) { score -= A + B1; state = 7; break; };
{ Scores[x] = 0; return; }
case 5:
if ((A < Im)) { Scores[x] = 0; return; }
if ((A > Ip)) {
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 < Im)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 0; break; }
}
// A ~ I0
if ((B2 <= Ip)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) { score -= A + B1; state = 3; break; };
if ((B2 < Im)) { score -= A + B1; state = 6; break; };
{ Scores[x] = 0; return; }
case 7:
if ((A > Ip)) { Scores[x] = 0; return; }
if ((A < Im)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
// A ~ I0
if ((B2 > Ip)) { score -= A + B1; state = 3; break; };
if ((B2 < Im)) { score -= A + B1; state = 6; break; };
{ Scores[x] = 0; return; } // A ~ I0, B2 ~ I0
case 6:
if ((A > Ip)) { Scores[x] = 0; return; }
if ((A < Im)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
// A ~ I0
if ((B2 < Im)) { score -= A + B1; state = 2; break; };
if ((B2 > Ip)) { score -= A + B1; state = 7; break; };
{ Scores[x] = 0; return; } // A ~ I0, B2 ~ I0
case 8:
if ((A > Ip)) {
if ((B2 < Im)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 < Im)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 9; break; }
}
if ((A < Im)) {
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 1; break; }
}
{ Scores[x] = 0; return; }
case 9:
if ((A < Im)) {
if ((B2 > Ip)) { Scores[x] = 0; return; }
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 > Ip)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 8; break; }
}
if ((A > Ip)) {
B1 = B2; b++; B2 = I[x+dirs[b]];
if ((B2 < Im)) { Scores[x] = 0; return; }
{ score -= A + B1; state = 0; break; }
}
{ Scores[x] = 0; return; }
default:
//"PB default";
break;
} // switch(state)
} // for(a...)
Scores[x] = (score + dirs_nb * I[x]);
};
var lev_table_t = (function () {
function lev_table_t(w, h, r) {
this.dirs = new Int32Array(1024);
this.dirs_count = precompute_directions(w, this.dirs, r)|0;
this.scores = new Int32Array(w*h);
this.radius = r|0;
}
return lev_table_t;
})();
return {
level_tables: [],
tau: 7,
init: function(width, height, radius, pyramid_levels) {
if (typeof pyramid_levels === "undefined") { pyramid_levels = 1; }
var i;
radius = Math.min(radius, 7);
radius = Math.max(radius, 3);
for(i = 0; i < pyramid_levels; ++i) {
this.level_tables[i] = new lev_table_t(width>>i, height>>i, radius);
}
},
detect: function(src, points, border) {
if (typeof border === "undefined") { border = 4; }
var t = this.level_tables[0];
var R = t.radius|0, Rm1 = (R-1)|0;
var dirs = t.dirs;
var dirs_count = t.dirs_count|0;
var opposite = dirs_count >> 1;
var img = src.data, w=src.cols|0, h=src.rows|0,hw=w>>1;
var scores = t.scores;
var x=0,y=0,row=0,rowx=0,ip=0,im=0,abs_score=0, score=0;
var tau = this.tau|0;
var number_of_points = 0, pt;
var sx = Math.max(R+1, border)|0;
var sy = Math.max(R+1, border)|0;
var ex = Math.min(w-R-2, w-border)|0;
var ey = Math.min(h-R-2, h-border)|0;
row = (sy*w+sx)|0;
for(y = sy; y < ey; ++y, row+=w) {
for(x = sx, rowx = row; x < ex; ++x, ++rowx) {
ip = img[rowx] + tau, im = img[rowx] - tau;
if (im<img[rowx+R] && img[rowx+R]<ip && im<img[rowx-R] && img[rowx-R]<ip) {
scores[rowx] = 0;
} else {
perform_one_point(img, rowx, scores, im, ip, dirs, opposite, dirs_count);
}
}
}
// local maxima
row = (sy*w+sx)|0;
for(y = sy; y < ey; ++y, row+=w) {
for(x = sx, rowx = row; x < ex; ++x, ++rowx) {
score = scores[rowx];
abs_score = Math.abs(score);
if(abs_score < 5) {
// if this pixel is 0, the next one will not be good enough. Skip it.
++x, ++rowx;
} else {
if(third_check(scores, rowx, w) >= 3 && is_local_maxima(scores, rowx, score, hw, R)) {
pt = points[number_of_points];
pt.x = x, pt.y = y, pt.score = abs_score;
++number_of_points;
x += Rm1, rowx += Rm1;
}
}
}
}
return number_of_points;
}
};
})();
global.yape = yape;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*
* Original implementation derived from OpenCV,
* @authors Ethan Rublee, Vincent Rabaud, Gary Bradski
*/
(function(global) {
"use strict";
//
var orb = (function() {
var bit_pattern_31_ = new Int32Array([
8,-3, 9,5/*mean (0), correlation (0)*/,
4,2, 7,-12/*mean (1.12461e-05), correlation (0.0437584)*/,
-11,9, -8,2/*mean (3.37382e-05), correlation (0.0617409)*/,
7,-12, 12,-13/*mean (5.62303e-05), correlation (0.0636977)*/,
2,-13, 2,12/*mean (0.000134953), correlation (0.085099)*/,
1,-7, 1,6/*mean (0.000528565), correlation (0.0857175)*/,
-2,-10, -2,-4/*mean (0.0188821), correlation (0.0985774)*/,
-13,-13, -11,-8/*mean (0.0363135), correlation (0.0899616)*/,
-13,-3, -12,-9/*mean (0.121806), correlation (0.099849)*/,
10,4, 11,9/*mean (0.122065), correlation (0.093285)*/,
-13,-8, -8,-9/*mean (0.162787), correlation (0.0942748)*/,
-11,7, -9,12/*mean (0.21561), correlation (0.0974438)*/,
7,7, 12,6/*mean (0.160583), correlation (0.130064)*/,
-4,-5, -3,0/*mean (0.228171), correlation (0.132998)*/,
-13,2, -12,-3/*mean (0.00997526), correlation (0.145926)*/,
-9,0, -7,5/*mean (0.198234), correlation (0.143636)*/,
12,-6, 12,-1/*mean (0.0676226), correlation (0.16689)*/,
-3,6, -2,12/*mean (0.166847), correlation (0.171682)*/,
-6,-13, -4,-8/*mean (0.101215), correlation (0.179716)*/,
11,-13, 12,-8/*mean (0.200641), correlation (0.192279)*/,
4,7, 5,1/*mean (0.205106), correlation (0.186848)*/,
5,-3, 10,-3/*mean (0.234908), correlation (0.192319)*/,
3,-7, 6,12/*mean (0.0709964), correlation (0.210872)*/,
-8,-7, -6,-2/*mean (0.0939834), correlation (0.212589)*/,
-2,11, -1,-10/*mean (0.127778), correlation (0.20866)*/,
-13,12, -8,10/*mean (0.14783), correlation (0.206356)*/,
-7,3, -5,-3/*mean (0.182141), correlation (0.198942)*/,
-4,2, -3,7/*mean (0.188237), correlation (0.21384)*/,
-10,-12, -6,11/*mean (0.14865), correlation (0.23571)*/,
5,-12, 6,-7/*mean (0.222312), correlation (0.23324)*/,
5,-6, 7,-1/*mean (0.229082), correlation (0.23389)*/,
1,0, 4,-5/*mean (0.241577), correlation (0.215286)*/,
9,11, 11,-13/*mean (0.00338507), correlation (0.251373)*/,
4,7, 4,12/*mean (0.131005), correlation (0.257622)*/,
2,-1, 4,4/*mean (0.152755), correlation (0.255205)*/,
-4,-12, -2,7/*mean (0.182771), correlation (0.244867)*/,
-8,-5, -7,-10/*mean (0.186898), correlation (0.23901)*/,
4,11, 9,12/*mean (0.226226), correlation (0.258255)*/,
0,-8, 1,-13/*mean (0.0897886), correlation (0.274827)*/,
-13,-2, -8,2/*mean (0.148774), correlation (0.28065)*/,
-3,-2, -2,3/*mean (0.153048), correlation (0.283063)*/,
-6,9, -4,-9/*mean (0.169523), correlation (0.278248)*/,
8,12, 10,7/*mean (0.225337), correlation (0.282851)*/,
0,9, 1,3/*mean (0.226687), correlation (0.278734)*/,
7,-5, 11,-10/*mean (0.00693882), correlation (0.305161)*/,
-13,-6, -11,0/*mean (0.0227283), correlation (0.300181)*/,
10,7, 12,1/*mean (0.125517), correlation (0.31089)*/,
-6,-3, -6,12/*mean (0.131748), correlation (0.312779)*/,
10,-9, 12,-4/*mean (0.144827), correlation (0.292797)*/,
-13,8, -8,-12/*mean (0.149202), correlation (0.308918)*/,
-13,0, -8,-4/*mean (0.160909), correlation (0.310013)*/,
3,3, 7,8/*mean (0.177755), correlation (0.309394)*/,
5,7, 10,-7/*mean (0.212337), correlation (0.310315)*/,
-1,7, 1,-12/*mean (0.214429), correlation (0.311933)*/,
3,-10, 5,6/*mean (0.235807), correlation (0.313104)*/,
2,-4, 3,-10/*mean (0.00494827), correlation (0.344948)*/,
-13,0, -13,5/*mean (0.0549145), correlation (0.344675)*/,
-13,-7, -12,12/*mean (0.103385), correlation (0.342715)*/,
-13,3, -11,8/*mean (0.134222), correlation (0.322922)*/,
-7,12, -4,7/*mean (0.153284), correlation (0.337061)*/,
6,-10, 12,8/*mean (0.154881), correlation (0.329257)*/,
-9,-1, -7,-6/*mean (0.200967), correlation (0.33312)*/,
-2,-5, 0,12/*mean (0.201518), correlation (0.340635)*/,
-12,5, -7,5/*mean (0.207805), correlation (0.335631)*/,
3,-10, 8,-13/*mean (0.224438), correlation (0.34504)*/,
-7,-7, -4,5/*mean (0.239361), correlation (0.338053)*/,
-3,-2, -1,-7/*mean (0.240744), correlation (0.344322)*/,
2,9, 5,-11/*mean (0.242949), correlation (0.34145)*/,
-11,-13, -5,-13/*mean (0.244028), correlation (0.336861)*/,
-1,6, 0,-1/*mean (0.247571), correlation (0.343684)*/,
5,-3, 5,2/*mean (0.000697256), correlation (0.357265)*/,
-4,-13, -4,12/*mean (0.00213675), correlation (0.373827)*/,
-9,-6, -9,6/*mean (0.0126856), correlation (0.373938)*/,
-12,-10, -8,-4/*mean (0.0152497), correlation (0.364237)*/,
10,2, 12,-3/*mean (0.0299933), correlation (0.345292)*/,
7,12, 12,12/*mean (0.0307242), correlation (0.366299)*/,
-7,-13, -6,5/*mean (0.0534975), correlation (0.368357)*/,
-4,9, -3,4/*mean (0.099865), correlation (0.372276)*/,
7,-1, 12,2/*mean (0.117083), correlation (0.364529)*/,
-7,6, -5,1/*mean (0.126125), correlation (0.369606)*/,
-13,11, -12,5/*mean (0.130364), correlation (0.358502)*/,
-3,7, -2,-6/*mean (0.131691), correlation (0.375531)*/,
7,-8, 12,-7/*mean (0.160166), correlation (0.379508)*/,
-13,-7, -11,-12/*mean (0.167848), correlation (0.353343)*/,
1,-3, 12,12/*mean (0.183378), correlation (0.371916)*/,
2,-6, 3,0/*mean (0.228711), correlation (0.371761)*/,
-4,3, -2,-13/*mean (0.247211), correlation (0.364063)*/,
-1,-13, 1,9/*mean (0.249325), correlation (0.378139)*/,
7,1, 8,-6/*mean (0.000652272), correlation (0.411682)*/,
1,-1, 3,12/*mean (0.00248538), correlation (0.392988)*/,
9,1, 12,6/*mean (0.0206815), correlation (0.386106)*/,
-1,-9, -1,3/*mean (0.0364485), correlation (0.410752)*/,
-13,-13, -10,5/*mean (0.0376068), correlation (0.398374)*/,
7,7, 10,12/*mean (0.0424202), correlation (0.405663)*/,
12,-5, 12,9/*mean (0.0942645), correlation (0.410422)*/,
6,3, 7,11/*mean (0.1074), correlation (0.413224)*/,
5,-13, 6,10/*mean (0.109256), correlation (0.408646)*/,
2,-12, 2,3/*mean (0.131691), correlation (0.416076)*/,
3,8, 4,-6/*mean (0.165081), correlation (0.417569)*/,
2,6, 12,-13/*mean (0.171874), correlation (0.408471)*/,
9,-12, 10,3/*mean (0.175146), correlation (0.41296)*/,
-8,4, -7,9/*mean (0.183682), correlation (0.402956)*/,
-11,12, -4,-6/*mean (0.184672), correlation (0.416125)*/,
1,12, 2,-8/*mean (0.191487), correlation (0.386696)*/,
6,-9, 7,-4/*mean (0.192668), correlation (0.394771)*/,
2,3, 3,-2/*mean (0.200157), correlation (0.408303)*/,
6,3, 11,0/*mean (0.204588), correlation (0.411762)*/,
3,-3, 8,-8/*mean (0.205904), correlation (0.416294)*/,
7,8, 9,3/*mean (0.213237), correlation (0.409306)*/,
-11,-5, -6,-4/*mean (0.243444), correlation (0.395069)*/,
-10,11, -5,10/*mean (0.247672), correlation (0.413392)*/,
-5,-8, -3,12/*mean (0.24774), correlation (0.411416)*/,
-10,5, -9,0/*mean (0.00213675), correlation (0.454003)*/,
8,-1, 12,-6/*mean (0.0293635), correlation (0.455368)*/,
4,-6, 6,-11/*mean (0.0404971), correlation (0.457393)*/,
-10,12, -8,7/*mean (0.0481107), correlation (0.448364)*/,
4,-2, 6,7/*mean (0.050641), correlation (0.455019)*/,
-2,0, -2,12/*mean (0.0525978), correlation (0.44338)*/,
-5,-8, -5,2/*mean (0.0629667), correlation (0.457096)*/,
7,-6, 10,12/*mean (0.0653846), correlation (0.445623)*/,
-9,-13, -8,-8/*mean (0.0858749), correlation (0.449789)*/,
-5,-13, -5,-2/*mean (0.122402), correlation (0.450201)*/,
8,-8, 9,-13/*mean (0.125416), correlation (0.453224)*/,
-9,-11, -9,0/*mean (0.130128), correlation (0.458724)*/,
1,-8, 1,-2/*mean (0.132467), correlation (0.440133)*/,
7,-4, 9,1/*mean (0.132692), correlation (0.454)*/,
-2,1, -1,-4/*mean (0.135695), correlation (0.455739)*/,
11,-6, 12,-11/*mean (0.142904), correlation (0.446114)*/,
-12,-9, -6,4/*mean (0.146165), correlation (0.451473)*/,
3,7, 7,12/*mean (0.147627), correlation (0.456643)*/,
5,5, 10,8/*mean (0.152901), correlation (0.455036)*/,
0,-4, 2,8/*mean (0.167083), correlation (0.459315)*/,
-9,12, -5,-13/*mean (0.173234), correlation (0.454706)*/,
0,7, 2,12/*mean (0.18312), correlation (0.433855)*/,
-1,2, 1,7/*mean (0.185504), correlation (0.443838)*/,
5,11, 7,-9/*mean (0.185706), correlation (0.451123)*/,
3,5, 6,-8/*mean (0.188968), correlation (0.455808)*/,
-13,-4, -8,9/*mean (0.191667), correlation (0.459128)*/,
-5,9, -3,-3/*mean (0.193196), correlation (0.458364)*/,
-4,-7, -3,-12/*mean (0.196536), correlation (0.455782)*/,
6,5, 8,0/*mean (0.1972), correlation (0.450481)*/,
-7,6, -6,12/*mean (0.199438), correlation (0.458156)*/,
-13,6, -5,-2/*mean (0.211224), correlation (0.449548)*/,
1,-10, 3,10/*mean (0.211718), correlation (0.440606)*/,
4,1, 8,-4/*mean (0.213034), correlation (0.443177)*/,
-2,-2, 2,-13/*mean (0.234334), correlation (0.455304)*/,
2,-12, 12,12/*mean (0.235684), correlation (0.443436)*/,
-2,-13, 0,-6/*mean (0.237674), correlation (0.452525)*/,
4,1, 9,3/*mean (0.23962), correlation (0.444824)*/,
-6,-10, -3,-5/*mean (0.248459), correlation (0.439621)*/,
-3,-13, -1,1/*mean (0.249505), correlation (0.456666)*/,
7,5, 12,-11/*mean (0.00119208), correlation (0.495466)*/,
4,-2, 5,-7/*mean (0.00372245), correlation (0.484214)*/,
-13,9, -9,-5/*mean (0.00741116), correlation (0.499854)*/,
7,1, 8,6/*mean (0.0208952), correlation (0.499773)*/,
7,-8, 7,6/*mean (0.0220085), correlation (0.501609)*/,
-7,-4, -7,1/*mean (0.0233806), correlation (0.496568)*/,
-8,11, -7,-8/*mean (0.0236505), correlation (0.489719)*/,
-13,6, -12,-8/*mean (0.0268781), correlation (0.503487)*/,
2,4, 3,9/*mean (0.0323324), correlation (0.501938)*/,
10,-5, 12,3/*mean (0.0399235), correlation (0.494029)*/,
-6,-5, -6,7/*mean (0.0420153), correlation (0.486579)*/,
8,-3, 9,-8/*mean (0.0548021), correlation (0.484237)*/,
2,-12, 2,8/*mean (0.0616622), correlation (0.496642)*/,
-11,-2, -10,3/*mean (0.0627755), correlation (0.498563)*/,
-12,-13, -7,-9/*mean (0.0829622), correlation (0.495491)*/,
-11,0, -10,-5/*mean (0.0843342), correlation (0.487146)*/,
5,-3, 11,8/*mean (0.0929937), correlation (0.502315)*/,
-2,-13, -1,12/*mean (0.113327), correlation (0.48941)*/,
-1,-8, 0,9/*mean (0.132119), correlation (0.467268)*/,
-13,-11, -12,-5/*mean (0.136269), correlation (0.498771)*/,
-10,-2, -10,11/*mean (0.142173), correlation (0.498714)*/,
-3,9, -2,-13/*mean (0.144141), correlation (0.491973)*/,
2,-3, 3,2/*mean (0.14892), correlation (0.500782)*/,
-9,-13, -4,0/*mean (0.150371), correlation (0.498211)*/,
-4,6, -3,-10/*mean (0.152159), correlation (0.495547)*/,
-4,12, -2,-7/*mean (0.156152), correlation (0.496925)*/,
-6,-11, -4,9/*mean (0.15749), correlation (0.499222)*/,
6,-3, 6,11/*mean (0.159211), correlation (0.503821)*/,
-13,11, -5,5/*mean (0.162427), correlation (0.501907)*/,
11,11, 12,6/*mean (0.16652), correlation (0.497632)*/,
7,-5, 12,-2/*mean (0.169141), correlation (0.484474)*/,
-1,12, 0,7/*mean (0.169456), correlation (0.495339)*/,
-4,-8, -3,-2/*mean (0.171457), correlation (0.487251)*/,
-7,1, -6,7/*mean (0.175), correlation (0.500024)*/,
-13,-12, -8,-13/*mean (0.175866), correlation (0.497523)*/,
-7,-2, -6,-8/*mean (0.178273), correlation (0.501854)*/,
-8,5, -6,-9/*mean (0.181107), correlation (0.494888)*/,
-5,-1, -4,5/*mean (0.190227), correlation (0.482557)*/,
-13,7, -8,10/*mean (0.196739), correlation (0.496503)*/,
1,5, 5,-13/*mean (0.19973), correlation (0.499759)*/,
1,0, 10,-13/*mean (0.204465), correlation (0.49873)*/,
9,12, 10,-1/*mean (0.209334), correlation (0.49063)*/,
5,-8, 10,-9/*mean (0.211134), correlation (0.503011)*/,
-1,11, 1,-13/*mean (0.212), correlation (0.499414)*/,
-9,-3, -6,2/*mean (0.212168), correlation (0.480739)*/,
-1,-10, 1,12/*mean (0.212731), correlation (0.502523)*/,
-13,1, -8,-10/*mean (0.21327), correlation (0.489786)*/,
8,-11, 10,-6/*mean (0.214159), correlation (0.488246)*/,
2,-13, 3,-6/*mean (0.216993), correlation (0.50287)*/,
7,-13, 12,-9/*mean (0.223639), correlation (0.470502)*/,
-10,-10, -5,-7/*mean (0.224089), correlation (0.500852)*/,
-10,-8, -8,-13/*mean (0.228666), correlation (0.502629)*/,
4,-6, 8,5/*mean (0.22906), correlation (0.498305)*/,
3,12, 8,-13/*mean (0.233378), correlation (0.503825)*/,
-4,2, -3,-3/*mean (0.234323), correlation (0.476692)*/,
5,-13, 10,-12/*mean (0.236392), correlation (0.475462)*/,
4,-13, 5,-1/*mean (0.236842), correlation (0.504132)*/,
-9,9, -4,3/*mean (0.236977), correlation (0.497739)*/,
0,3, 3,-9/*mean (0.24314), correlation (0.499398)*/,
-12,1, -6,1/*mean (0.243297), correlation (0.489447)*/,
3,2, 4,-8/*mean (0.00155196), correlation (0.553496)*/,
-10,-10, -10,9/*mean (0.00239541), correlation (0.54297)*/,
8,-13, 12,12/*mean (0.0034413), correlation (0.544361)*/,
-8,-12, -6,-5/*mean (0.003565), correlation (0.551225)*/,
2,2, 3,7/*mean (0.00835583), correlation (0.55285)*/,
10,6, 11,-8/*mean (0.00885065), correlation (0.540913)*/,
6,8, 8,-12/*mean (0.0101552), correlation (0.551085)*/,
-7,10, -6,5/*mean (0.0102227), correlation (0.533635)*/,
-3,-9, -3,9/*mean (0.0110211), correlation (0.543121)*/,
-1,-13, -1,5/*mean (0.0113473), correlation (0.550173)*/,
-3,-7, -3,4/*mean (0.0140913), correlation (0.554774)*/,
-8,-2, -8,3/*mean (0.017049), correlation (0.55461)*/,
4,2, 12,12/*mean (0.01778), correlation (0.546921)*/,
2,-5, 3,11/*mean (0.0224022), correlation (0.549667)*/,
6,-9, 11,-13/*mean (0.029161), correlation (0.546295)*/,
3,-1, 7,12/*mean (0.0303081), correlation (0.548599)*/,
11,-1, 12,4/*mean (0.0355151), correlation (0.523943)*/,
-3,0, -3,6/*mean (0.0417904), correlation (0.543395)*/,
4,-11, 4,12/*mean (0.0487292), correlation (0.542818)*/,
2,-4, 2,1/*mean (0.0575124), correlation (0.554888)*/,
-10,-6, -8,1/*mean (0.0594242), correlation (0.544026)*/,
-13,7, -11,1/*mean (0.0597391), correlation (0.550524)*/,
-13,12, -11,-13/*mean (0.0608974), correlation (0.55383)*/,
6,0, 11,-13/*mean (0.065126), correlation (0.552006)*/,
0,-1, 1,4/*mean (0.074224), correlation (0.546372)*/,
-13,3, -9,-2/*mean (0.0808592), correlation (0.554875)*/,
-9,8, -6,-3/*mean (0.0883378), correlation (0.551178)*/,
-13,-6, -8,-2/*mean (0.0901035), correlation (0.548446)*/,
5,-9, 8,10/*mean (0.0949843), correlation (0.554694)*/,
2,7, 3,-9/*mean (0.0994152), correlation (0.550979)*/,
-1,-6, -1,-1/*mean (0.10045), correlation (0.552714)*/,
9,5, 11,-2/*mean (0.100686), correlation (0.552594)*/,
11,-3, 12,-8/*mean (0.101091), correlation (0.532394)*/,
3,0, 3,5/*mean (0.101147), correlation (0.525576)*/,
-1,4, 0,10/*mean (0.105263), correlation (0.531498)*/,
3,-6, 4,5/*mean (0.110785), correlation (0.540491)*/,
-13,0, -10,5/*mean (0.112798), correlation (0.536582)*/,
5,8, 12,11/*mean (0.114181), correlation (0.555793)*/,
8,9, 9,-6/*mean (0.117431), correlation (0.553763)*/,
7,-4, 8,-12/*mean (0.118522), correlation (0.553452)*/,
-10,4, -10,9/*mean (0.12094), correlation (0.554785)*/,
7,3, 12,4/*mean (0.122582), correlation (0.555825)*/,
9,-7, 10,-2/*mean (0.124978), correlation (0.549846)*/,
7,0, 12,-2/*mean (0.127002), correlation (0.537452)*/,
-1,-6, 0,-11/*mean (0.127148), correlation (0.547401)*/
]);
var H = new jsfeat.matrix_t(3, 3, jsfeat.F32_t|jsfeat.C1_t);
var patch_img = new jsfeat.matrix_t(32, 32, jsfeat.U8_t|jsfeat.C1_t);
var rectify_patch = function(src, dst, angle, px, py, psize) {
var cosine = Math.cos(angle);
var sine = Math.sin(angle);
H.data[0] = cosine, H.data[1] = -sine, H.data[2] = (-cosine + sine ) * psize*0.5 + px,
H.data[3] = sine, H.data[4] = cosine, H.data[5] = (-sine - cosine) * psize*0.5 + py;
jsfeat.imgproc.warp_affine(src, dst, H, 128);
};
return {
describe: function(src, corners, count, descriptors) {
var DESCR_SIZE = 32; // bytes;
var i=0,b=0,px=0.0,py=0.0,angle=0.0;
var t0=0, t1=0, val=0;
var img = src.data, w = src.cols, h = src.rows;
var patch_d = patch_img.data;
var patch_off = 16*32 + 16; // center of patch
var patt=0;
if(!(descriptors.type&jsfeat.U8_t)) {
// relocate to U8 type
descriptors.type = jsfeat.U8_t;
descriptors.cols = DESCR_SIZE;
descriptors.rows = count;
descriptors.channel = 1;
descriptors.allocate();
} else {
descriptors.resize(DESCR_SIZE, count, 1);
}
var descr_d = descriptors.data;
var descr_off = 0;
for(i = 0; i < count; ++i) {
px = corners[i].x;
py = corners[i].y;
angle = corners[i].angle;
rectify_patch(src, patch_img, angle, px, py, 32);
// describe the patch
patt = 0;
for (b = 0; b < DESCR_SIZE; ++b) {
t0 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
t1 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
val = (t0 < t1)|0;
t0 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
t1 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
val |= (t0 < t1) << 1;
t0 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
t1 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
val |= (t0 < t1) << 2;
t0 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
t1 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
val |= (t0 < t1) << 3;
t0 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
t1 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
val |= (t0 < t1) << 4;
t0 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
t1 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
val |= (t0 < t1) << 5;
t0 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
t1 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
val |= (t0 < t1) << 6;
t0 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
t1 = patch_d[patch_off + bit_pattern_31_[patt+1] * 32 + bit_pattern_31_[patt]]; patt += 2;
val |= (t0 < t1) << 7;
descr_d[descr_off+b] = val;
}
descr_off += DESCR_SIZE;
}
}
};
})();
global.orb = orb;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*
* this code is a rewrite from OpenCV's Lucas-Kanade optical flow implementation
*/
(function(global) {
"use strict";
//
var optical_flow_lk = (function() {
// short link to shar deriv
var scharr_deriv = jsfeat.imgproc.scharr_derivatives;
return {
track: function(prev_pyr, curr_pyr, prev_xy, curr_xy, count, win_size, max_iter, status, eps, min_eigen_threshold) {
if (typeof max_iter === "undefined") { max_iter = 30; }
if (typeof status === "undefined") { status = new Uint8Array(count); }
if (typeof eps === "undefined") { eps = 0.01; }
if (typeof min_eigen_threshold === "undefined") { min_eigen_threshold = 0.0001; }
var half_win = (win_size-1)*0.5;
var win_area = (win_size*win_size)|0;
var win_area2 = win_area << 1;
var prev_imgs = prev_pyr.data, next_imgs = curr_pyr.data;
var img_prev=prev_imgs[0].data,img_next=next_imgs[0].data;
var w0 = prev_imgs[0].cols, h0 = prev_imgs[0].rows,lw=0,lh=0;
var iwin_node = jsfeat.cache.get_buffer(win_area<<2);
var deriv_iwin_node = jsfeat.cache.get_buffer(win_area2<<2);
var deriv_lev_node = jsfeat.cache.get_buffer((h0*(w0<<1))<<2);
var deriv_m = new jsfeat.matrix_t(w0, h0, jsfeat.S32C2_t, deriv_lev_node.data);
var iwin_buf = iwin_node.i32;
var deriv_iwin = deriv_iwin_node.i32;
var deriv_lev = deriv_lev_node.i32;
var dstep=0,src=0,dsrc=0,iptr=0,diptr=0,jptr=0;
var lev_sc=0.0,prev_x=0.0,prev_y=0.0,next_x=0.0,next_y=0.0;
var prev_delta_x=0.0,prev_delta_y=0.0,delta_x=0.0,delta_y=0.0;
var iprev_x=0,iprev_y=0,inext_x=0,inext_y=0;
var i=0,j=0,x=0,y=0,level=0,ptid=0,iter=0;
var brd_tl=0,brd_r=0,brd_b=0;
var a=0.0,b=0.0,b1=0.0,b2=0.0;
// fixed point math
var W_BITS14 = 14;
var W_BITS4 = 14;
var W_BITS1m5 = W_BITS4 - 5;
var W_BITS1m51 = (1 << ((W_BITS1m5) - 1));
var W_BITS14_ = (1 << W_BITS14);
var W_BITS41 = (1 << ((W_BITS4) - 1));
var FLT_SCALE = 1.0/(1 << 20);
var iw00=0,iw01=0,iw10=0,iw11=0,ival=0,ixval=0,iyval=0;
var A11=0.0,A12=0.0,A22=0.0,D=0.0,min_eig=0.0;
var FLT_EPSILON = 0.00000011920929;
eps *= eps;
// reset status
for(; i < count; ++i) {
status[i] = 1;
}
var max_level = (prev_pyr.levels - 1)|0;
level = max_level;
for(; level >= 0; --level) {
lev_sc = (1.0/(1 << level));
lw = w0 >> level;
lh = h0 >> level;
dstep = lw << 1;
img_prev = prev_imgs[level].data;
img_next = next_imgs[level].data;
brd_r = (lw - win_size)|0;
brd_b = (lh - win_size)|0;
// calculate level derivatives
scharr_deriv(prev_imgs[level], deriv_m);
// iterate through points
for(ptid = 0; ptid < count; ++ptid) {
i = ptid << 1;
j = i + 1;
prev_x = prev_xy[i]*lev_sc;
prev_y = prev_xy[j]*lev_sc;
if( level == max_level ) {
next_x = prev_x;
next_y = prev_y;
} else {
next_x = curr_xy[i]*2.0;
next_y = curr_xy[j]*2.0;
}
curr_xy[i] = next_x;
curr_xy[j] = next_y;
prev_x -= half_win;
prev_y -= half_win;
iprev_x = prev_x|0;
iprev_y = prev_y|0;
// border check
x = (iprev_x <= brd_tl)|(iprev_x >= brd_r)|(iprev_y <= brd_tl)|(iprev_y >= brd_b);
if( x != 0 ) {
if( level == 0 ) {
status[ptid] = 0;
}
continue;
}
a = prev_x - iprev_x;
b = prev_y - iprev_y;
iw00 = (((1.0 - a)*(1.0 - b)*W_BITS14_) + 0.5)|0;
iw01 = ((a*(1.0 - b)*W_BITS14_) + 0.5)|0;
iw10 = (((1.0 - a)*b*W_BITS14_) + 0.5)|0;
iw11 = (W_BITS14_ - iw00 - iw01 - iw10);
A11 = 0.0, A12 = 0.0, A22 = 0.0;
// extract the patch from the first image, compute covariation matrix of derivatives
for( y = 0; y < win_size; ++y ) {
src = ( (y + iprev_y)*lw + iprev_x )|0;
dsrc = src << 1;
iptr = (y*win_size)|0;
diptr = iptr << 1;
for(x = 0 ; x < win_size; ++x, ++src, ++iptr, dsrc += 2) {
ival = ( (img_prev[src])*iw00 + (img_prev[src+1])*iw01 +
(img_prev[src+lw])*iw10 + (img_prev[src+lw+1])*iw11 );
ival = (((ival) + W_BITS1m51) >> (W_BITS1m5));
ixval = ( deriv_lev[dsrc]*iw00 + deriv_lev[dsrc+2]*iw01 +
deriv_lev[dsrc+dstep]*iw10 + deriv_lev[dsrc+dstep+2]*iw11 );
ixval = (((ixval) + W_BITS41) >> (W_BITS4));
iyval = ( deriv_lev[dsrc+1]*iw00 + deriv_lev[dsrc+3]*iw01 + deriv_lev[dsrc+dstep+1]*iw10 +
deriv_lev[dsrc+dstep+3]*iw11 );
iyval = (((iyval) + W_BITS41) >> (W_BITS4));
iwin_buf[iptr] = ival;
deriv_iwin[diptr++] = ixval;
deriv_iwin[diptr++] = iyval;
A11 += ixval*ixval;
A12 += ixval*iyval;
A22 += iyval*iyval;
}
}
A11 *= FLT_SCALE; A12 *= FLT_SCALE; A22 *= FLT_SCALE;
D = A11*A22 - A12*A12;
min_eig = (A22 + A11 - Math.sqrt((A11-A22)*(A11-A22) + 4.0*A12*A12)) / win_area2;
if( min_eig < min_eigen_threshold || D < FLT_EPSILON )
{
if( level == 0 ) {
status[ptid] = 0;
}
continue;
}
D = 1.0/D;
next_x -= half_win;
next_y -= half_win;
prev_delta_x = 0.0;
prev_delta_y = 0.0;
for( iter = 0; iter < max_iter; ++iter ) {
inext_x = next_x|0;
inext_y = next_y|0;
x = (inext_x <= brd_tl)|(inext_x >= brd_r)|(inext_y <= brd_tl)|(inext_y >= brd_b);
if( x != 0 ) {
if( level == 0 ) {
status[ptid] = 0;
}
break;
}
a = next_x - inext_x;
b = next_y - inext_y;
iw00 = (((1.0 - a)*(1.0 - b)*W_BITS14_) + 0.5)|0;
iw01 = ((a*(1.0 - b)*W_BITS14_) + 0.5)|0;
iw10 = (((1.0 - a)*b*W_BITS14_) + 0.5)|0;
iw11 = (W_BITS14_ - iw00 - iw01 - iw10);
b1 = 0.0, b2 = 0.0;
for( y = 0; y < win_size; ++y ) {
jptr = ( (y + inext_y)*lw + inext_x )|0;
iptr = (y*win_size)|0;
diptr = iptr << 1;
for( x = 0 ; x < win_size; ++x, ++jptr, ++iptr ) {
ival = ( (img_next[jptr])*iw00 + (img_next[jptr+1])*iw01 +
(img_next[jptr+lw])*iw10 + (img_next[jptr+lw+1])*iw11 );
ival = (((ival) + W_BITS1m51) >> (W_BITS1m5));
ival = (ival - iwin_buf[iptr]);
b1 += ival * deriv_iwin[diptr++];
b2 += ival * deriv_iwin[diptr++];
}
}
b1 *= FLT_SCALE;
b2 *= FLT_SCALE;
delta_x = ((A12*b2 - A22*b1) * D);
delta_y = ((A12*b1 - A11*b2) * D);
next_x += delta_x;
next_y += delta_y;
curr_xy[i] = next_x + half_win;
curr_xy[j] = next_y + half_win;
if( delta_x*delta_x + delta_y*delta_y <= eps ) {
break;
}
if( iter > 0 && Math.abs(delta_x + prev_delta_x) < 0.01 &&
Math.abs(delta_y + prev_delta_y) < 0.01 ) {
curr_xy[i] -= delta_x*0.5;
curr_xy[j] -= delta_y*0.5;
break;
}
prev_delta_x = delta_x;
prev_delta_y = delta_y;
}
} // points loop
} // levels loop
jsfeat.cache.put_buffer(iwin_node);
jsfeat.cache.put_buffer(deriv_iwin_node);
jsfeat.cache.put_buffer(deriv_lev_node);
}
};
})();
global.optical_flow_lk = optical_flow_lk;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*
* this code is a rewrite from https://github.com/mtschirs/js-objectdetect implementation
* @author Martin Tschirsich / http://www.tu-darmstadt.de/~m_t
*/
(function(global) {
"use strict";
//
var haar = (function() {
var _group_func = function(r1, r2) {
var distance = (r1.width * 0.25 + 0.5)|0;
return r2.x <= r1.x + distance &&
r2.x >= r1.x - distance &&
r2.y <= r1.y + distance &&
r2.y >= r1.y - distance &&
r2.width <= (r1.width * 1.5 + 0.5)|0 &&
(r2.width * 1.5 + 0.5)|0 >= r1.width;
};
return {
edges_density: 0.07,
detect_single_scale: function(int_sum, int_sqsum, int_tilted, int_canny_sum, width, height, scale, classifier) {
var win_w = (classifier.size[0] * scale)|0,
win_h = (classifier.size[1] * scale)|0,
step_x = (0.5 * scale + 1.5)|0,
step_y = step_x;
var i,j,k,x,y,ex=(width-win_w)|0,ey=(height-win_h)|0;
var w1=(width+1)|0,edge_dens,mean,variance,std;
var inv_area = 1.0 / (win_w * win_h);
var stages,stage,trees,tree,sn,tn,fn,found=true,stage_thresh,stage_sum,tree_sum,feature,features;
var fi_a,fi_b,fi_c,fi_d,fw,fh;
var ii_a=0,ii_b=win_w,ii_c=win_h*w1,ii_d=ii_c+win_w;
var edges_thresh = ((win_w*win_h) * 0xff * this.edges_density)|0;
// if too much gradient we also can skip
//var edges_thresh_high = ((win_w*win_h) * 0xff * 0.3)|0;
var rects = [];
for(y = 0; y < ey; y += step_y) {
ii_a = y * w1;
for(x = 0; x < ex; x += step_x, ii_a += step_x) {
mean = int_sum[ii_a]
- int_sum[ii_a+ii_b]
- int_sum[ii_a+ii_c]
+ int_sum[ii_a+ii_d];
// canny prune
if(int_canny_sum) {
edge_dens = (int_canny_sum[ii_a]
- int_canny_sum[ii_a+ii_b]
- int_canny_sum[ii_a+ii_c]
+ int_canny_sum[ii_a+ii_d]);
if(edge_dens < edges_thresh || mean < 20) {
x += step_x, ii_a += step_x;
continue;
}
}
mean *= inv_area;
variance = (int_sqsum[ii_a]
- int_sqsum[ii_a+ii_b]
- int_sqsum[ii_a+ii_c]
+ int_sqsum[ii_a+ii_d]) * inv_area - mean * mean;
std = variance > 0. ? Math.sqrt(variance) : 1;
stages = classifier.complexClassifiers;
sn = stages.length;
found = true;
for(i = 0; i < sn; ++i) {
stage = stages[i];
stage_thresh = stage.threshold;
trees = stage.simpleClassifiers;
tn = trees.length;
stage_sum = 0;
for(j = 0; j < tn; ++j) {
tree = trees[j];
tree_sum = 0;
features = tree.features;
fn = features.length;
if(tree.tilted === 1) {
for(k=0; k < fn; ++k) {
feature = features[k];
fi_a = ~~(x + feature[0] * scale) + ~~(y + feature[1] * scale) * w1;
fw = ~~(feature[2] * scale);
fh = ~~(feature[3] * scale);
fi_b = fw * w1;
fi_c = fh * w1;
tree_sum += (int_tilted[fi_a]
- int_tilted[fi_a + fw + fi_b]
- int_tilted[fi_a - fh + fi_c]
+ int_tilted[fi_a + fw - fh + fi_b + fi_c]) * feature[4];
}
} else {
for(k=0; k < fn; ++k) {
feature = features[k];
fi_a = ~~(x + feature[0] * scale) + ~~(y + feature[1] * scale) * w1;
fw = ~~(feature[2] * scale);
fh = ~~(feature[3] * scale);
fi_c = fh * w1;
tree_sum += (int_sum[fi_a]
- int_sum[fi_a+fw]
- int_sum[fi_a+fi_c]
+ int_sum[fi_a+fi_c+fw]) * feature[4];
}
}
stage_sum += (tree_sum * inv_area < tree.threshold * std) ? tree.left_val : tree.right_val;
}
if (stage_sum < stage_thresh) {
found = false;
break;
}
}
if(found) {
rects.push({"x" : x,
"y" : y,
"width" : win_w,
"height" : win_h,
"neighbor" : 1,
"confidence" : stage_sum});
x += step_x, ii_a += step_x;
}
}
}
return rects;
},
detect_multi_scale: function(int_sum, int_sqsum, int_tilted, int_canny_sum, width, height, classifier, scale_factor, scale_min) {
if (typeof scale_factor === "undefined") { scale_factor = 1.2; }
if (typeof scale_min === "undefined") { scale_min = 1.0; }
var win_w = classifier.size[0];
var win_h = classifier.size[1];
var rects = [];
while (scale_min * win_w < width && scale_min * win_h < height) {
rects = rects.concat(this.detect_single_scale(int_sum, int_sqsum, int_tilted, int_canny_sum, width, height, scale_min, classifier));
scale_min *= scale_factor;
}
return rects;
},
// OpenCV method to group detected rectangles
group_rectangles: function(rects, min_neighbors) {
if (typeof min_neighbors === "undefined") { min_neighbors = 1; }
var i, j, n = rects.length;
var node = [];
for (i = 0; i < n; ++i) {
node[i] = {"parent" : -1,
"element" : rects[i],
"rank" : 0};
}
for (i = 0; i < n; ++i) {
if (!node[i].element)
continue;
var root = i;
while (node[root].parent != -1)
root = node[root].parent;
for (j = 0; j < n; ++j) {
if( i != j && node[j].element && _group_func(node[i].element, node[j].element)) {
var root2 = j;
while (node[root2].parent != -1)
root2 = node[root2].parent;
if(root2 != root) {
if(node[root].rank > node[root2].rank)
node[root2].parent = root;
else {
node[root].parent = root2;
if (node[root].rank == node[root2].rank)
node[root2].rank++;
root = root2;
}
/* compress path from node2 to the root: */
var temp, node2 = j;
while (node[node2].parent != -1) {
temp = node2;
node2 = node[node2].parent;
node[temp].parent = root;
}
/* compress path from node to the root: */
node2 = i;
while (node[node2].parent != -1) {
temp = node2;
node2 = node[node2].parent;
node[temp].parent = root;
}
}
}
}
}
var idx_seq = [];
var class_idx = 0;
for(i = 0; i < n; i++) {
j = -1;
var node1 = i;
if(node[node1].element) {
while (node[node1].parent != -1)
node1 = node[node1].parent;
if(node[node1].rank >= 0)
node[node1].rank = ~class_idx++;
j = ~node[node1].rank;
}
idx_seq[i] = j;
}
var comps = [];
for (i = 0; i < class_idx+1; ++i) {
comps[i] = {"neighbors" : 0,
"x" : 0,
"y" : 0,
"width" : 0,
"height" : 0,
"confidence" : 0};
}
// count number of neighbors
for(i = 0; i < n; ++i) {
var r1 = rects[i];
var idx = idx_seq[i];
if (comps[idx].neighbors == 0)
comps[idx].confidence = r1.confidence;
++comps[idx].neighbors;
comps[idx].x += r1.x;
comps[idx].y += r1.y;
comps[idx].width += r1.width;
comps[idx].height += r1.height;
comps[idx].confidence = Math.max(comps[idx].confidence, r1.confidence);
}
var seq2 = [];
// calculate average bounding box
for(i = 0; i < class_idx; ++i) {
n = comps[i].neighbors;
if (n >= min_neighbors)
seq2.push({"x" : (comps[i].x * 2 + n) / (2 * n),
"y" : (comps[i].y * 2 + n) / (2 * n),
"width" : (comps[i].width * 2 + n) / (2 * n),
"height" : (comps[i].height * 2 + n) / (2 * n),
"neighbors" : comps[i].neighbors,
"confidence" : comps[i].confidence});
}
var result_seq = [];
n = seq2.length;
// filter out small face rectangles inside large face rectangles
for(i = 0; i < n; ++i) {
var r1 = seq2[i];
var flag = true;
for(j = 0; j < n; ++j) {
var r2 = seq2[j];
var distance = (r2.width * 0.25 + 0.5)|0;
if(i != j &&
r1.x >= r2.x - distance &&
r1.y >= r2.y - distance &&
r1.x + r1.width <= r2.x + r2.width + distance &&
r1.y + r1.height <= r2.y + r2.height + distance &&
(r2.neighbors > Math.max(3, r1.neighbors) || r1.neighbors < 3)) {
flag = false;
break;
}
}
if(flag)
result_seq.push(r1);
}
return result_seq;
}
};
})();
global.haar = haar;
})(jsfeat);
/**
* BBF: Brightness Binary Feature
*
* @author Eugene Zatepyakin / http://inspirit.ru/
*
* this code is a rewrite from https://github.com/liuliu/ccv implementation
* @author Liu Liu / http://liuliu.me/
*
* The original paper refers to: YEF Real-Time Object Detection, Yotam Abramson and Bruno Steux
*/
(function(global) {
"use strict";
//
var bbf = (function() {
var _group_func = function(r1, r2) {
var distance = (r1.width * 0.25 + 0.5)|0;
return r2.x <= r1.x + distance &&
r2.x >= r1.x - distance &&
r2.y <= r1.y + distance &&
r2.y >= r1.y - distance &&
r2.width <= (r1.width * 1.5 + 0.5)|0 &&
(r2.width * 1.5 + 0.5)|0 >= r1.width;
};
var img_pyr = new jsfeat.pyramid_t(1);
return {
interval: 4,
scale: 1.1486,
next: 5,
scale_to: 1,
// make features local copy
// to avoid array allocation with each scale
// this is strange but array works faster than Int32 version???
prepare_cascade: function(cascade) {
var sn = cascade.stage_classifier.length;
for (var j = 0; j < sn; j++) {
var orig_feature = cascade.stage_classifier[j].feature;
var f_cnt = cascade.stage_classifier[j].count;
var feature = cascade.stage_classifier[j]._feature = new Array(f_cnt);
for (var k = 0; k < f_cnt; k++) {
feature[k] = {"size" : orig_feature[k].size,
"px" : new Array(orig_feature[k].size),
"pz" : new Array(orig_feature[k].size),
"nx" : new Array(orig_feature[k].size),
"nz" : new Array(orig_feature[k].size)};
}
}
},
build_pyramid: function(src, min_width, min_height, interval) {
if (typeof interval === "undefined") { interval = 4; }
var sw=src.cols,sh=src.rows;
var i=0,nw=0,nh=0;
var new_pyr=false;
var src0=src,src1=src;
var data_type = jsfeat.U8_t | jsfeat.C1_t;
this.interval = interval;
this.scale = Math.pow(2, 1 / (this.interval + 1));
this.next = (this.interval + 1)|0;
this.scale_to = (Math.log(Math.min(sw / min_width, sh / min_height)) / Math.log(this.scale))|0;
var pyr_l = ((this.scale_to + this.next * 2) * 4) | 0;
if(img_pyr.levels != pyr_l) {
img_pyr.levels = pyr_l;
img_pyr.data = new Array(pyr_l);
new_pyr = true;
img_pyr.data[0] = src; // first is src
}
for (i = 1; i <= this.interval; ++i) {
nw = (sw / Math.pow(this.scale, i))|0;
nh = (sh / Math.pow(this.scale, i))|0;
src0 = img_pyr.data[i<<2];
if(new_pyr || nw != src0.cols || nh != src0.rows) {
img_pyr.data[i<<2] = new jsfeat.matrix_t(nw, nh, data_type);
src0 = img_pyr.data[i<<2];
}
jsfeat.imgproc.resample(src, src0, nw, nh);
}
for (i = this.next; i < this.scale_to + this.next * 2; ++i) {
src1 = img_pyr.data[(i << 2) - (this.next << 2)];
src0 = img_pyr.data[i<<2];
nw = src1.cols >> 1;
nh = src1.rows >> 1;
if(new_pyr || nw != src0.cols || nh != src0.rows) {
img_pyr.data[i<<2] = new jsfeat.matrix_t(nw, nh, data_type);
src0 = img_pyr.data[i<<2];
}
jsfeat.imgproc.pyrdown(src1, src0);
}
for (i = this.next * 2; i < this.scale_to + this.next * 2; ++i) {
src1 = img_pyr.data[(i << 2) - (this.next << 2)];
nw = src1.cols >> 1;
nh = src1.rows >> 1;
src0 = img_pyr.data[(i<<2)+1];
if(new_pyr || nw != src0.cols || nh != src0.rows) {
img_pyr.data[(i<<2)+1] = new jsfeat.matrix_t(nw, nh, data_type);
src0 = img_pyr.data[(i<<2)+1];
}
jsfeat.imgproc.pyrdown(src1, src0, 1, 0);
//
src0 = img_pyr.data[(i<<2)+2];
if(new_pyr || nw != src0.cols || nh != src0.rows) {
img_pyr.data[(i<<2)+2] = new jsfeat.matrix_t(nw, nh, data_type);
src0 = img_pyr.data[(i<<2)+2];
}
jsfeat.imgproc.pyrdown(src1, src0, 0, 1);
//
src0 = img_pyr.data[(i<<2)+3];
if(new_pyr || nw != src0.cols || nh != src0.rows) {
img_pyr.data[(i<<2)+3] = new jsfeat.matrix_t(nw, nh, data_type);
src0 = img_pyr.data[(i<<2)+3];
}
jsfeat.imgproc.pyrdown(src1, src0, 1, 1);
}
return img_pyr;
},
detect: function(pyramid, cascade) {
var interval = this.interval;
var scale = this.scale;
var next = this.next;
var scale_upto = this.scale_to;
var i=0,j=0,k=0,n=0,x=0,y=0,q=0,sn=0,f_cnt=0,q_cnt=0,p=0,pmin=0,nmax=0,f=0,i4=0,qw=0,qh=0;
var sum=0.0, alpha, feature, orig_feature, feature_k, feature_o, flag = true, shortcut=true;
var scale_x = 1.0, scale_y = 1.0;
var dx = [0, 1, 0, 1];
var dy = [0, 0, 1, 1];
var seq = [];
var pyr=pyramid.data, bpp = 1, bpp2 = 2, bpp4 = 4;
var u8 = [], u8o = [0,0,0];
var step = [0,0,0];
var paddings = [0,0,0];
for (i = 0; i < scale_upto; i++) {
i4 = (i<<2);
qw = pyr[i4 + (next << 3)].cols - (cascade.width >> 2);
qh = pyr[i4 + (next << 3)].rows - (cascade.height >> 2);
step[0] = pyr[i4].cols * bpp;
step[1] = pyr[i4 + (next << 2)].cols * bpp;
step[2] = pyr[i4 + (next << 3)].cols * bpp;
paddings[0] = (pyr[i4].cols * bpp4) - (qw * bpp4);
paddings[1] = (pyr[i4 + (next << 2)].cols * bpp2) - (qw * bpp2);
paddings[2] = (pyr[i4 + (next << 3)].cols * bpp) - (qw * bpp);
sn = cascade.stage_classifier.length;
for (j = 0; j < sn; j++) {
orig_feature = cascade.stage_classifier[j].feature;
feature = cascade.stage_classifier[j]._feature;
f_cnt = cascade.stage_classifier[j].count;
for (k = 0; k < f_cnt; k++) {
feature_k = feature[k];
feature_o = orig_feature[k];
q_cnt = feature_o.size|0;
for (q = 0; q < q_cnt; q++) {
feature_k.px[q] = (feature_o.px[q] * bpp) + feature_o.py[q] * step[feature_o.pz[q]];
feature_k.pz[q] = feature_o.pz[q];
feature_k.nx[q] = (feature_o.nx[q] * bpp) + feature_o.ny[q] * step[feature_o.nz[q]];
feature_k.nz[q] = feature_o.nz[q];
}
}
}
u8[0] = pyr[i4].data; u8[1] = pyr[i4 + (next<<2)].data;
for (q = 0; q < 4; q++) {
u8[2] = pyr[i4 + (next<<3) + q].data;
u8o[0] = (dx[q]*bpp2) + dy[q] * (pyr[i4].cols*bpp2);
u8o[1] = (dx[q]*bpp) + dy[q] * (pyr[i4 + (next<<2)].cols*bpp);
u8o[2] = 0;
for (y = 0; y < qh; y++) {
for (x = 0; x < qw; x++) {
sum = 0;
flag = true;
sn = cascade.stage_classifier.length;
for (j = 0; j < sn; j++) {
sum = 0;
alpha = cascade.stage_classifier[j].alpha;
feature = cascade.stage_classifier[j]._feature;
f_cnt = cascade.stage_classifier[j].count;
for (k = 0; k < f_cnt; k++) {
feature_k = feature[k];
pmin = u8[feature_k.pz[0]][u8o[feature_k.pz[0]] + feature_k.px[0]];
nmax = u8[feature_k.nz[0]][u8o[feature_k.nz[0]] + feature_k.nx[0]];
if (pmin <= nmax) {
sum += alpha[k << 1];
} else {
shortcut = true;
q_cnt = feature_k.size;
for (f = 1; f < q_cnt; f++) {
if (feature_k.pz[f] >= 0) {
p = u8[feature_k.pz[f]][u8o[feature_k.pz[f]] + feature_k.px[f]];
if (p < pmin) {
if (p <= nmax) {
shortcut = false;
break;
}
pmin = p;
}
}
if (feature_k.nz[f] >= 0) {
n = u8[feature_k.nz[f]][u8o[feature_k.nz[f]] + feature_k.nx[f]];
if (n > nmax) {
if (pmin <= n) {
shortcut = false;
break;
}
nmax = n;
}
}
}
sum += (shortcut) ? alpha[(k << 1) + 1] : alpha[k << 1];
}
}
if (sum < cascade.stage_classifier[j].threshold) {
flag = false;
break;
}
}
if (flag) {
seq.push({"x" : (x * 4 + dx[q] * 2) * scale_x,
"y" : (y * 4 + dy[q] * 2) * scale_y,
"width" : cascade.width * scale_x,
"height" : cascade.height * scale_y,
"neighbor" : 1,
"confidence" : sum});
++x;
u8o[0] += bpp4;
u8o[1] += bpp2;
u8o[2] += bpp;
}
u8o[0] += bpp4;
u8o[1] += bpp2;
u8o[2] += bpp;
}
u8o[0] += paddings[0];
u8o[1] += paddings[1];
u8o[2] += paddings[2];
}
}
scale_x *= scale;
scale_y *= scale;
}
return seq;
},
// OpenCV method to group detected rectangles
group_rectangles: function(rects, min_neighbors) {
if (typeof min_neighbors === "undefined") { min_neighbors = 1; }
var i, j, n = rects.length;
var node = [];
for (i = 0; i < n; ++i) {
node[i] = {"parent" : -1,
"element" : rects[i],
"rank" : 0};
}
for (i = 0; i < n; ++i) {
if (!node[i].element)
continue;
var root = i;
while (node[root].parent != -1)
root = node[root].parent;
for (j = 0; j < n; ++j) {
if( i != j && node[j].element && _group_func(node[i].element, node[j].element)) {
var root2 = j;
while (node[root2].parent != -1)
root2 = node[root2].parent;
if(root2 != root) {
if(node[root].rank > node[root2].rank)
node[root2].parent = root;
else {
node[root].parent = root2;
if (node[root].rank == node[root2].rank)
node[root2].rank++;
root = root2;
}
/* compress path from node2 to the root: */
var temp, node2 = j;
while (node[node2].parent != -1) {
temp = node2;
node2 = node[node2].parent;
node[temp].parent = root;
}
/* compress path from node to the root: */
node2 = i;
while (node[node2].parent != -1) {
temp = node2;
node2 = node[node2].parent;
node[temp].parent = root;
}
}
}
}
}
var idx_seq = [];
var class_idx = 0;
for(i = 0; i < n; i++) {
j = -1;
var node1 = i;
if(node[node1].element) {
while (node[node1].parent != -1)
node1 = node[node1].parent;
if(node[node1].rank >= 0)
node[node1].rank = ~class_idx++;
j = ~node[node1].rank;
}
idx_seq[i] = j;
}
var comps = [];
for (i = 0; i < class_idx+1; ++i) {
comps[i] = {"neighbors" : 0,
"x" : 0,
"y" : 0,
"width" : 0,
"height" : 0,
"confidence" : 0};
}
// count number of neighbors
for(i = 0; i < n; ++i) {
var r1 = rects[i];
var idx = idx_seq[i];
if (comps[idx].neighbors == 0)
comps[idx].confidence = r1.confidence;
++comps[idx].neighbors;
comps[idx].x += r1.x;
comps[idx].y += r1.y;
comps[idx].width += r1.width;
comps[idx].height += r1.height;
comps[idx].confidence = Math.max(comps[idx].confidence, r1.confidence);
}
var seq2 = [];
// calculate average bounding box
for(i = 0; i < class_idx; ++i) {
n = comps[i].neighbors;
if (n >= min_neighbors)
seq2.push({"x" : (comps[i].x * 2 + n) / (2 * n),
"y" : (comps[i].y * 2 + n) / (2 * n),
"width" : (comps[i].width * 2 + n) / (2 * n),
"height" : (comps[i].height * 2 + n) / (2 * n),
"neighbors" : comps[i].neighbors,
"confidence" : comps[i].confidence});
}
var result_seq = [];
n = seq2.length;
// filter out small face rectangles inside large face rectangles
for(i = 0; i < n; ++i) {
var r1 = seq2[i];
var flag = true;
for(j = 0; j < n; ++j) {
var r2 = seq2[j];
var distance = (r2.width * 0.25 + 0.5)|0;
if(i != j &&
r1.x >= r2.x - distance &&
r1.y >= r2.y - distance &&
r1.x + r1.width <= r2.x + r2.width + distance &&
r1.y + r1.height <= r2.y + r2.height + distance &&
(r2.neighbors > Math.max(3, r1.neighbors) || r1.neighbors < 3)) {
flag = false;
break;
}
}
if(flag)
result_seq.push(r1);
}
return result_seq;
}
};
})();
global.bbf = bbf;
})(jsfeat);
/**
* @author Eugene Zatepyakin / http://inspirit.ru/
*/
(function(lib) {
"use strict";
{
// in commonjs, or when AMD wrapping has been applied, define its namespaces as exports
module.exports = lib;
}
})(jsfeat);
});
var findFaceWorker = function(e) {
var window = self;
var jsfeat=jsfeat||{REVISION:"ALPHA"};(function(r){var o=1.192092896e-7;var l=1e-37;var m=256,i=512,h=1024,x=2048,w=4096;var A=1,n=2,b=3,p=4;var z=new Int32Array([-1,1,4,-1,4,-1,-1,-1,8,-1,-1,-1,-1,-1,-1,-1,8]);var y=(function(){return function(B){return(B&65280)}})();var k=(function(){return function(B){return(B&255)}})();var c=(function(){return function(B){return z[(B&65280)>>8]}})();var a=0;var f=1;var e=2;var u=3;var d=1;var s=1;var g=2;var v=(function(){function B(D,C){this.size=((D+7)|0)&-8;if(typeof C==="undefined"){this.buffer=new ArrayBuffer(this.size);}else{this.buffer=C;this.size=C.length;}this.u8=new Uint8Array(this.buffer);this.i32=new Int32Array(this.buffer);this.f32=new Float32Array(this.buffer);this.f64=new Float64Array(this.buffer);}return B})();var q=(function(){function B(F,D,E,C){this.type=y(E)|0;this.channel=k(E)|0;this.cols=F|0;this.rows=D|0;if(typeof C==="undefined"){this.allocate();}else{this.buffer=C;this.data=this.type&m?this.buffer.u8:(this.type&i?this.buffer.i32:(this.type&h?this.buffer.f32:this.buffer.f64));}}B.prototype.allocate=function(){delete this.data;delete this.buffer;this.buffer=new v((this.cols*c(this.type)*this.channel)*this.rows);this.data=this.type&m?this.buffer.u8:(this.type&i?this.buffer.i32:(this.type&h?this.buffer.f32:this.buffer.f64));};B.prototype.copy_to=function(D){var C=D.data,G=this.data;var E=0,F=(this.cols*this.rows*this.channel)|0;for(;E<F-4;E+=4){C[E]=G[E];C[E+1]=G[E+1];C[E+2]=G[E+2];C[E+3]=G[E+3];}for(;E<F;++E){C[E]=G[E];}};B.prototype.resize=function(F,D,C){if(typeof C==="undefined"){C=this.channel;}var E=(F*c(this.type)*C)*D;if(E>this.buffer.size){this.cols=F;this.rows=D;this.channel=C;this.allocate();}else{this.cols=F;this.rows=D;this.channel=C;}};return B})();var t=(function(){function B(C){this.levels=C|0;this.data=new Array(C);this.pyrdown=jsfeat.imgproc.pyrdown;}B.prototype.allocate=function(C,E,F){var D=this.levels;while(--D>=0){this.data[D]=new q(C>>D,E>>D,F);}};B.prototype.build=function(F,E){if(typeof E==="undefined"){E=true;}var H=2,D=F,C=this.data[0];if(!E){var G=F.cols*F.rows;while(--G>=0){C.data[G]=F.data[G];}}C=this.data[1];this.pyrdown(D,C);for(;H<this.levels;++H){D=C;C=this.data[H];this.pyrdown(D,C);}};return B})();var j=(function(){function B(C,G,E,F,D){if(typeof C==="undefined"){C=0;}if(typeof G==="undefined"){G=0;}if(typeof E==="undefined"){E=0;}if(typeof F==="undefined"){F=0;}if(typeof D==="undefined"){D=-1;}this.x=C;this.y=G;this.score=E;this.level=F;this.angle=D;}return B})();r.U8_t=m;r.S32_t=i;r.F32_t=h;r.S64_t=x;r.F64_t=w;r.C1_t=A;r.C2_t=n;r.C3_t=b;r.C4_t=p;r.U8C1_t=m|A;r.U8C3_t=m|b;r.U8C4_t=m|p;r.F32C1_t=h|A;r.F32C2_t=h|n;r.S32C1_t=i|A;r.S32C2_t=i|n;r.EPSILON=o;r.FLT_MIN=l;r.COLOR_RGBA2GRAY=a;r.COLOR_RGB2GRAY=f;r.COLOR_BGRA2GRAY=e;r.COLOR_BGR2GRAY=u;r.BOX_BLUR_NOSCALE=d;r.SVD_U_T=s;r.SVD_V_T=g;r.get_data_type=y;r.get_channel=k;r.get_data_type_size=c;r.data_t=v;r.matrix_t=q;r.pyramid_t=t;r.keypoint_t=j;})(jsfeat);(function(b){var a=(function(){var f=(function(){function g(h){this.next=null;this.data=new jsfeat.data_t(h);this.size=this.data.size;this.buffer=this.data.buffer;this.u8=this.data.u8;this.i32=this.data.i32;this.f32=this.data.f32;this.f64=this.data.f64;}g.prototype.resize=function(h){delete this.data;this.data=new jsfeat.data_t(h);this.size=this.data.size;this.buffer=this.data.buffer;this.u8=this.data.u8;this.i32=this.data.i32;this.f32=this.data.f32;this.f64=this.data.f64;};return g})();var e,c;var d=0;return{allocate:function(g,k){e=c=new f(k);for(var h=0;h<g;++h){var j=new f(k);c=c.next=j;d++;}},get_buffer:function(g){var h=e;e=e.next;d--;if(g>h.size){h.resize(g);}return h},put_buffer:function(g){c=c.next=g;d++;}}})();b.cache=a;a.allocate(30,640*4);})(jsfeat);(function(b){var a=(function(){var c=new Int32Array(48*2);return{get_gaussian_kernel:function(p,m,e,l){var f=0,j=0,o=0,n=0,d=0;var g=0;var h=jsfeat.cache.get_buffer(p<<2);var k=h.f32;if((p&1)==1&&p<=7&&m<=0){switch(p>>1){case 0:k[0]=1;g=1;break;case 1:k[0]=0.25,k[1]=0.5,k[2]=0.25;g=0.25+0.5+0.25;break;case 2:k[0]=0.0625,k[1]=0.25,k[2]=0.375,k[3]=0.25,k[4]=0.0625;g=0.0625
jsfeat.haar.frontalface = 'FRONTALFACE_PLACEHOLDER';
var imageData = e.data.imageData,
w = e.data.w,
h = e.data.h,
videoWidth = e.data.videoWidth,
params = e.data.params;
var img_u8 = new jsfeat.matrix_t(w, h, jsfeat.U8_t | jsfeat.C1_t),
edg = new jsfeat.matrix_t(w, h, jsfeat.U8_t | jsfeat.C1_t),
ii_sum = new Int32Array((w+1)*(h+1)),
ii_sqsum = new Int32Array((w+1)*(h+1)),
ii_tilted = new Int32Array((w+1)*(h+1)),
ii_canny = new Int32Array((w+1)*(h+1));
var classifier = jsfeat.haar.frontalface;
jsfeat.imgproc.grayscale(imageData.data, w, h, img_u8);
// possible params
if (params.equalizeHistogram) {
jsfeat.imgproc.equalize_histogram(img_u8, img_u8);
}
//jsfeat.imgproc.gaussian_blur(img_u8, img_u8, 3);
jsfeat.imgproc.compute_integral_image(img_u8, ii_sum, ii_sqsum, classifier.tilted ? ii_tilted : null);
if(params.useCanny) {
jsfeat.imgproc.canny(img_u8, edg, 10, 50);
jsfeat.imgproc.compute_integral_image(edg, ii_canny, null, null);
}
jsfeat.haar.edgesDensity = params.edgesDensity;
var rects = jsfeat.haar.detect_multi_scale(ii_sum, ii_sqsum, ii_tilted, params.useCanny? ii_canny : null, img_u8.cols, img_u8.rows, classifier, params.scaleFactor, params.minScale);
rects = jsfeat.haar.group_rectangles(rects, params.min_neighbors);
for (var i = rects.length-1;i >= 0;i--) {
if (rects[i].confidence < params.confidenceThreshold) {
rects.splice(i,1);
}
}
var rl = rects.length;
if (rl == 0) {
self.postMessage({
faces: []
});
} else {
var best = rects[0];
for (var i = 1;i < rl;i++) {
if (rects[i].neighbors > best.neighbors) {
best = rects[i];
} else if (rects[i].neighbors == best.neighbors) {
// if (rects[i].width > best.width) best = rects[i]; // use biggest rect
if (rects[i].confidence > best.confidence) best = rects[i]; // use most confident rect
}
}
var sc = videoWidth / img_u8.cols;
best.x = (best.x*sc)|0;
best.y = (best.y*sc)|0;
best.width = (best.width*sc)|0;
best.height = (best.height*sc)|0;
self.postMessage({
faces: [best]
});
}
};
// import { drawDetection, drawFacialPoints, drawBoundingBox } from './utils/debugging.js';
/**
* this cascade is derived from https://github.com/mtschirs/js-objectdetect implementation
* @author Martin Tschirsich / http://www.tu-darmstadt.de/~m_t
*/
jsfeat_1.haar.frontalface = {complexClassifiers:[{simpleClassifiers:[{features:[[3,7,14,4,-1.],[3,9,14,2,2.]],threshold:4.0142e-003,right_val:0.83781,left_val:0.033794},{features:[[1,2,18,4,-1.],[7,2,6,4,3.]],threshold:0.015151,right_val:0.74888,left_val:0.15141},{features:[[1,7,15,9,-1.],[1,10,15,3,3.]],threshold:4.211e-003,right_val:0.63748,left_val:0.090049}],threshold:0.82269},{simpleClassifiers:[{features:[[5,6,2,6,-1.],[5,9,2,3,2.]],threshold:1.6227e-003,right_val:0.71109,left_val:0.069309},{features:[[7,5,6,3,-1.],[9,5,2,3,3.]],threshold:2.2907e-003,right_val:0.66687,left_val:0.17958},{features:[[4,0,12,9,-1.],[4,3,12,3,3.]],threshold:5.0026e-003,right_val:0.6554,left_val:0.16937},{features:[[6,9,10,8,-1.],[6,13,10,4,2.]],threshold:7.966e-003,right_val:0.091415,left_val:0.58663},{features:[[3,6,14,8,-1.],[3,10,14,4,2.]],threshold:-3.5227e-003,right_val:0.60319,left_val:0.14132},{features:[[14,1,6,10,-1.],[14,1,3,10,2.]],threshold:0.036668,right_val:0.79203,left_val:0.36757},{features:[[7,8,5,12,-1.],[7,12,5,4,3.]],threshold:9.3361e-003,right_val:0.20885,left_val:0.61614},{features:[[1,1,18,3,-1.],[7,1,6,3,3.]],threshold:8.6961e-003,right_val:0.63603,left_val:0.28362},{features:[[1,8,17,2,-1.],[1,9,17,1,2.]],threshold:1.1489e-003,right_val:0.58007,left_val:0.22236},{features:[[16,6,4,2,-1.],[16,7,4,1,2.]],threshold:-2.1485e-003,right_val:0.57871,left_val:0.24065},{features:[[5,17,2,2,-1.],[5,18,2,1,2.]],threshold:2.1219e-003,right_val:0.13622,left_val:0.55597},{features:[[14,2,6,12,-1.],[14,2,3,12,2.]],threshold:-0.093949,right_val:0.47177,left_val:0.85027},{features:[[4,0,4,12,-1.],[4,0,2,6,2.],[6,6,2,6,2.]],threshold:1.3778e-003,right_val:0.28345,left_val:0.59937},{features:[[2,11,18,8,-1.],[8,11,6,8,3.]],threshold:0.073063,right_val:0.706,left_val:0.43419},{features:[[5,7,10,2,-1.],[5,8,10,1,2.]],threshold:3.6767e-004,right_val:0.60516,left_val:0.30279},{features:[[15,11,5,3,-1.],[15,12,5,1,3.]],threshold:-6.048e-003,right_val:0.56753,left_val:0.17984}],threshold:6.9566},{simpleClassifiers:[{features:[[5,3,10,9,-1.],[5,6,10,3,3.]],threshold:-0.016511,right_val:0.14249,left_val:0.66442},{features:[[9,4,2,14,-1.],[9,11,2,7,2.]],threshold:2.7052e-003,right_val:0.12885,left_val:0.63254},{features:[[3,5,4,12,-1.],[3,9,4,4,3.]],threshold:2.807e-003,right_val:0.61932,left_val:0.12403},{features:[[4,5,12,5,-1.],[8,5,4,5,3.]],threshold:-1.5402e-003,right_val:0.567,left_val:0.14321},{features:[[5,6,10,8,-1.],[5,10,10,4,2.]],threshold:-5.6386e-004,right_val:0.59052,left_val:0.16574},{features:[[8,0,6,9,-1.],[8,3,6,3,3.]],threshold:1.9254e-003,right_val:0.57388,left_val:0.26955},{features:[[9,12,1,8,-1.],[9,16,1,4,2.]],threshold:-5.0215e-003,right_val:0.57828,left_val:0.18935},{features:[[0,7,20,6,-1.],[0,9,20,2,3.]],threshold:2.6365e-003,right_val:0.56954,left_val:0.23093},{features:[[7,0,6,17,-1.],[9,0,2,17,3.]],threshold:-1.5128e-003,right_val:0.59566,left_val:0.27596},{features:[[9,0,6,4,-1.],[11,0,2,4,3.]],threshold:-0.010157,right_val:0.5522,left_val:0.17325},{features:[[5,1,6,4,-1.],[7,1,2,4,3.]],threshold:-0.011954,right_val:0.5559,left_val:0.13394},{features:[[12,1,6,16,-1.],[14,1,2,16,3.]],threshold:4.8859e-003,right_val:0.61888,left_val:0.36287},{features:[[0,5,18,8,-1.],[0,5,9,4,2.],[9,9,9,4,2.]],threshold:-0.080133,right_val:0.54759,left_val:0.091211},{features:[[8,15,10,4,-1.],[13,15,5,2,2.],[8,17,5,2,2.]],threshold:1.0643e-003,right_val:0.57114,left_val:0.37151},{features:[[3,1,4,8,-1.],[3,1,2,4,2.],[5,5,2,4,2.]],threshold:-1.3419e-003,right_val:0.33181,left_val:0.59533},{features:[[3,6,14,10,-1.],[10,6,7,5,2.],[3,11,7,5,2.]],threshold:-0.054601,right_val:0.56028,left_val:0.18441},{features:[[2,1,6,16,-1.],[4,1,2,16,3.]],threshold:2.9072e-003,right_val:0.61317,left_val:0.35942},{features:[[0,18,20,2,-1.],[0,19,20,1,2.]],threshold:7.4719e-004,right_val:0.34596,left_val:0.59944},{features:[[8,13,4,3,-1.],[8,14,4,1,3.]],threshold:4.3014e-003,right_val:0.69908,left_val:0.41727},{features:[[9,14,2,3,-1.],[9,15,2,1,3.]],threshold:4.5018e-003,right_val:0.78015,left_val:0.45097},{features:[[0,12,9,6,-1.],[0,14,9,2,3
var faceDetection = function(pdmModel, params) {
// processes an image, detects a face and returns the initial face parameters for clmtrackr
// calls a callback function when it's done
// optionally uses web workers
if (params === undefined) params = {};
if (params.workSize === undefined) params.workSize = 200;
if (params.minScale === undefined) params.minScale = 2;
if (params.scaleFactor === undefined) params.scaleFactor = 1.15;
if (params.useCanny === undefined) params.useCanny = false;
if (params.edgesDensity === undefined) params.edgesDensity = 0.13;
if (params.equalizeHistogram === undefined) params.equalizeHistogram = false;
if (params.min_neighbors === undefined) params.min_neighbors = 2;
if (params.confidenceThreshold === undefined) params.confidenceThreshold = 106.1;
if (params.useWebWorkers === undefined) params.useWebWorkers = true;
// disable web workers if not exists
if (!window.Worker) params.useWebWorkers = false;
var msxmin, msymin, msymax;
var msmodelheight;
var element;
var model = pdmModel;
var mosseFilter = mosse.mosseFilter;
var left_eye_filter = mosse.filters.left_eye_filter;
var right_eye_filter = mosse.filters.right_eye_filter;
var nose_filter = mosse.filters.nose_filter;
var mossef_lefteye, mossef_righteye, mossef_nose;
var right_eye_position = [0.0,0.0];
var left_eye_position = [0.0,0.0];
var nose_position = [0.0,0.0];
if (model.hints && mosseFilter && left_eye_filter && right_eye_filter && nose_filter) {
mossef_lefteye = new mosseFilter();
mossef_lefteye.load(left_eye_filter);
mossef_righteye = new mosseFilter();
mossef_righteye.load(right_eye_filter);
mossef_nose = new mosseFilter();
mossef_nose.load(nose_filter);
} else {
console.log('MOSSE filters not found, using rough approximation for initialization.');
}
// load mean shape
var meanShape = model.shapeModel.meanShape;
var numPatches = model.patchModel.numPatches;
// get max and mins, width and height of meanshape
msymax = 0;
msxmin = msymin = 1000000;
for (var i = 0;i < numPatches;i++) {
if (meanShape[i][0] < msxmin) msxmin = meanShape[i][0];
if (meanShape[i][1] < msymin) msymin = meanShape[i][1];
if (meanShape[i][1] > msymax) msymax = meanShape[i][1];
}
msmodelheight = msymax-msymin;
var jf = new jsfeat_face(params);
this.init = function(video) {
element = video;
jf.init(element);
};
var getBoundingBox = function(box) {
return new Promise(function(resolve, reject) {
if (box) {
resolve({x : box[0], y : box[1], width : box[2], height : box[3]});
} else {
resolve(jf.findFace());
}
});
};
var getFinegrainedPosition = function(candidate) {
var translateX, translateY, scaling, rotation;
var x = candidate.x;
var y = candidate.y;
var w = candidate.width;
var h = candidate.height;
// var debugCC = document.getElementById('overlay2').getContext('2d')
if (model.hints && mosseFilter && left_eye_filter && right_eye_filter && nose_filter) {
var noseFilterWidth = w * 4.5/10;
var eyeFilterWidth = w * 6/10;
// detect position of eyes and nose via mosse filter
var nose_result = mossef_nose.track(element, Math.round(x+(w/2)-(noseFilterWidth/2)), Math.round(y+h*(5/8)-(noseFilterWidth/2)), noseFilterWidth, noseFilterWidth, false);
var right_result = mossef_righteye.track(element, Math.round(x+(w*3/4)-(eyeFilterWidth/2)), Math.round(y+h*(2/5)-(eyeFilterWidth/2)), eyeFilterWidth, eyeFilterWidth, false);
var left_result = mossef_lefteye.track(element, Math.round(x+(w/4)-(eyeFilterWidth/2)), Math.round(y+h*(2/5)-(eyeFilterWidth/2)), eyeFilterWidth, eyeFilterWidth, false);
right_eye_position[0] = Math.round(x+(w*3/4)-(eyeFilterWidth/2))+right_result[0];
right_eye_position[1] = Math.round(y+h*(2/5)-(eyeFilterWidth/2))+right_result[1];
left_eye_position[0] = Math.round(x+(w/4)-(eyeFilterWidth/2))+left_result[0];
left_eye_position[1] = Math.round(y+h*(2/5)-(eyeFilterWidth/2))+left_result[1];
nose_position[0] = Math.round(x+(w/2)-(noseFilterWidth/2))+nose_result[0];
nose_position[1] = Math.round(y+h*(5/8)-(noseFilterWidth/2))+nose_result[1];
// drawDetection(debugCC, candidate, [left_eye_position, right_eye_positions, nose_position]);
// get eye and nose positions of model
var lep = model.hints.leftEye;
var rep = model.hints.rightEye;
var mep = model.hints.nose;
// get scaling, rotation, etc. via procrustes analysis
var procrustes_params = procrustes([left_eye_position, right_eye_position, nose_position], [lep, rep, mep]);
translateX = procrustes_params[0];
translateY = procrustes_params[1];
scaling = procrustes_params[2];
rotation = procrustes_params[3];
// drawFacialPoints(debugCC, [lep, rep, mep], procrustes_params);
} else {
// drawBoundingBox(debugCC, [x,y,w,h]);
scaling = w/msmodelheight;
rotation = 0;
translateX = x-(msxmin*scaling)+0.1*w;
translateY = y-(msymin*scaling)+0.25*h;
}
return [scaling, rotation, translateX, translateY];
};
// get initial starting point for model
this.getInitialPosition = function(box) {
return new Promise(function(resolve, reject) {
getBoundingBox(box)
.then(getFinegrainedPosition)
.then(resolve)
.catch(reject);
});
};
// procrustes analysis
function procrustes(template, shape) {
// assume template and shape is a vector of x,y-coordinates
//i.e. template = [[x1,y1], [x2,y2], [x3,y3]];
var templateClone = [];
var shapeClone = [];
for (var i = 0;i < template.length;i++) {
templateClone[i] = [template[i][0], template[i][1]];
}
for (var i = 0;i < shape.length;i++) {
shapeClone[i] = [shape[i][0], shape[i][1]];
}
shape = shapeClone;
template = templateClone;
// calculate translation
var templateMean = [0.0, 0.0];
for (var i = 0;i < template.length;i++) {
templateMean[0] += template[i][0];
templateMean[1] += template[i][1];
}
templateMean[0] /= template.length;
templateMean[1] /= template.length;
var shapeMean = [0.0, 0.0];
for (var i = 0;i < shape.length;i++) {
shapeMean[0] += shape[i][0];
shapeMean[1] += shape[i][1];
}
shapeMean[0] /= shape.length;
shapeMean[1] /= shape.length;
var translationX = templateMean[0] - shapeMean[0];
var translationY = templateMean[1] - shapeMean[1];
// centralize
for (var i = 0;i < shape.length;i++) {
shape[i][0] -= shapeMean[0];
shape[i][1] -= shapeMean[1];
}
for (var i = 0;i < template.length;i++) {
template[i][0] -= templateMean[0];
template[i][1] -= templateMean[1];
}
// scaling
var scaleS = 0.0;
for (var i = 0;i < shape.length;i++) {
scaleS += ((shape[i][0])*(shape[i][0]));
scaleS += ((shape[i][1])*(shape[i][1]));
}
scaleS = Math.sqrt(scaleS/shape.length);
var scaleT = 0.0;
for (var i = 0;i < template.length;i++) {
scaleT += ((template[i][0])*(template[i][0]));
scaleT += ((template[i][1])*(template[i][1]));
}
scaleT = Math.sqrt(scaleT/template.length);
var scaling = scaleT/scaleS;
for (var i = 0;i < shape.length;i++) {
shape[i][0] *= scaling;
shape[i][1] *= scaling;
}
// rotation
var top = 0.0;
var bottom = 0.0;
for (var i = 0;i < shape.length;i++) {
top += (shape[i][0]*template[i][1] - shape[i][1]*template[i][0]);
bottom += (shape[i][0]*template[i][0] + shape[i][1]*template[i][1]);
}
var rotation = Math.atan(top/bottom);
translationX += (shapeMean[0]-(scaling*Math.cos(-rotation)*shapeMean[0])-(scaling*shapeMean[1]*Math.sin(-rotation)));
translationY += (shapeMean[1]+(scaling*Math.sin(-rotation)*shapeMean[0])-(scaling*shapeMean[1]*Math.cos(-rotation)));
return [translationX, translationY, scaling, rotation];
}
};
// simple wrapper for jsfeat face detector that can run as a webworker
var jsfeat_face = function(parameters) {
var params = parameters;
var maxWorkSize = params.workSize;
var useWebWorkers = params.useWebWorkers;
var work_canvas = document.createElement('canvas');
var work_ctx = work_canvas.getContext('2d');
var videoWidth, videoHeight, scale, video, w, h;
var img_u8, edg, ii_sum, ii_sqsum, ii_tilted, ii_canny, classifier;
var worker;
if (useWebWorkers) {
Worker.createURL = function(func_or_string) {
var str = (typeof func_or_string === 'function')?func_or_string.toString():func_or_string;
str = str.replace("'FRONTALFACE_PLACEHOLDER'", JSON.stringify(jsfeat_1.haar.frontalface));
var blob = new Blob(['\'use strict\';\nself.onmessage ='+str], { type: 'text/javascript' });
return window.URL.createObjectURL(blob);
};
Worker.create = function(func_or_string) {
return new Worker(Worker.createURL(func_or_string));
};
worker = Worker.create(findFaceWorker);
}
this.init = function(element) {
video = element;
videoWidth = video.width;
videoHeight = video.height;
// scale down canvas we do detection on (to reduce noisy detections)
scale = Math.min(maxWorkSize/videoWidth, maxWorkSize/videoHeight);
w = (videoWidth*scale)|0;
h = (videoHeight*scale)|0;
work_canvas.height = h;
work_canvas.width = w;
if (!useWebWorkers) {
img_u8 = new jsfeat_1.matrix_t(w, h, jsfeat_1.U8_t | jsfeat_1.C1_t);
edg = new jsfeat_1.matrix_t(w, h, jsfeat_1.U8_t | jsfeat_1.C1_t);
ii_sum = new Int32Array((w+1)*(h+1));
ii_sqsum = new Int32Array((w+1)*(h+1));
ii_tilted = new Int32Array((w+1)*(h+1));
ii_canny = new Int32Array((w+1)*(h+1));
classifier = jsfeat_1.haar.frontalface;
}
};
this.findFace = function () {
work_ctx.drawImage(video, 0, 0, work_canvas.width, work_canvas.height);
var imageData = work_ctx.getImageData(0, 0, work_canvas.width, work_canvas.height);
return new Promise(function(resolve, reject) {
if (useWebWorkers) {
worker.addEventListener('message', function (e) {
if (e.data.faces.length > 0) {
resolve(e.data.faces[0]);
} else {
reject();
}
}.bind(this), false);
worker.postMessage({
w: work_canvas.width,
h: work_canvas.height,
videoWidth: videoWidth,
imageData:imageData,
params: params
});
} else {
jsfeat_1.imgproc.grayscale(imageData.data, work_canvas.width, work_canvas.height, img_u8);
// possible params
if(params.equalizeHistogram) {
jsfeat_1.imgproc.equalize_histogram(img_u8, img_u8);
}
//jsfeat.imgproc.gaussian_blur(img_u8, img_u8, 3);
jsfeat_1.imgproc.compute_integral_image(img_u8, ii_sum, ii_sqsum, classifier.tilted ? ii_tilted : null);
if(params.useCanny) {
jsfeat_1.imgproc.canny(img_u8, edg, 10, 50);
jsfeat_1.imgproc.compute_integral_image(edg, ii_canny, null, null);
}
jsfeat_1.haar.edgesDensity = params.edgesDensity;
var rects = jsfeat_1.haar.detect_multi_scale(ii_sum, ii_sqsum, ii_tilted, params.useCanny? ii_canny : null, img_u8.cols, img_u8.rows, classifier, params.scaleFactor, params.minScale);
rects = jsfeat_1.haar.group_rectangles(rects, params.min_neighbors);
for (var i = rects.length-1;i >= 0;i--) {
if (rects[i].confidence < params.confidenceThreshold) {
rects.splice(i,1);
}
}
var rl = rects.length;
if (rl == 0) {
reject();
} else {
var best = rects[0];
for (var i = 1; i < rl; i++) {
if (rects[i].neighbors > best.neighbors) {
best = rects[i];
} else if (rects[i].neighbors == best.neighbors) {
// if (rects[i].width > best.width) best = rects[i]; // use biggest rect
if (rects[i].confidence > best.confidence) best = rects[i]; // use most confident rect
}
}
var sc = videoWidth / img_u8.cols;
best.x = (best.x*sc)|0;
best.y = (best.y*sc)|0;
best.width = (best.width*sc)|0;
best.height = (best.height*sc)|0;
resolve(best);
}
}
});
};
};
/**
* Fast Fourier Transform
* 1D-FFT/IFFT, 2D-FFT/IFFT (radix-2)
*
* @author ryo / github.com/wellflat
* Based on https://github.com/wellflat/javascript-labs with some tiny optimizations
*/
function FFT$1() {
var _n = 0, // order
_bitrev = null, // bit reversal table
_cstb = null; // sin/cos table
var _tre, _tim;
this.init = function (n) {
if(n !== 0 && (n & (n - 1)) === 0) {
_n = n;
_setVariables();
_makeBitReversal();
_makeCosSinTable();
} else {
throw new Error('init: radix-2 required');
}
};
// 1D-FFT
this.fft1d = function (re, im) {
fft(re, im, 1);
};
// 1D-IFFT
this.ifft1d = function (re, im) {
var n = 1/_n;
fft(re, im, -1);
for(var i=0; i<_n; i++) {
re[i] *= n;
im[i] *= n;
}
};
// 2D-FFT
this.fft2d = function (re, im) {
var i = 0;
// x-axis
for(var y=0; y<_n; y++) {
i = y*_n;
for(var x1=0; x1<_n; x1++) {
_tre[x1] = re[x1 + i];
_tim[x1] = im[x1 + i];
}
this.fft1d(_tre, _tim);
for(var x2=0; x2<_n; x2++) {
re[x2 + i] = _tre[x2];
im[x2 + i] = _tim[x2];
}
}
// y-axis
for(var x=0; x<_n; x++) {
for(var y1=0; y1<_n; y1++) {
i = x + y1*_n;
_tre[y1] = re[i];
_tim[y1] = im[i];
}
this.fft1d(_tre, _tim);
for(var y2=0; y2<_n; y2++) {
i = x + y2*_n;
re[i] = _tre[y2];
im[i] = _tim[y2];
}
}
};
// 2D-IFFT
this.ifft2d = function (re, im) {
var i = 0;
// x-axis
for(var y=0; y<_n; y++) {
i = y*_n;
for(var x1=0; x1<_n; x1++) {
_tre[x1] = re[x1 + i];
_tim[x1] = im[x1 + i];
}
this.ifft1d(_tre, _tim);
for(var x2=0; x2<_n; x2++) {
re[x2 + i] = _tre[x2];
im[x2 + i] = _tim[x2];
}
}
// y-axis
for(var x=0; x<_n; x++) {
for(var y1=0; y1<_n; y1++) {
i = x + y1*_n;
_tre[y1] = re[i];
_tim[y1] = im[i];
}
this.ifft1d(_tre, _tim);
for(var y2=0; y2<_n; y2++) {
i = x + y2*_n;
re[i] = _tre[y2];
im[i] = _tim[y2];
}
}
};
// 2D-IFFT, real-valued
// only outputs the real valued part
this.real_ifft2d = function (re, im) {
var i2;
var i = 0;
// x-axis
for(var y=0; y<_n; y++) {
i = y*_n;
for(var x1=0; x1<_n; x1++) {
_tre[x1] = re[x1 + i];
_tim[x1] = im[x1 + i];
}
this.ifft1d(_tre, _tim);
for(var x2=0; x2<_n; x2++) {
re[x2 + i] = _tre[x2];
im[x2 + i] = _tim[x2];
}
}
// y-axis
var halfn = _n/2;
var rowIdx = 0;
for(var x=0; x<_n; x+=2) {
//untangle
i = x;
i2 = x+1;
_tre[0] = re[0 + i];
_tim[0] = re[0 + i2];
_tre[_n/2] = re[(halfn*_n) + i];
_tim[_n/2] = re[(halfn*_n) + i2];
for (var x2=1;x2<halfn;x2++) {
rowIdx = x2*_n;
_tre[x2] = re[rowIdx+i] - im[rowIdx + i2];
_tre[_n - x2] = re[rowIdx+i] + im[rowIdx + i2];
_tim[x2] = im[rowIdx+i] + re[rowIdx+i2];
_tim[_n - x2] = re[rowIdx+i2] - im[rowIdx+i];
}
this.ifft1d(_tre, _tim);
for(var y2=0; y2<_n; y2++) {
i = x + y2*_n;
i2 = (x + 1) + y2*_n;
re[i] = _tre[y2];
re[i2] = _tim[y2];
}
}
};
// 2D-FFT, real-valued only
// ignores the imaginary input
// see:
// http://www.inf.fu-berlin.de/lehre/SS12/SP-Par/download/fft1.pdf
// http://cnx.org/content/m12021/latest/
// http://images.apple.com/acg/pdf/g4fft.pdf
// http://www.ti.com/lit/an/spra291/spra291.pdf
this.real_fft2d = function (re, im) {
var i = 0, i2 = 0;
// x-axis
for(var y=0; y<_n; y += 2) {
i = y*_n;
i2 = (y+1)*_n;
// tangle
for(var x1=0; x1<_n; x1++) {
_tre[x1] = re[x1 + i];
_tim[x1] = re[x1 + i2];
}
this.fft1d(_tre, _tim);
// untangle
re[0 + i] = _tre[0];
re[0 + i2] = _tim[0];
im[0 + i] = 0;
im[0 + i2] = 0;
re[_n/2 + i] = _tre[_n/2];
re[_n/2 + i2] = _tim[_n/2];
im[_n/2 + i] = 0;
im[_n/2 + i2] = 0;
for(var x2=1;x2<(_n/2);x2++) {
re[x2 + i] = 0.5 * (_tre[x2] + _tre[_n - x2]);
im[x2 + i] = 0.5 * (_tim[x2] - _tim[_n - x2]);
re[x2 + i2] = 0.5 * (_tim[x2] + _tim[_n - x2]);
im[x2 + i2] = -0.5 * (_tre[x2] - _tre[_n - x2]);
re[(_n-x2) + i] = re[x2 + i];
im[(_n-x2) + i] = -im[x2 + i];
re[(_n-x2) + i2] = re[x2 + i2];
im[(_n-x2) + i2] = -im[x2 + i2];
}
}
// y-axis
for(var x=0; x<_n; x++) {
for(var y1=0; y1<_n; y1++) {
i = x + y1*_n;
_tre[y1] = re[i];
_tim[y1] = im[i];
}
this.fft1d(_tre, _tim);
for(var y2=0; y2<_n; y2++) {
i = x + y2*_n;
re[i] = _tre[y2];
im[i] = _tim[y2];
}
}
};
// core operation of FFT
function fft(re, im, inv) {
var d, h, ik, m, tmp, wr, wi, xr, xi,
n4 = _n >> 2;
// bit reversal
for(var l=0; l<_n; l++) {
m = _bitrev[l];
if(l < m) {
tmp = re[l];
re[l] = re[m];
re[m] = tmp;
tmp = im[l];
im[l] = im[m];
im[m] = tmp;
}
}
// butterfly operation
//butfly(re,im,inv,n4);
for(var k=1; k<_n; k<<=1) {
h = 0;
d = _n/(k << 1);
for(var j=0; j<k; j++) {
wr = _cstb[h + n4];
wi = inv*_cstb[h];
for(var i=j; i<_n; i+=(k<<1)) {
ik = i + k;
xr = wr*re[ik] + wi*im[ik];
xi = wr*im[ik] - wi*re[ik];
re[ik] = re[i] - xr;
re[i] += xr;
im[ik] = im[i] - xi;
im[i] += xi;
}
h += d;
}
}
}
function _setVariables() {
if(typeof Uint8Array !== 'undefined') {
_bitrev = new Uint8Array(_n);
} else {
_bitrev = new Array(_n);
}
if(typeof Float64Array !== 'undefined') {
_cstb = new Float64Array(_n*1.25);
_tre = new Float64Array(_n);
_tim = new Float64Array(_n);
} else {
_cstb = new Array(_n*1.25);
_tre = new Array(_n);
_tim = new Array(_n);
}
}
// make bit reversal table
function _makeBitReversal() {
var i = 0,
j = 0,
k = 0;
_bitrev[0] = 0;
while(++i < _n) {
k = _n >> 1;
while(k <= j) {
j -= k;
k >>= 1;
}
j += k;
_bitrev[i] = j;
}
}
// make trigonometric function table
function _makeCosSinTable() {
var n2 = _n >> 1,
n4 = _n >> 2,
n8 = _n >> 3,
n2p4 = n2 + n4,
t = Math.sin(Math.PI/_n),
dc = 2*t*t,
ds = Math.sqrt(dc*(2 - dc)),
c = _cstb[n4] = 1,
s = _cstb[0] = 0;
t = 2*dc;
for(var i=1; i<n8; i++) {
c -= dc;
dc += t*c;
s += ds;
ds -= t*s;
_cstb[i] = s;
_cstb[n4 - i] = c;
}
if(n8 !== 0) {
_cstb[n8] = Math.sqrt(0.5);
}
for(var j=0; j<n4; j++) {
_cstb[n2 - j] = _cstb[j];
}
for(var k=0; k<n2p4; k++) {
_cstb[k + n2] = -_cstb[k];
}
}
}
var svmFilter = function() {
var _fft, fft_filters, responses, biases;
var fft_size, filterLength, filter_width, search_width, num_patches;
var temp_imag_part, temp_real_part;
// fft function
this.fft_inplace = function(array, _im_part) {
// in-place
if (typeof _im_part == 'undefined') {
_im_part = temp_imag_part;
}
for (var i = 0;i < filterLength;i++) {
_im_part[i] = 0.0;
}
_fft.real_fft2d(array,_im_part);
return [array, _im_part];
};
this.ifft = function(rn, cn) {
// in-place
_fft.real_ifft2d(rn, cn);
return rn;
};
var complex_mult_inplace = function(cn1, cn2) {
// in-place, cn1 is the one modified
var temp1, temp2;
for (var r = 0;r < filterLength;r++) {
temp1 = (cn1[0][r]*cn2[0][r]) - (cn1[1][r]*cn2[1][r]);
temp2 = (cn1[0][r]*cn2[1][r]) + (cn1[1][r]*cn2[0][r]);
cn1[0][r] = temp1;
cn1[1][r] = temp2;
}
};
this.init = function(filter_input, bias_input, numPatches, filterWidth, searchWidth) {
// calculate needed size of fft (has to be power of two)
fft_size = upperPowerOfTwo(filterWidth-1+searchWidth);
filterLength = fft_size*fft_size;
_fft = new FFT$1();
_fft.init(fft_size);
fft_filters = Array(numPatches);
var fft_filter;
var edge = (filterWidth-1)/2;
for (var i = 0;i < numPatches;i++) {
var flar_fi0 = new Float64Array(filterLength);
var flar_fi1 = new Float64Array(filterLength);
// load filter
var xOffset, yOffset;
for (var j = 0;j < filterWidth;j++) {
for (var k = 0;k < filterWidth;k++) {
// TODO : rotate filter
xOffset = k < edge ? (fft_size-edge) : (-edge);
yOffset = j < edge ? (fft_size-edge) : (-edge);
flar_fi0[k+xOffset+((j+yOffset)*fft_size)] = filter_input[i][(filterWidth-1-j)+((filterWidth-1-k)*filterWidth)];
/*xOffset = k < edge ? (fft_size-edge) : (-edge);
yOffset = j < edge ? (fft_size-edge) : (-edge);
flar_fi0[k+xOffset+((j+yOffset)*fft_size)] = filter_input[i][k+(j*filterWidth)];*/
//console.log(k + ','+ j+':' + (k+xOffset+((j+yOffset)*fft_size)))
}
}
// fft it and store
fft_filter = this.fft_inplace(flar_fi0, flar_fi1);
fft_filters[i] = fft_filter;
}
// set up biases
biases = new Float64Array(numPatches);
for (var i = 0;i < numPatches;i++) {
biases[i] = bias_input[i];
}
responses = Array(numPatches);
temp_imag_part = Array(numPatches);
for (var i = 0;i < numPatches;i++) {
responses[i] = new Float64Array(searchWidth*searchWidth);
temp_imag_part[i] = new Float64Array(searchWidth*searchWidth);
}
temp_real_part = new Float64Array(filterLength);
num_patches = numPatches;
filter_width = filterWidth;
search_width = searchWidth;
};
this.getResponses = function(patches) {
var response, edge;
var patch_width = filter_width-1+search_width;
for (var i = 0;i < num_patches;i++) {
// reset zeroes in temp_real_part
for (var j = 0;j < fft_size*fft_size;j++) {
temp_real_part[j] = 0.0;
}
// normalize patches to 0-1
patches[i] = normalizePatches(patches[i]);
// patch must be padded (with zeroes) to match fft size
for (var j = 0;j < patch_width;j++) {
for (var k = 0;k < patch_width;k++) {
temp_real_part[j + (fft_size*k)] = patches[i][k + (patch_width*j)];
}
}
//drawData(document.getElementById('sketch').getContext('2d'), temp_real_part, 32, 32, false, 0, 0);
// fft it
response = this.fft_inplace(temp_real_part);
// multiply pointwise with filter
complex_mult_inplace(response, fft_filters[i]);
// inverse fft it
response = this.ifft(response[0], response[1]);
// crop out edges
edge = (filter_width-1)/2;
for (var j = 0;j < search_width;j++) {
for (var k = 0;k < search_width;k++) {
responses[i][j + (k*search_width)] = response[edge + k + ((j+edge)*(fft_size))];
}
}
// add bias
for (var j = 0;j < search_width*search_width;j++) {
responses[i][j] += biases[i];
}
// logistic transformation
responses[i] = logisticResponse(responses[i]);
/*responses[i] = new Float64Array(32*32)
for (var j = 0;j < 32;j++) {
for (var k = 0;k < 32;k++) {
responses[i][k + (j*(32))] = response[k + (j*(32))]
}
}*/
// normalization?
inplaceNormalizeFilterMatrix(responses[i]);
}
return responses;
};
var normalizePatches = function(patch) {
var patch_width = filter_width-1+search_width;
var max = 0;
var min = 1000;
var value;
for (var j = 0;j < patch_width;j++) {
for (var k = 0;k < patch_width;k++) {
value = patch[k + (patch_width*j)];
if (value < min) {
min = value;
}
if (value > max) {
max = value;
}
}
}
var scale = max-min;
for (var j = 0;j < patch_width;j++) {
for (var k = 0;k < patch_width;k++) {
patch[k + (patch_width*j)] = (patch[k + (patch_width*j)]-min)/scale;
}
}
return patch;
};
var logisticResponse = function(response) {
// create probability by doing logistic transformation
for (var j = 0;j < search_width;j++) {
for (var k = 0;k < search_width;k++) {
response[j + (k*search_width)] = 1.0/(1.0 + Math.exp(- (response[j + (k*search_width)] - 1.0 )));
}
}
return response;
};
var upperPowerOfTwo = function(x) {
x--;
x |= x >> 1;
x |= x >> 2;
x |= x >> 4;
x |= x >> 8;
x |= x >> 16;
x++;
return x;
};
var inplaceNormalizeFilterMatrix = function(response) {
// normalize responses to lie within [0,1]
var msize = response.length;
var max = 0;
var min = 1;
for (var i = 0;i < msize;i++) {
max = response[i] > max ? response[i] : max;
min = response[i] < min ? response[i] : min;
}
var dist = max-min;
if (dist == 0) {
//console.log('a patchresponse was monotone, causing normalization to fail. Leaving it unchanged.');
} else {
for (var i = 0;i < msize;i++) {
response[i] = (response[i]-min)/dist;
}
}
};
};
var webglUtils = createCommonjsModule(function (module, exports) {
// This code is based on webgl-utils.js authored by Gregg Tavares, license below:
/*
* Copyright (c) 2011, Gregg Tavares
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of greggman.com nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function(){
var LOGGING_ENABLED = true;
/**
* Wrapped logging function.
* @param {string} msg The message to log.
*/
const log = function (msg) {
if (!LOGGING_ENABLED) { return; }
if (window.console && window.console.log) {
window.console.log(msg);
}
};
/**
* Wrapped logging function.
* @param {string} msg The message to log.
*/
const error = function (msg) {
if (!LOGGING_ENABLED) { return; }
if (window.console) {
if (window.console.error) {
window.console.error(msg);
} else if (window.console.log) {
window.console.log(msg);
}
}
throw msg;
};
/**
* Turn off all logging.
*/
const loggingOff = function () {
LOGGING_ENABLED = false;
};
/**
* Check if the page is embedded.
* @return {boolean} True of we are in an iframe
*/
const isInIFrame = function () {
return window !== window.top;
};
/**
* Converts a WebGL enum to a string
* @param {!WebGLContext} gl The WebGLContext to use.
* @param {number} value The enum value.
* @return {string} The enum as a string.
*/
const glEnumToString = function (gl, value) {
for (var p in gl) {
if (gl[p] === value) {
return p;
}
}
return '0x' + value.toString(16);
};
/**
* Creates the HTLM for a failure message
* @param {string} canvasContainerId id of container of th
* canvas.
* @return {string} The html.
*/
const makeFailHTML = function (msg) {
return '' +
'<table style="background-color: #8CE; width: 100%; height: 100%;"><tr>' +
'<td align="center">' +
'<div style="display: table-cell; vertical-align: middle;">' +
'<div style="">' + msg + '</div>' +
'</div>' +
'</td></tr></table>';
};
/**
* Mesasge for getting a webgl browser
* @type {string}
*/
// const GET_A_WEBGL_BROWSER = '' +
// 'This page requires a browser that supports WebGL.<br/>' +
// '<a href="http://get.webgl.org">Click here to upgrade your browser.</a>';
/**
* Mesasge for need better hardware
* @type {string}
*/
// const OTHER_PROBLEM = '' +
// "It doesn't appear your computer can support WebGL.<br/>" +
// '<a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>';
/**
* Creates a webgl context. If creation fails it will
* change the contents of the container of the <canvas>
* tag to an error message with the correct links for WebGL.
* @param {Element} canvas. The canvas element to create a
* context from.
* @param {WebGLContextCreationAttirbutes} optAttribs Any
* creation attributes you want to pass in.
* @return {WebGLRenderingContext} The created context.
*/
const setupWebGL = function (canvas, optAttribs) {
// const showLink = function (str) {
// var container = canvas.parentNode;
// if (container) {
// container.innerHTML = makeFailHTML(str);
// }
// };
if (!window.WebGLRenderingContext) {
// showLink(GET_A_WEBGL_BROWSER);
return null;
}
var context = create3DContext(canvas, optAttribs);
if (!context) {
// showLink(OTHER_PROBLEM);
return null;
}
return context;
};
/**
* Creates a webgl context.
* @param {!Canvas} canvas The canvas tag to get context
* from. If one is not passed in one will be created.
* @return {!WebGLContext} The created context.
*/
const create3DContext = function (canvas, optAttribs) {
var names = ['webgl', 'experimental-webgl'];
var context = null;
for (var ii = 0; ii < names.length; ++ii) {
try {
context = canvas.getContext(names[ii], optAttribs);
} catch (e) {}
if (context) {
break;
}
}
return context;
};
const updateCSSIfInIFrame = function () {
if (isInIFrame()) {
document.body.className = 'iframe';
}
};
/**
* Gets a WebGL context.
* makes its backing store the size it is displayed.
*/
const getWebGLContext = function (canvas) {
if (isInIFrame()) {
updateCSSIfInIFrame();
// make the canvas backing store the size it's displayed.
canvas.width = canvas.clientWidth;
canvas.height = canvas.clientHeight;
}
var gl = setupWebGL(canvas);
return gl;
};
/**
* Loads a shader.
* @param {!WebGLContext} gl The WebGLContext to use.
* @param {string} shaderSource The shader source.
* @param {number} shaderType The type of shader.
* @param {function(string): void) optErrorCallback callback for errors.
* @return {!WebGLShader} The created shader.
*/
const loadShader = function (gl, shaderSource, shaderType, optErrorCallback) {
var errFn = optErrorCallback || error;
// Create the shader object
var shader = gl.createShader(shaderType);
// Load the shader source
gl.shaderSource(shader, shaderSource);
// Compile the shader
gl.compileShader(shader);
// Check the compile status
var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
if (!compiled) {
// Something went wrong during compilation; get the error
var lastError = gl.getShaderInfoLog(shader);
errFn("*** Error compiling shader '" + shader + "':" + lastError);
gl.deleteShader(shader);
return null;
}
return shader;
};
/**
* Creates a program, attaches shaders, binds attrib locations, links the
* program and calls useProgram.
* @param {!Array.<!WebGLShader>} shaders The shaders to attach
* @param {!Array.<string>} optAttribs The attribs names.
* @param {!Array.<number>} optLocations The locations for the attribs.
*/
const loadProgram = function (gl, shaders, optAttribs, optLocations) {
var program = gl.createProgram();
for (var i = 0; i < shaders.length; ++i) {
gl.attachShader(program, shaders[i]);
}
if (optAttribs) {
for (var i = 0; i < optAttribs.length; ++i) {
gl.bindAttribLocation(
program,
optLocations ? optLocations[i] : i,
optAttribs[i]);
}
}
gl.linkProgram(program);
// Check the link status
const linked = gl.getProgramParameter(program, gl.LINK_STATUS);
if (!linked) {
// something went wrong with the link
const lastError = gl.getProgramInfoLog(program);
error('Error in program linking:' + lastError);
gl.deleteProgram(program);
return null;
}
return program;
};
/**
* Loads a shader from a script tag.
* @param {!WebGLContext} gl The WebGLContext to use.
* @param {string} scriptId The id of the script tag.
* @param {number} optShaderType The type of shader. If not passed in it will
* be derived from the type of the script tag.
* @param {function(string): void) optErrorCallback callback for errors.
* @return {!WebGLShader} The created shader.
*/
const createShaderFromScript = function (
gl, scriptId, optShaderType, optErrorCallback
) {
var shaderSource = '';
var shaderType;
var shaderScript = document.getElementById(scriptId);
if (!shaderScript) {
throw new Error('*** Error: unknown script element' + scriptId);
}
shaderSource = shaderScript.text;
if (!optShaderType) {
if (shaderScript.type === 'x-shader/x-vertex') {
shaderType = gl.VERTEX_SHADER;
} else if (shaderScript.type === 'x-shader/x-fragment') {
shaderType = gl.FRAGMENT_SHADER;
} else if (
shaderType !== gl.VERTEX_SHADER &&
shaderType !== gl.FRAGMENT_SHADER
) {
throw new Error('*** Error: unknown shader type');
}
}
return loadShader(
gl,
shaderSource,
optShaderType || shaderType,
optErrorCallback
);
};
{
module.exports = {
setupWebGL : setupWebGL,
createProgram : loadProgram,
createShaderFromScript : createShaderFromScript,
getWebGLContext : getWebGLContext,
loadShader : loadShader
};
}
}());
});
var webglUtils_1 = webglUtils.setupWebGL;
var webglUtils_2 = webglUtils.createProgram;
var webglUtils_5 = webglUtils.loadShader;
var webglFilter = function() {
/*
* Textures:
* 0 : raw filter
* 1 : patches
* 2 : finished response
* 3 : grad/lbp treated patches
* 4 : sobel filter
* 5 : lbp filter
*
* Routing:
* ( ) 0/4/5 --\
* ( ) _\|
* 1 ----> ( ---------->3 ) ----------> 2
* lbpResponse/ patchResponse
* gradientResponse
*/
var gl, canvas;
var filterWidth, filterHeight, patchWidth, patchHeight, numPatches, canvasWidth, canvasHeight;
var patchResponseProgram, patchDrawProgram;
var fbo, numBlocks, patchTex;
var drawRectBuffer, drawLayerBuffer, drawImageBuffer, rttTexture;
var texCoordBuffer, texCoordLocation, apositionBuffer;
var newCanvasWidth, newCanvasBlockHeight, newCanvasHeight;
var drawOutRectangles, drawOutImages, drawOutLayer;
var patchCells, textureWidth, textureHeight, patchSize, patchArray;
var biases;
var lbpResponseProgram;
var lbpTexCoordLocation, lbpTexCoordBuffer, lbpPositionLocation, lbpAPositionBuffer;
var gradientResponseProgram;
var gbo, gradTexCoordLocation, gradTexCoordBuffer, gradPositionLocation, gradAPositionBuffer;
var lbpInit = false;
var sobelInit = false;
var rawInit = false;
var lbpResponseVS = [
'attribute vec2 a_texCoord;',
'attribute vec2 a_position;',
'',
'varying vec2 v_texCoord;',
'',
'void main() {',
' // transform coordinates to regular coordinates',
' gl_Position = vec4(a_position,0.0,1.0);',
' ',
' // pass the texCoord to the fragment shader',
' v_texCoord = a_texCoord;',
'}'
].join('\n');
var lbpResponseFS;
var gradientResponseVS = [
'attribute vec2 a_texCoord;',
'attribute vec2 a_position;',
'',
'varying vec2 v_texCoord;',
'',
'void main() {',
' // transform coordinates to regular coordinates',
' gl_Position = vec4(a_position,0.0,1.0);',
' ',
' // pass the texCoord to the fragment shader',
' v_texCoord = a_texCoord;',
'}'
].join('\n');
var gradientResponseFS;
var patchResponseVS;
var patchResponseFS;
var drawResponsesVS = [
'attribute vec2 a_texCoord_draw;',
'attribute vec2 a_position_draw;',
'attribute float a_patchChoice_draw;',
'',
'uniform vec2 u_resolutiondraw;',
'',
'varying vec2 v_texCoord;',
'varying float v_select;',
'',
'void main() {',
' // convert the rectangle from pixels to 0.0 to 1.0',
' vec2 zeroToOne = a_position_draw / u_resolutiondraw;',
'',
' // convert from 0->1 to 0->2',
' vec2 zeroToTwo = zeroToOne * 2.0;',
'',
' // convert from 0->2 to -1->+1 (clipspace)',
' vec2 clipSpace = zeroToTwo - 1.0;',
' ',
' // transform coordinates to regular coordinates',
' gl_Position = vec4(clipSpace * vec2(1.0, 1.0), 0, 1);',
'',
' // pass the texCoord to the fragment shader',
' v_texCoord = a_texCoord_draw;',
' ',
' v_select = a_patchChoice_draw;',
'}'
].join('\n');
var drawResponsesFS = [
'precision mediump float;',
'',
'// our responses',
'uniform sampler2D u_responses;',
'',
'// the texCoords passed in from the vertex shader.',
'varying vec2 v_texCoord;',
'varying float v_select;',
'',
'const vec4 bit_shift = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);',
'const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);',
'',
'// packing code from here http://stackoverflow.com/questions/9882716/packing-float-into-vec4-how-does-this-code-work',
'void main() {',
' vec4 colorSum = texture2D(u_responses, v_texCoord);',
' float value = 0.0;',
' if (v_select < 0.1) {',
' value = colorSum[0];',
' } else if (v_select > 0.9 && v_select < 1.1) {',
' value = colorSum[1];',
' } else if (v_select > 1.9 && v_select < 2.1) {',
' value = colorSum[2];',
' } else if (v_select > 2.9 && v_select < 3.1) {',
' value = colorSum[3];',
' } else {',
' value = 1.0;',
' }',
' ',
' vec4 res = fract(value * bit_shift);',
' res -= res.xxyz * bit_mask;',
' ',
' //gl_FragColor = vec4(value, value, value, value);',
' //gl_FragColor = vec4(1.0, value, 1.0, 1.0);',
' gl_FragColor = res;',
'}'
].join('\n');
this.init = function(filters, bias, nP, pW, pH, fW, fH) {
// we assume filterVector goes from left to right, rowwise, i.e. row-major order
if (fW != fH) {
alert('filter width and height must be same size!');
return;
}
// if filter width is not odd, alert
if (fW % 2 == 0 || fH % 2 == 0) {
alert('filters used in svm must be of odd dimensions!');
return;
}
// setup variables
biases = bias;
filterWidth = fW;
filterHeight = fH;
patchWidth = pW;
patchHeight = pH;
numPatches = nP;
numBlocks = Math.floor(numPatches / 4) + Math.ceil((numPatches % 4)/4);
canvasWidth = patchWidth;
canvasHeight = patchHeight*numBlocks;
newCanvasWidth = patchWidth-filterWidth+1;
newCanvasBlockHeight = patchHeight-filterWidth+1;
newCanvasHeight = newCanvasBlockHeight*numPatches;
patchCells = (Math.floor(numPatches / 4) + Math.ceil((numPatches % 4)/4));
textureWidth = patchWidth;
textureHeight = patchHeight*patchCells;
patchSize = patchWidth*patchHeight;
patchArray = new Float32Array(patchSize*patchCells*4);
var opp = [1/patchWidth, 1/(patchHeight*numBlocks)];
// write out shaders
patchResponseFS = [
'precision mediump float;',
'',
'const vec2 u_onePixelPatches = vec2('+(1/patchWidth).toFixed(10)+','+(1/(patchHeight*numBlocks)).toFixed(10)+');',
'const vec2 u_onePixelFilters = vec2('+(1/filterWidth).toFixed(10)+','+(1/(filterHeight*numBlocks)).toFixed(10)+');',
'const float u_halffilterwidth = '+((filterWidth-1.0)/2).toFixed(1)+';',
'const float u_halffilterheight = '+((filterHeight-1.0)/2).toFixed(1)+';',
'',
'// our patches',
'uniform sampler2D u_patches;',
'// our filters',
'uniform sampler2D u_filters;',
'',
'// the texCoords passed in from the vertex shader.',
'varying vec2 v_texCoord;',
'varying vec2 v_texCoordFilters; // this should give us correct filter',
'',
'void main() {',
' vec4 colorSum = vec4(0.0, 0.0, 0.0, 0.0);',
' vec4 maxn = vec4(0.0, 0.0, 0.0, 0.0);',
' vec4 minn = vec4(256.0, 256.0, 256.0, 256.0);',
' vec4 scale = vec4(0.0, 0.0, 0.0, 0.0);',
' vec4 patchValue = vec4(0.0, 0.0, 0.0, 0.0);',
' vec4 filterValue = vec4(0.0, 0.0, 0.0, 0.0);',
' vec4 filterTemp = vec4(0.0, 0.0, 0.0, 0.0);',
' for (int w = 0;w < '+filterWidth+';w++) {',
' for (int h = 0;h < '+filterHeight+';h++) {',
' patchValue = texture2D(u_patches, v_texCoord + u_onePixelPatches * vec2(float(w)-u_halffilterwidth, float(h)-u_halffilterheight));',
' filterValue = texture2D(u_filters, v_texCoordFilters + u_onePixelFilters * vec2(float(w)-u_halffilterwidth, float(h)-u_halffilterheight));',
' maxn = max(patchValue, maxn);',
' minn = min(patchValue, minn);',
' colorSum += patchValue*filterValue;',
' filterTemp += filterValue;',
' } ',
' }',
' scale = maxn-minn;',
' colorSum = (colorSum-(minn*filterTemp))/scale;',
' // logistic transformation',
' colorSum = 1.0/(1.0 + exp(- (colorSum) ));',
' gl_FragColor = colorSum;',
'}'
].join('\n');
patchResponseVS = [
'attribute vec2 a_texCoord;',
'attribute vec2 a_position;',
'',
'const vec2 u_resolution = vec2('+canvasWidth.toFixed(1)+','+canvasHeight.toFixed(1)+');',
'const float u_patchHeight = '+(1/numBlocks).toFixed(10)+';',
'const float u_filterHeight = '+(1/numBlocks).toFixed(10)+';',
'const vec2 u_midpoint = vec2(0.5 ,'+(1/(numBlocks*2)).toFixed(10)+');',
'',
'varying vec2 v_texCoord;',
'varying vec2 v_texCoordFilters;',
'',
'void main() {',
' // convert the rectangle from pixels to 0.0 to 1.0',
' vec2 zeroToOne = a_position / u_resolution;',
'',
' // convert from 0->1 to 0->2',
' vec2 zeroToTwo = zeroToOne * 2.0;',
'',
' // convert from 0->2 to -1->+1 (clipspace)',
' vec2 clipSpace = zeroToTwo - 1.0;',
' ',
' // transform coordinates to regular coordinates',
' gl_Position = vec4(clipSpace * vec2(1.0, 1.0), 0, 1);',
' ',
' // pass the texCoord to the fragment shader',
' v_texCoord = a_texCoord;',
' ',
' // set the filtertexture coordinate based on number filter to use',
' v_texCoordFilters = u_midpoint + vec2(0.0, u_filterHeight * floor(a_texCoord[1]/u_patchHeight));',
'}'
].join('\n');
if ('lbp' in filters) {
// lbpResponseFragment
lbpResponseFS = [
'precision mediump float;',
'',
'uniform vec2 u_onePixelPatches;',
'',
'// our patches',
'uniform sampler2D u_patches;',
'',
'// the texCoords passed in from the vertex shader.',
'varying vec2 v_texCoord;',
'',
'void main() {',
' vec4 topLeft = texture2D(u_patches, v_texCoord + vec2(-'+opp[0].toFixed(5)+', -'+opp[1].toFixed(5)+'));',
' vec4 topMid = texture2D(u_patches, v_texCoord + vec2(0.0, -'+opp[1].toFixed(5)+'));',
' vec4 topRight = texture2D(u_patches, v_texCoord + vec2('+opp[0].toFixed(5)+', -'+opp[1].toFixed(5)+'));',
' vec4 midLeft = texture2D(u_patches, v_texCoord + vec2(-'+opp[0].toFixed(5)+', 0.0));',
' vec4 midMid = texture2D(u_patches, v_texCoord);',
' vec4 midRight = texture2D(u_patches, v_texCoord + vec2('+opp[0].toFixed(5)+', 0.0));',
' vec4 bottomLeft = texture2D(u_patches, v_texCoord + vec2(-'+opp[0].toFixed(5)+', '+opp[1].toFixed(5)+'));',
' vec4 bottomMid = texture2D(u_patches, v_texCoord + vec2(0.0, '+opp[1].toFixed(5)+'));',
' vec4 bottomRight = texture2D(u_patches, v_texCoord + vec2('+opp[0].toFixed(5)+', '+opp[1].toFixed(5)+'));',
' vec4 lbp = step(midMid, midRight)*1.0 + step(midMid, topRight)*2.0 + step(midMid, topMid)*4.0;',
' lbp = lbp + step(midMid, topLeft)*8.0 + step(midMid, midLeft)*16.0 + step(midMid, bottomLeft)*32.0;',
' lbp = lbp + step(midMid, bottomMid)*64.0 + step(midMid, bottomRight)*128.0;',
' gl_FragColor = lbp;',
'}'
].join('\n');
}
if ('sobel' in filters) {
// gradResponseFragment
gradientResponseFS = [
'precision mediump float;',
'',
'uniform vec2 u_onePixelPatches;',
'',
'// our patches',
'uniform sampler2D u_patches;',
'',
'// the texCoords passed in from the vertex shader.',
'varying vec2 v_texCoord;',
'',
'void main() {',
' vec4 bottomLeft = texture2D(u_patches, v_texCoord + vec2(-'+opp[0].toFixed(5)+', '+opp[1].toFixed(5)+'));',
' vec4 bottomRight = texture2D(u_patches, v_texCoord + vec2('+opp[0].toFixed(5)+', '+opp[1].toFixed(5)+'));',
' vec4 topLeft = texture2D(u_patches, v_texCoord + vec2(-'+opp[0].toFixed(5)+', -'+opp[1].toFixed(5)+'));',
' vec4 topRight = texture2D(u_patches, v_texCoord + vec2('+opp[0].toFixed(5)+', -'+opp[1].toFixed(5)+'));',
' vec4 dx = (',
' bottomLeft +',
' (texture2D(u_patches, v_texCoord + vec2(-'+opp[0].toFixed(5)+', 0.0))*vec4(2.0,2.0,2.0,2.0)) +',
' topLeft -',
' bottomRight -',
' (texture2D(u_patches, v_texCoord + vec2('+opp[0].toFixed(5)+', 0.0))*vec4(2.0,2.0,2.0,2.0)) -',
' topRight)/4.0;',
' vec4 dy = (',
' bottomLeft +',
' (texture2D(u_patches, v_texCoord + vec2(0.0, '+opp[1].toFixed(5)+'))*vec4(2.0,2.0,2.0,2.0)) +',
' bottomRight -',
' topLeft -',
' (texture2D(u_patches, v_texCoord + vec2(0.0, -'+opp[1].toFixed(5)+'))*vec4(2.0,2.0,2.0,2.0)) -',
' topRight)/4.0;',
' vec4 gradient = sqrt((dx*dx) + (dy*dy));',
' gl_FragColor = gradient;',
'}'
].join('\n');
}
//create webglcanvas
canvas = document.createElement('canvas');
canvas.setAttribute('width', (patchWidth-filterWidth+1)+'px');
canvas.setAttribute('height', ((patchHeight-filterHeight+1)*numPatches)+'px');
canvas.setAttribute('id', 'renderCanvas');
canvas.setAttribute('style', 'display:none;');
//document.body.appendChild(canvas);
gl = webglUtils_1(canvas, {
premultipliedAlpha: false,
preserveDrawingBuffer : true,
antialias : false
});
// check for float textures support and fail if not
if (!gl.getExtension('OES_texture_float')) {
alert('Your graphics card does not support floating point textures! :(');
return;
}
/** insert filters into textures **/
if ('raw' in filters) {
insertFilter(filters['raw'], gl.TEXTURE0);
rawInit = true;
}
if ('sobel' in filters) {
insertFilter(filters['sobel'], gl.TEXTURE4);
sobelInit = true;
}
if ('lbp' in filters) {
insertFilter(filters['lbp'], gl.TEXTURE5);
lbpInit = true;
}
/** calculate vertices for calculating responses **/
// vertex rectangles to draw out
var rectangles = [];
var halfFilter = (filterWidth-1)/2;
var yOffset;
for (var i = 0;i < numBlocks;i++) {
yOffset = i*patchHeight;
//first triangle
rectangles = rectangles.concat([
halfFilter, yOffset+halfFilter,
patchWidth-halfFilter, yOffset+halfFilter,
halfFilter, yOffset+patchHeight-halfFilter
]);
//second triangle
rectangles = rectangles.concat([
halfFilter, yOffset+patchHeight-halfFilter,
patchWidth-halfFilter, yOffset+halfFilter,
patchWidth-halfFilter, yOffset+patchHeight-halfFilter
]);
}
rectangles = new Float32Array(rectangles);
// image rectangles to draw out
var irectangles = [];
for (var i = 0;i < rectangles.length;i++) {
if (i % 2 == 0) {
irectangles[i] = rectangles[i]/canvasWidth;
} else {
irectangles[i] = rectangles[i]/canvasHeight;
}
}
irectangles = new Float32Array(irectangles);
if ('lbp' in filters || 'sobel' in filters) {
var topCoord = 1.0 - 2/(patchHeight*numBlocks);
var bottomCoord = 1.0 - 2/numBlocks + 2/(patchHeight*numBlocks);
var yOffset;
// calculate position of vertex rectangles for gradient/lbp program
var gradRectangles = [];
for (var i = 0;i < numBlocks;i++) {
yOffset = i * (2/numBlocks);
//first triangle
gradRectangles = gradRectangles.concat([
-1.0, topCoord - yOffset,
1.0, topCoord - yOffset,
-1.0, bottomCoord - yOffset
]);
//second triangle
gradRectangles = gradRectangles.concat([
-1.0, bottomCoord - yOffset,
1.0, topCoord - yOffset,
1.0, bottomCoord - yOffset
]);
}
gradRectangles = new Float32Array(gradRectangles);
topCoord = 1.0 - 1/(patchHeight*numBlocks);
bottomCoord = 1.0 - 1/numBlocks + 1/(patchHeight*numBlocks);
// calculate position of image rectangles to draw out
var gradIRectangles = [];
for (var i = 0;i < numBlocks;i++) {
yOffset = i * (1/numBlocks);
//first triangle
gradIRectangles = gradIRectangles.concat([
0.0, topCoord - yOffset,
1.0, topCoord - yOffset,
0.0, bottomCoord - yOffset
]);
//second triangle
gradIRectangles = gradIRectangles.concat([
0.0, bottomCoord - yOffset,
1.0, topCoord - yOffset,
1.0, bottomCoord - yOffset
]);
}
gradIRectangles = new Float32Array(gradIRectangles);
}
// vertices for drawing out responses
// drawOutRectangles
drawOutRectangles = new Float32Array(12*numPatches);
var yOffset, indexOffset;
for (var i = 0;i < numPatches;i++) {
yOffset = i*newCanvasBlockHeight;
indexOffset = i*12;
//first triangle
drawOutRectangles[indexOffset] = 0.0;
drawOutRectangles[indexOffset+1] = yOffset;
drawOutRectangles[indexOffset+2] = newCanvasWidth;
drawOutRectangles[indexOffset+3] = yOffset;
drawOutRectangles[indexOffset+4] = 0.0;
drawOutRectangles[indexOffset+5] = yOffset+newCanvasBlockHeight;
//second triangle
drawOutRectangles[indexOffset+6] = 0.0;
drawOutRectangles[indexOffset+7] = yOffset+newCanvasBlockHeight;
drawOutRectangles[indexOffset+8] = newCanvasWidth;
drawOutRectangles[indexOffset+9] = yOffset;
drawOutRectangles[indexOffset+10] = newCanvasWidth;
drawOutRectangles[indexOffset+11] = yOffset+newCanvasBlockHeight;
}
// images
drawOutImages = new Float32Array(numPatches*12);
var halfFilterWidth = ((filterWidth-1)/2)/patchWidth;
var halfFilterHeight = ((filterWidth-1)/2)/(patchHeight*patchCells);
var patchHeightT = patchHeight / (patchHeight*patchCells);
for (var i = 0;i < numPatches;i++) {
yOffset = Math.floor(i / 4)*patchHeightT;
indexOffset = i*12;
//first triangle
drawOutImages[indexOffset] = halfFilterWidth;
drawOutImages[indexOffset+1] = yOffset+halfFilterHeight;
drawOutImages[indexOffset+2] = 1.0-halfFilterWidth;
drawOutImages[indexOffset+3] = yOffset+halfFilterHeight;
drawOutImages[indexOffset+4] = halfFilterWidth;
drawOutImages[indexOffset+5] = yOffset+patchHeightT-halfFilterHeight;
//second triangle
drawOutImages[indexOffset+6] = halfFilterWidth;
drawOutImages[indexOffset+7] = yOffset+patchHeightT-halfFilterHeight;
drawOutImages[indexOffset+8] = 1.0-halfFilterWidth;
drawOutImages[indexOffset+9] = yOffset+halfFilterHeight;
drawOutImages[indexOffset+10] = 1.0-halfFilterWidth;
drawOutImages[indexOffset+11] = yOffset+patchHeightT-halfFilterHeight;
}
// layer
drawOutLayer = new Float32Array(numPatches*6);
var layernum;
for (var i = 0;i < numPatches;i++) {
layernum = i % 4;
indexOffset = i*6;
drawOutLayer[indexOffset] = layernum;
drawOutLayer[indexOffset+1] = layernum;
drawOutLayer[indexOffset+2] = layernum;
drawOutLayer[indexOffset+3] = layernum;
drawOutLayer[indexOffset+4] = layernum;
drawOutLayer[indexOffset+5] = layernum;
}
/** set up programs and load attributes etc **/
if ('sobel' in filters) {
var grVertexShader = webglUtils_5(gl, gradientResponseVS, gl.VERTEX_SHADER);
var grFragmentShader = webglUtils_5(gl, gradientResponseFS, gl.FRAGMENT_SHADER);
gradientResponseProgram = webglUtils_2(gl, [grVertexShader, grFragmentShader]);
gl.useProgram(gradientResponseProgram);
// set up vertices with rectangles
gradPositionLocation = gl.getAttribLocation(gradientResponseProgram, 'a_position');
gradAPositionBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, gradAPositionBuffer);
gl.bufferData(gl.ARRAY_BUFFER, gradRectangles, gl.STATIC_DRAW);
gl.enableVertexAttribArray(gradPositionLocation);
gl.vertexAttribPointer(gradPositionLocation, 2, gl.FLOAT, false, 0, 0);
// set up texture positions
gradTexCoordLocation = gl.getAttribLocation(gradientResponseProgram, 'a_texCoord');
gradTexCoordBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, gradTexCoordBuffer);
gl.bufferData(gl.ARRAY_BUFFER, gradIRectangles, gl.STATIC_DRAW);
gl.enableVertexAttribArray(gradTexCoordLocation);
gl.vertexAttribPointer(gradTexCoordLocation, 2, gl.FLOAT, false, 0, 0);
// set up patches texture in gradientResponseProgram
gl.uniform1i(gl.getUniformLocation(gradientResponseProgram, 'u_patches'), 1);
}
if ('lbp' in filters) {
var lbpVertexShader = webglUtils_5(gl, lbpResponseVS, gl.VERTEX_SHADER);
var lbpFragmentShader = webglUtils_5(gl, lbpResponseFS, gl.FRAGMENT_SHADER);
lbpResponseProgram = webglUtils_2(gl, [lbpVertexShader, lbpFragmentShader]);
gl.useProgram(lbpResponseProgram);
// set up vertices with rectangles
lbpPositionLocation = gl.getAttribLocation(lbpResponseProgram, 'a_position');
lbpAPositionBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, lbpAPositionBuffer);
gl.bufferData(gl.ARRAY_BUFFER, gradRectangles, gl.STATIC_DRAW);
gl.enableVertexAttribArray(lbpPositionLocation);
gl.vertexAttribPointer(lbpPositionLocation, 2, gl.FLOAT, false, 0, 0);
// set up texture positions
gradTexCoordLocation = gl.getAttribLocation(lbpResponseProgram, 'a_texCoord');
lbpTexCoordBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, lbpTexCoordBuffer);
gl.bufferData(gl.ARRAY_BUFFER, gradIRectangles, gl.STATIC_DRAW);
gl.enableVertexAttribArray(lbpTexCoordLocation);
gl.vertexAttribPointer(lbpTexCoordLocation, 2, gl.FLOAT, false, 0, 0);
// set up patches texture in lbpResponseProgram
gl.uniform1i(gl.getUniformLocation(lbpResponseProgram, 'u_patches'), 1);
}
// setup patchdraw program
var drVertexShader = webglUtils_5(gl, drawResponsesVS, gl.VERTEX_SHADER);
var drFragmentShader = webglUtils_5(gl, drawResponsesFS, gl.FRAGMENT_SHADER);
patchDrawProgram = webglUtils_2(gl, [drVertexShader, drFragmentShader]);
gl.useProgram(patchDrawProgram);
// set the resolution/dimension of the canvas
var resolutionLocation = gl.getUniformLocation(patchDrawProgram, 'u_resolutiondraw');
gl.uniform2f(resolutionLocation, newCanvasWidth, newCanvasHeight);
// set u_responses
var responsesLocation = gl.getUniformLocation(patchDrawProgram, 'u_responses');
gl.uniform1i(responsesLocation, 2);
// setup patchresponse program
var prVertexShader = webglUtils_5(gl, patchResponseVS, gl.VERTEX_SHADER);
var prFragmentShader = webglUtils_5(gl, patchResponseFS, gl.FRAGMENT_SHADER);
patchResponseProgram = webglUtils_2(gl, [prVertexShader, prFragmentShader]);
gl.useProgram(patchResponseProgram);
// set up vertices with rectangles
var positionLocation = gl.getAttribLocation(patchResponseProgram, 'a_position');
apositionBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, apositionBuffer);
gl.bufferData(gl.ARRAY_BUFFER, rectangles, gl.STATIC_DRAW);
gl.enableVertexAttribArray(positionLocation);
gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
// set up texture positions
texCoordLocation = gl.getAttribLocation(patchResponseProgram, 'a_texCoord');
texCoordBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer);
gl.bufferData(gl.ARRAY_BUFFER, irectangles, gl.STATIC_DRAW);
gl.enableVertexAttribArray(texCoordLocation);
gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0);
if ('lbp' in filters || 'sobel' in filters) {
// set up gradient/lbp buffer (also used for lbp)
gl.activeTexture(gl.TEXTURE3);
var gradients = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, gradients);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, patchWidth, patchHeight*numBlocks, 0, gl.RGBA, gl.FLOAT, null);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
// set up gradient/lbp framebuffer
gbo = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, gbo);
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, gradients, 0);
}
// set up buffer to draw to
gl.activeTexture(gl.TEXTURE2);
rttTexture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, rttTexture);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, patchWidth, patchHeight*numBlocks, 0, gl.RGBA, gl.FLOAT, null);
// set up response framebuffer
fbo = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, rttTexture, 0);
gl.viewport(0, 0, patchWidth, patchHeight*numBlocks);
/* initialize some textures and buffers used later on */
patchTex = gl.createTexture();
drawRectBuffer = gl.createBuffer();
drawImageBuffer = gl.createBuffer();
drawLayerBuffer = gl.createBuffer();
};
this.getRawResponses = function(patches) {
// TODO: check patches correct length/dimension
insertPatches(patches);
// switch to correct program
gl.useProgram(patchResponseProgram);
// set u_patches to point to texture 1
gl.uniform1i(gl.getUniformLocation(patchResponseProgram, 'u_patches'), 1);
// set u_filters to point to correct filter
gl.uniform1i(gl.getUniformLocation(patchResponseProgram, 'u_filters'), 0);
// set up vertices with rectangles
var positionLocation = gl.getAttribLocation(patchResponseProgram, 'a_position');
gl.bindBuffer(gl.ARRAY_BUFFER, apositionBuffer);
gl.enableVertexAttribArray(positionLocation);
gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
// set up texture positions
var texCoordLocation = gl.getAttribLocation(patchResponseProgram, 'a_texCoord');
gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer);
gl.enableVertexAttribArray(texCoordLocation);
gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0);
// set framebuffer to the original one if not already using it
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
gl.viewport(0, 0, patchWidth, patchHeight*numBlocks);
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER);
// draw to framebuffer
gl.drawArrays(gl.TRIANGLES, 0, patchCells*6);
//gl.finish();
var responses = drawOut('raw');
return responses;
};
this.getSobelResponses = function(patches) {
// check that it is initialized
if (!sobelInit) return;
insertPatches(patches);
/* do sobel filter on patches */
// switch to correct program
gl.useProgram(gradientResponseProgram);
// set up vertices with rectangles
var gradPositionLocation = gl.getAttribLocation(gradientResponseProgram, 'a_position');
gl.bindBuffer(gl.ARRAY_BUFFER, gradAPositionBuffer);
gl.enableVertexAttribArray(gradPositionLocation);
gl.vertexAttribPointer(gradPositionLocation, 2, gl.FLOAT, false, 0, 0);
// set up texture positions
var gradTexCoordLocation = gl.getAttribLocation(gradientResponseProgram, 'a_texCoord');
gl.bindBuffer(gl.ARRAY_BUFFER, gradTexCoordBuffer);
gl.enableVertexAttribArray(gradTexCoordLocation);
gl.vertexAttribPointer(gradTexCoordLocation, 2, gl.FLOAT, false, 0, 0);
// set framebuffer to the original one if not already using it
gl.bindFramebuffer(gl.FRAMEBUFFER, gbo);
gl.viewport(0, 0, patchWidth, patchHeight*numBlocks);
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER);
// draw to framebuffer
gl.drawArrays(gl.TRIANGLES, 0, patchCells*6);
/* calculate responses */
gl.useProgram(patchResponseProgram);
// set patches and filters to point to correct textures
gl.uniform1i(gl.getUniformLocation(patchResponseProgram, 'u_filters'), 4);
gl.uniform1i(gl.getUniformLocation(patchResponseProgram, 'u_patches'), 3);
var positionLocation = gl.getAttribLocation(patchResponseProgram, 'a_position');
gl.bindBuffer(gl.ARRAY_BUFFER, apositionBuffer);
gl.enableVertexAttribArray(positionLocation);
gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
// set up texture positions
var texCoordLocation = gl.getAttribLocation(patchResponseProgram, 'a_texCoord');
gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer);
gl.enableVertexAttribArray(texCoordLocation);
gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0);
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
gl.viewport(0, 0, patchWidth, patchHeight*numBlocks);
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER);
// draw to framebuffer
gl.drawArrays(gl.TRIANGLES, 0, patchCells*6);
/* get the responses */
var responses = drawOut('sobel');
return responses;
};
this.getLBPResponses = function(patches) {
// check that it is initialized
if (!lbpInit) return;
insertPatches(patches);
/* do sobel filter on patches */
// switch to correct program
gl.useProgram(lbpResponseProgram);
// set up vertices with rectangles
var lbpPositionLocation = gl.getAttribLocation(lbpResponseProgram, 'a_position');
gl.bindBuffer(gl.ARRAY_BUFFER, lbpAPositionBuffer);
gl.enableVertexAttribArray(lbpPositionLocation);
gl.vertexAttribPointer(lbpPositionLocation, 2, gl.FLOAT, false, 0, 0);
// set up texture positions
var lbpTexCoordLocation = gl.getAttribLocation(lbpResponseProgram, 'a_texCoord');
gl.bindBuffer(gl.ARRAY_BUFFER, lbpTexCoordBuffer);
gl.enableVertexAttribArray(lbpTexCoordLocation);
gl.vertexAttribPointer(lbpTexCoordLocation, 2, gl.FLOAT, false, 0, 0);
// set framebuffer to the original one if not already using it
gl.bindFramebuffer(gl.FRAMEBUFFER, gbo);
gl.viewport(0, 0, patchWidth, patchHeight*numBlocks);
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER);
// draw to framebuffer
gl.drawArrays(gl.TRIANGLES, 0, patchCells*6);
/* calculate responses */
gl.useProgram(patchResponseProgram);
gl.uniform1i(gl.getUniformLocation(patchResponseProgram, 'u_filters'), 5);
gl.uniform1i(gl.getUniformLocation(patchResponseProgram, 'u_patches'), 3);
var positionLocation = gl.getAttribLocation(patchResponseProgram, 'a_position');
gl.bindBuffer(gl.ARRAY_BUFFER, apositionBuffer);
gl.enableVertexAttribArray(positionLocation);
gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
// set up texture positions
var texCoordLocation = gl.getAttribLocation(patchResponseProgram, 'a_texCoord');
gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer);
gl.enableVertexAttribArray(texCoordLocation);
gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0);
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
gl.viewport(0, 0, patchWidth, patchHeight*numBlocks);
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER);
// draw to framebuffer
gl.drawArrays(gl.TRIANGLES, 0, patchCells*6);
/* get the responses */
var responses = drawOut('lbp');
return responses;
};
var insertPatches = function(patches) {
// pass patches into texture, each patch in either r, g, b or a
var patchArrayIndex = 0;
var patchesIndex1 = 0;
var patchesIndex2 = 0;
for (var i = 0;i < patchCells;i++) {
for (var j = 0;j < patchHeight;j++) {
for (var k = 0;k < patchWidth;k++) {
patchesIndex1 = i*4;
patchesIndex2 = (j*patchWidth) + k;
patchArrayIndex = ((patchSize*i) + patchesIndex2)*4;
//set r with first patch
if (patchesIndex1 < numPatches) {
patchArray[patchArrayIndex] = patches[patchesIndex1][patchesIndex2];
} else {
patchArray[patchArrayIndex] = 0;
}
//set g with 2nd patch
if (patchesIndex1+1 < numPatches) {
patchArray[patchArrayIndex + 1] = patches[patchesIndex1+1][patchesIndex2];
} else {
patchArray[patchArrayIndex + 1] = 0;
}
//set b with 3rd patch
if (patchesIndex1+2 < numPatches) {
patchArray[patchArrayIndex + 2] = patches[patchesIndex1+2][patchesIndex2];
} else {
patchArray[patchArrayIndex + 2] = 0;
}
//set a with 4th patch
if (patchesIndex1+3 < numPatches) {
patchArray[patchArrayIndex + 3] = patches[patchesIndex1+3][patchesIndex2];
} else {
patchArray[patchArrayIndex + 3] = 0;
}
}
}
}
// pass texture into an uniform
gl.activeTexture(gl.TEXTURE1);
gl.bindTexture(gl.TEXTURE_2D, patchTex);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, textureWidth, textureHeight, 0, gl.RGBA, gl.FLOAT, patchArray);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
};
var insertFilter = function(filter, textureNum) {
var filterSize = filterWidth*filterHeight;
var filterArray = new Float32Array(filterSize*(numBlocks)*4);
for (var i = 0;i < numBlocks;i++) {
for (var j = 0;j < filterHeight;j++) {
for (var k = 0;k < filterWidth;k++) {
//set r with first filter
if (i*4 < filter.length) {
filterArray[((filterSize*i) + (j*filterWidth) + k)*4] = filter[i*4][(j*filterWidth) + k];
} else {
filterArray[((filterSize*i) + (j*filterWidth) + k)*4] = 0;
}
//set g with 2nd filter
if ((i*4 + 1) < filter.length) {
filterArray[((filterSize*i) + (j*filterWidth) + k)*4 + 1] = filter[(i*4)+1][(j*filterWidth) + k];
} else {
filterArray[((filterSize*i) + (j*filterWidth) + k)*4 + 1] = 0;
}
//set b with 3rd filter
if ((i*4 + 2) < filter.length) {
filterArray[((filterSize*i) + (j*filterWidth) + k)*4 + 2] = filter[(i*4)+2][(j*filterWidth) + k];
} else {
filterArray[((filterSize*i) + (j*filterWidth) + k)*4 + 2] = 0;
}
//set a with 4th filter
if ((i*4 + 3) < filter.length) {
filterArray[((filterSize*i) + (j*filterWidth) + k)*4 + 3] = filter[(i*4)+3][(j*filterWidth) + k];
} else {
filterArray[((filterSize*i) + (j*filterWidth) + k)*4 + 3] = 0;
}
}
}
}
gl.activeTexture(textureNum);
var filterTexture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, filterTexture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, filterWidth, filterHeight*numBlocks, 0, gl.RGBA, gl.FLOAT, filterArray);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
};
var drawOut = function(type) {
// switch programs
gl.useProgram(patchDrawProgram);
// bind canvas buffer
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
gl.viewport(0, 0, newCanvasWidth, newCanvasHeight);
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER);
gl.bindBuffer(gl.ARRAY_BUFFER, drawRectBuffer);
gl.bufferData(
gl.ARRAY_BUFFER,
drawOutRectangles,
gl.STATIC_DRAW);
var positionLocation = gl.getAttribLocation(patchDrawProgram, 'a_position_draw');
gl.enableVertexAttribArray(positionLocation);
gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, drawImageBuffer);
gl.bufferData(
gl.ARRAY_BUFFER,
drawOutImages,
gl.STATIC_DRAW);
var textureLocation = gl.getAttribLocation(patchDrawProgram, 'a_texCoord_draw');
gl.enableVertexAttribArray(textureLocation);
gl.vertexAttribPointer(textureLocation, 2, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, drawLayerBuffer);
gl.bufferData(
gl.ARRAY_BUFFER,
drawOutLayer,
gl.STATIC_DRAW);
var layerLocation = gl.getAttribLocation(patchDrawProgram, 'a_patchChoice_draw');
gl.enableVertexAttribArray(layerLocation);
gl.vertexAttribPointer(layerLocation, 1, gl.FLOAT, false, 0, 0);
// draw out
gl.drawArrays(gl.TRIANGLES, 0, numPatches*6);
var responses = getOutput();
responses = unpackToFloat(responses);
responses = splitArray(responses, numPatches);
responses = addBias(responses, biases[type]);
// normalize responses to lie within [0,1]
var rl = responses.length;
for (var i = 0;i < rl;i++) {
responses[i] = normalizeFilterMatrix(responses[i]);
}
return responses;
};
var addBias = function(responses, bias) {
// do a little trick to add bias in the logit function
var biasMult;
for (var i = 0;i < responses.length;i++) {
biasMult = Math.exp(bias[i]);
for (var j = 0;j < responses[i].length;j++) {
responses[i][j] = 1/(1+((1-responses[i][j])/(responses[i][j]*biasMult)));
}
}
return responses;
};
var splitArray = function(array, parts) {
var sp = [];
var al = array.length;
var splitlength = al/parts;
var ta = [];
for (var i = 0;i < al;i++) {
if (i % splitlength == 0) {
if (i != 0) {
sp.push(ta);
}
ta = [];
}
ta.push(array[i]);
}
sp.push(ta);
return sp;
};
var getOutput = function() {
// get data
var pixelValues = new Uint8Array(4*canvas.width*canvas.height);
gl.readPixels(0, 0, canvas.width, canvas.height, gl.RGBA, gl.UNSIGNED_BYTE, pixelValues);
return pixelValues;
};
var unpackToFloat = function(array) {
// convert packed floats to proper floats : see http://stackoverflow.com/questions/9882716/packing-float-into-vec4-how-does-this-code-work
var newArray = [];
var al = array.length;
for (var i = 0;i < al;i+=4) {
newArray[(i / 4) >> 0] = ((array[i]/(256*256*256*256))+(array[i+1]/(256*256*256))+(array[i+2]/(256*256))+(array[i+3]/256));
}
return newArray;
};
var normalizeFilterMatrix = function(response) {
// normalize responses to lie within [0,1]
var msize = response.length;
var max = 0;
var min = 1;
for (var i = 0;i < msize;i++) {
max = response[i] > max ? response[i] : max;
min = response[i] < min ? response[i] : min;
}
var dist = max-min;
if (dist == 0) {
//console.log('a patchresponse was monotone, causing normalization to fail. Leaving it unchanged.');
response = response.map(function() {return 1});
} else {
for (var i = 0;i < msize;i++) {
response[i] = (response[i]-min)/dist;
}
}
return response;
};
};
var mosseFilterResponses = function() {
var filters = [];
var responses = [];
var num_Patches = 0;
this.init = function(filter_input, numPatches, filterWidth, filterHeight) {
// load filters, make fft ready
for (var i = 0;i < numPatches;i++) {
var temp = {};
temp.width = filterWidth;
temp.height = filterHeight;
var filterLength = filterWidth*filterHeight;
var flar_fi0 = new Float64Array(filterLength);
var flar_fi1 = new Float64Array(filterLength);
for (var j = 0;j < filterLength;j++) {
flar_fi0[j] = filter_input[i][0][j];
flar_fi1[j] = filter_input[i][1][j];
}
temp.real = flar_fi0;
temp.imag = flar_fi1;
filters[i] = new mosse.mosseFilter();
filters[i].load(temp);
}
num_Patches = numPatches;
};
this.getResponses = function(patches) {
for (var i = 0;i < num_Patches;i++) {
responses[i] = filters[i].getResponse(patches[i]);
//responses[i] = logisticResponse(responses[i]);
responses[i] = normalizeFilterMatrix(responses[i]);
}
return responses;
};
var logisticResponse = function(response) {
// create probability by doing logistic transformation
var filter_size = response.length;
for (var j = 0;j < filter_size;j++) {
response[j] = 1.0/(1.0 + Math.exp(- (response[j]-1.0) ));
}
return response;
};
var normalizeFilterMatrix = function(response) {
// normalize responses to lie within [0,1]
var msize = response.length;
var max = 0;
var min = 1;
for (var i = 0;i < msize;i++) {
max = response[i] > max ? response[i] : max;
min = response[i] < min ? response[i] : min;
}
var dist = max-min;
if (dist == 0) {
console.log('a patchresponse was monotone, causing normalization to fail. Leaving it unchanged.');
response = response.map(function() {return 1});
} else {
for (var i = 0;i < msize;i++) {
response[i] = (response[i]-min)/dist;
}
}
return response;
};
};
var model_pca_20_svm = createCommonjsModule(function (module, exports) {
(function (global) {
'use strict';
var pModel = {
"scoring": {
"size": [20, 22],
"bias": -1.3971,
"coef": [-0.019443, -0.0084627, -0.005644, -0.0030633, 0.0050582, 0.0038672, 0.0073781, 0.0084088, 0.002108, 0.0088022, 0.0084634, 0.0091342, 0.0021678, 0.0057906, 0.010027, 0.010018, 0.011075, -0.00061696, -0.006084, -0.0094488, -0.012441, -0.003865, -0.0003105, 0.0031879, 0.0078183, 0.01096, 0.012101, 0.012289, 0.012872, 0.01342, 0.012863, 0.01257, 0.014429, 0.013339, 0.013248, 0.012998, 0.0080562, 0.001467, -0.011928, -0.0097909, -0.019951, -0.014602, -0.013175, -0.0060515, -0.0010407, 0.0054651, 0.010449, 0.014061, 0.015918, 0.016361, 0.021757, 0.017301, 0.014195, 0.012452, 0.010454, 0.0040883, -0.0014194, -0.0038499, -0.01077, -0.011758, -0.0046927, -0.0022134, -0.0039804, -0.012187, -0.011887, -0.0081984, 0.0028354, 0.007082, 0.012238, 0.016348, 0.02098, 0.017313, 0.011865, 0.0072371, 0.0028788, -0.0074673, -0.012293, -0.014834, -0.0083886, -0.0012772, -0.0043238, -0.00079996, -0.0090447, -0.015715, -0.016374, -0.018048, -0.012034, -0.007243, 0.00051252, 0.013092, 0.01857, 0.013099, 0.00085916, -0.0064555, -0.014574, -0.018222, -0.01806, -0.016666, -0.016743, -0.012862, -0.037409, -0.02683, -0.036693, -0.034788, -0.021885, -0.024485, -0.028069, -0.018632, 0.00033863, 0.015591, 0.021179, 0.015184, 0.0029429, -0.014375, -0.025568, -0.025718, -0.023219, -0.043064, -0.042245, -0.040561, -0.029282, -0.037097, -0.050209, -0.043175, -0.038799, -0.037913, -0.024597, -0.013392, 0.0026176, 0.01616, 0.02195, 0.018825, 0.0069274, -0.00671, -0.018259, -0.03115, -0.030987, -0.033628, -0.043437, -0.034535, -0.0027688, -0.0045493, -0.0029637, -0.0034067, -0.0058159, -0.0050003, -0.0052189, -0.0035094, 0.0048076, 0.01523, 0.017877, 0.01506, 0.0068301, -0.00074735, -0.0047129, -0.0020172, -0.0028734, -3.2165e-05, 0.0052576, 0.0043529, 0.016946, 0.015931, 0.013752, 0.01013, 0.0080481, 0.006654, 0.0068325, 0.0069577, 0.0040399, 0.011715, 0.01744, 0.014274, 0.0061486, 0.0064501, 0.0064155, 0.0087973, 0.0085371, 0.0087282, 0.011783, 0.016747, 0.022118, 0.020836, 0.018312, 0.015898, 0.017833, 0.015566, 0.014049, 0.0092416, 0.0081518, 0.011231, 0.012568, 0.012112, 0.0098382, 0.0073612, 0.0095541, 0.011728, 0.018126, 0.019469, 0.017399, 0.021144, 0.021132, 0.019499, 0.019593, 0.020281, 0.017451, 0.014159, 0.0062291, 0.0038367, 0.0070206, 0.0096561, 0.011406, 0.0073274, 0.0046726, 0.0052536, 0.00018758, 0.0081524, 0.01276, 0.0216, 0.023303, 0.023746, 0.018231, 0.020013, 0.019842, 0.0188, 0.010638, 0.00047498, -0.0071779, -0.0013493, 0.0015382, 0.0026092, 0.00054047, -0.00049664, -0.00046203, -0.005244, -0.0052152, -0.010003, 0.0014386, 0.012845, 0.020828, 0.023738, 0.015717, 0.016381, 0.014903, 0.007373, 0.0019356, -0.0062, -0.0091165, -0.008811, -0.01485, -0.0020888, 0.0052141, 0.0010527, -0.010322, -0.016208, -0.012439, -0.013087, -0.002797, 0.0023632, 0.011157, 0.018369, 0.0095224, 0.010552, 0.0065611, -0.0015315, -0.0032492, -0.003133, -0.00092774, -0.0020969, -0.0027526, 0.00094388, 5.9164e-05, -0.0017255, -0.0034421, -0.0045774, -0.0025305, -0.00038216, 0.00057079, 0.0031326, 0.0060238, 0.011585, 0.0016263, 0.0032288, 0.0012533, 0.00062748, 0.0023767, 0.0028182, 0.0023771, -0.0033403, -0.0048954, 0.0030747, 0.0062649, 0.0050231, 0.00044658, -0.0048271, -0.0040237, 0.0024988, 0.005458, 0.007288, 0.003601, 0.010569, -0.0045837, 0.00057936, 0.0010299, 0.0030015, 0.0036675, 0.0044718, 0.0068927, 0.0039124, 0.0071394, 0.010304, 0.012609, 0.0089589, 0.0086038, 0.0055408, 0.0046722, 0.0047921, 0.0058818, 0.0056047, 0.0054112, 0.0073265, -0.0027342, -0.0027247, -0.00349, -0.0079957, -0.0040761, -0.0020778, -0.0028479, -0.0039663, -0.0026161, 0.00092611, 0.0017427, 0.00055187, -0.0013723, -0.0045996, -0.0042015, -0.0054722, -0.0023417, -0.0025441, -0.0078778, 5.3403e-05, 0.0046873, 0.0021888, 0.0013036, -0.0013698, -0.015805, -0.016268, -0.018901, -0.017659, -0.011813, -0.0034436, -0.0023483, -0.0050111, -0.0050922, -0.015031, -0.020198, -0.021621, -0.018586, -0.018724, -0.0055723, 0.006448, 0.0026823, 0.006001, 0.0039986, 0.0050813, -0.0059114, -0.027746, -0.029251, -0.023067, -0.01721, -0.015963, -0.021075, -0.023667, -0.020006, -0.01
},
"path": {
"normal": [
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
[15, 16, 17, 18],
[19, 20, 21, 22],
[23, 63, 24, 64, 25, 65, 26, 66, 23],
[28, 67, 29, 68, 30, 69, 31, 70, 28],
[34, 35, 36, 42, 37, 43, 38, 39, 40],
[33, 41, 62],
[44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 44, 56, 57, 58, 50, 59, 60, 61, 44],
27, 32
],
"vertices": [
// jawline
[0,1,23,0],
[1,23,66,1],
[1,2,66,1],
[2,66,26,2],
[2,26,35,2],
[2,35,36,2],
[2,36,3,2],
[36,44,45,36],
[3,4,44,3],
[3,44,36,3],
[4,44,55,4],
[4,5,55,4],
[5,55,54,5],
[5,6,54,5],
[6,53,54,6],
[6,7,53,6],
[7,8,53,7],
[8,52,53,8],
[8,9,52,8],
[9,51,52,9],
[9,10,51,9],
[10,50,51,10],
[10,11,50,10],
[11,38,50,11],
[11,12,38,11],
[12,38,39,12],
[12,31,39,12],
[12,31,70,12],
[12,13,70,12],
[13,28,70,13],
[13,14,28,13],
// right eyebrow
[14,15,28,14],
[15,28,67,15],
[15,16,67,15],
[16,67,29,16],
[16,17,29,16],
[17,68,29,17],
[17,18,68,17],
[18,68,30,18],
[18,30,33,18],
// below eyes
[30,40,69,30],
[39,40,69,39],
[39,31,69,39],
[26,65,35,26],
[34,35,65,34],
[25,34,65,25],
// left eyebrow
[22,25,33,22],
[22,25,64,22],
[21,22,64,21],
[21,24,64,21],
[20,21,24,20],
[20,24,63,20],
[19,20,63,19],
[19,23,63,19],
[19,23,0,19],
// below nose
[36,45,46,36],
[36,42,46,36],
[42,37,46,42],
[37,46,47,37],
[46,37,47,46],
[37,47,48,37],
[38,48,49,38],
[37,43,48,37],
[43,38,48,43],
[38,49,50,38],
// nose region
[22,18,33,22],
[40,41,30,40],
[25,33,41,25],
[33,41,30,33],
[25,34,41,25],
[41,40,62,41],
[34,41,62,34],
[34,35,62,34],
[35,36,62,35],
[36,42,62,36],
[42,37,62,42],
[37,43,62,37],
[43,38,62,43],
[38,39,62,38],
[39,40,62,39],
// mouth
[44,45,61,44],
[45,46,61,45],
[46,47,61,46],
[47,61,60,47],
[47,59,60,47],
[47,48,59,47],
[48,49,59,48],
[49,50,59,49],
[50,51,58,50],
[51,52,58,51],
[52,57,58,52],
[52,53,57,52],
[53,54,57,53],
[54,56,57,54],
[54,55,56,54],
[44,55,56,44],
// left eye
[23,63,27,23],
[63,24,27,63],
[24,64,27,24],
[64,25,27,64],
[25,65,27,25],
[65,26,27,65],
[26,66,27,26],
[66,23,27,66],
// right eye
[28,67,32,28],
[67,29,32,67],
[29,68,32,29],
[68,30,32,68],
[30,69,32,30],
[69,31,32,69],
[31,70,32,31],
[28,32,70,28]
]
},
"patchModel": {
"patchType": "SVM",
"bias": {
"raw": [-0.96431, -1.0357, -0.87499, -0.91633, -0.84504, -0.8443, -0.73852, -0.80871, -0.72654, -0.84368, -0.86982, -0.91726, -0.87371, -1.0267, -0.98146, -0.87301, -1.0204, -1.058, -1.2212, -0.88168, -1.0332, -1.0513, -1.2405, -1.1638, -1.067, -1.2392, -1.1877, -1.1235, -1.1355, -1.0802, -1.2402, -1.167, -1.112, -0.72954, -1.1239, -1.3005, -1.3147, -1.0871, -1.3362, -1.3247, -1.1149, -0.76288, -1.1216, -1.0986, -1.2995, -1.2784, -1.0059, -0.91233, -0.96292, -1.2527, -1.2946, -1.1523, -1.0005, -0.88771, -1.0142, -1.1965, -1.0387, -0.86719, -1.0089, -1.1238, -0.95069, -1.1224, -0.88922, -1.1176, -1.2249, -1.247, -1.2452, -1.0982, -1.2104, -1.2217, -1.1773],
"sobel": [-0.83935, -0.62721, -0.55884, -0.69956, -0.71112, -0.80041, -0.8006, -1.1137, -0.80072, -0.80019, -0.71985, -0.69966, -0.58347, -0.65659, -0.82586, -0.77759, -0.77233, -0.85808, -0.81938, -0.76428, -0.79996, -0.86702, -0.82302, -0.74264, -1.0086, -0.71718, -0.79528, -0.88281, -0.7815, -0.99671, -0.71226, -0.81128, -0.961, -1.2055, -0.86243, -0.75576, -0.78897, -0.96273, -0.78559, -0.78317, -0.89144, -1.0805, -0.81895, -0.82399, -0.61098, -0.70637, -0.83608, -0.86537, -0.86189, -0.70686, -0.60467, -0.63896, -0.60021, -0.60121, -0.60027, -0.66659, -0.70694, -0.80643, -0.70127, -0.69741, -0.85141, -0.69645, -1.0096, -0.88808, -0.88378, -0.80101, -0.80271, -0.90248, -0.8675, -0.82653, -0.82836],
"lbp": [-1.2775, -0.80122, -0.80009, -0.80001, -0.70684, -0.77174, -0.76476, -0.66899, -0.72273, -0.66941, -0.59957, -0.79986, -0.80009, -0.80015, -0.80045, -0.7709, -0.6573, -0.59981, -0.58309, -0.95297, -0.76546, -0.79994, -0.72741, -1.3172, -1.1408, -1.3378, -1.4003, -1.2901, -1.2837, -1.1569, -1.2168, -1.4004, -1.2905, -0.92838, -0.9268, -0.92117, -0.91104, -0.84307, -0.86336, -0.97589, -0.89165, -1.1977, -0.99448, -0.97474, -0.79614, -0.7713, -0.91142, -0.92086, -0.8659, -0.84975, -0.80661, -1.0506, -1.2192, -1.3183, -1.3092, -0.60808, -0.93976, -1.1058, -1.0279, -0.91383, -0.87452, -0.81875, -1.0651, -1.1856, -1.1889, -1.3461, -1.3969, -1.1909, -1.1383, -1.3736, -1.3913]
},
"weights": {
"raw": [
[-0.0064193, 0.029809, -0.026784, -0.022626, -0.067697, -0.33308, 0.028197, 0.18245, 0.015034, 0.067853, 0.066708, 0.043758, -0.049432, 0.028765, -0.02378, -0.019044, -0.14598, 0.076748, 0.10031, 0.022404, 0.039489, -0.069173, 0.064454, -0.035681, 0.029478, 0.01367, -0.040087, -0.16484, 0.06074, 0.13421, 0.024223, -0.023179, -0.023938, 0.00080564, -0.020188, 0.035394, 0.020506, 0.028993, -0.15876, 0.08638, 0.069612, -0.0051496, -0.086213, -0.11615, -0.10172, 0.050444, -0.010945, -0.001994, -0.082496, -0.19805, 0.14503, 0.10473, -0.054504, 0.058559, 0.02151, 0.017305, 0.054797, 0.08145, -0.015927, -0.026646, -0.29396, 0.26045, -0.014751, 0.013566, -0.052044, -0.068508, 0.026715, 0.01503, -0.0036696, 0.0038326, -0.029296, -0.21686, 0.23218, -0.0032704, 0.0010938, 0.022865, -0.0024711, 0.027139, -0.016799, 0.052897, 0.0068774, -0.11535, -0.20003, 0.26777, -0.012991, 0.014507, -0.028377, 0.0061822, 0.088922, -0.029269, 0.023549, 0.005012, -0.10302, -0.11265, 0.23622, -0.02319, 0.0035723, -0.034182, 0.05063, 0.010945, -0.0026519, -0.025155, 0.02853, -0.13116, -0.093256, 0.16421, -0.010547, 0.03555, -0.020259, 0.022467, 0.03417, 0.11908, -0.0015743, -0.06402, -0.22057, -0.07231, 0.30205, 0.023274, 0.063584, 0.042979, 0.11846],
[0.16668, -0.061056, 0.0069211, 0.017085, -0.22608, -0.37345, 0.079941, 0.16478, 0.022649, 0.052894, 0.029322, -0.065687, -0.017175, 0.053426, 0.13197, -0.038916, -0.22142, 0.17019, 0.037969, 0.032433, 0.013114, -0.004714, 0.014494, 0.016836, -0.035383, 0.064594, -0.16864, -0.18184, 0.22011, 0.017098, 0.044439, -0.065745, 0.10209, 0.012977, 0.019776, -0.020715, 0.037536, 0.073188, -0.25739, 0.1791, -0.012201, -0.012489, -0.027938, 0.09084, 0.056062, -0.029592, 0.083797, 0.026909, 0.028447, -0.26724, 0.17602, 0.057474, -0.021754, -0.016094, 0.034961, -0.066136, -0.086822, 0.021268, 0.024914, 0.083351, -0.21234, 0.14528, 0.052103, 0.0060527, 0.0041058, 0.073743, -0.063151, 0.071707, 0.050277, 0.059474, 0.041093, -0.23159, 0.039824, 0.035168, -0.039327, -0.046713, -0.029439, 0.030373, 0.010642, 0.035443, -0.064897, -0.032864, -0.15394, 0.011778, 0.17418, -0.054758, 0.047924, 0.054346, -0.0033549, 0.02359, -0.0246, 0.060655, 0.13657, -0.093663, -0.047444, 0.062873, -0.022728, -0.027266, 0.12949, -0.016065, -0.029023, -0.055703, -0.084011, 0.067583, -0.021201, -0.12022, 0.094859, -0.023786, -0.031181, -0.0045461, -0.00096878, 0.075436, 0.010017, 0.06898, 0.077148, 0.016059, -0.19045, -0.010877, 0.12221, -0.035116, 0.061957],
[0.0011017, -0.10083, 8.5948e-05, -0.004422, -0.09674, -0.13241, 0.13984, -0.0031379, 0.0684, 0.041645, 0.12466, 0.057469, 0.073611, -0.010864, 0.0048406, 0.016396, -0.021671, 0.044733, 0.067922, -0.015872, -0.055943, 0.019702, 0.018616, -0.005659, 0.034038, 0.034411, -0.10871, -0.08096, 0.067428, -0.01988, -0.013665, 0.03579, 0.066231, -0.045918, -0.0042019, 0.021127, 0.040188, -0.036664, -0.030093, 0.0088117, 0.002416, -0.038593, -0.031144, 0.035042, -0.018244, 0.018916, 0.0008242, 0.092475, 0.073297, -0.024312, -0.0027452, 0.067921, 0.0011866, -0.028294, 0.042812, -0.022453, 0.02261, -0.028251, 0.043263, 0.092532, -0.15324, 0.050211, 0.01393, -0.00089781, -0.063661, 0.0048486, 0.07858, 0.025758, -0.032352, 0.028485, 0.023621, -0.21175, 0.10461, 0.047598, -0.013273, -0.060312, 0.021931, -0.054666, 0.02459, -0.053143, 0.049928, -0.024453, -0.1367, 0.013882, 0.10709, -0.030277, 0.045489, 0.021159, 0.0045505, 0.05215, -0.031125, -0.025892, 0.051506, -0.15851, -0.077434, 0.14442, 0.025521, -0.01336, -0.032691, -0.050761, 0.0067267, 0.053583, -0.066091, 0.028319, -0.023395, -0.1219, 0.12641, 0.04107, -0.038345, -0.0051038, 0.011158, -0.025558, -0.015803, -0.01457, 0.058582, 0.048613, -0.29657, -0.067646, 0.13109, 0.05457, 0.062524],
[-0.025233, 0.022349, -0.072259, -0.18573, 0.061154, 0.16053, 0.035735, 0.032646, 0.049973, -0.017745, 0.12328, -0.0020676, 0.017463, 0.062789, -0.11705, -0.065255, 0.094525, 0.04495, -0.028764, -0.007559, -0.018043, -0.042767, 0.0064727, -0.024499, 0.015096, 0.01148, -0.22512, 0.1375, 0.042174, -0.00097974, 0.0053459, 0.0066959, 0.052939, 0.028663, 0.0083788, 0.00039142, 0.058936, -0.2056, 0.079503, 0.10224, -0.041138, 0.02733, -0.010752, -0.0022307, -0.0079242, -0.0082795, -0.032085, 0.086123, -0.12113, -0.12791, 0.13903, 0.008854, -0.035846, 0.0045791, -0.043587, -0.02644, 0.012179, 0.074042, 0.012884, 0.063138, -0.30013, 0.19885, 0.063816, 0.049735, -0.059942, 0.066082, 0.01826, 0.01778, -0.030632, -0.05294, 0.12681, -0.2386, -0.072937, 0.12737, 0.063566, -0.051173, 0.0097791, -0.0043407, -0.016156, -0.0091924, 0.050666, 0.0060985, 0.017308, -0.20368, 0.12046, 0.012913, -0.0092052, 0.035363, 0.030748, -0.0068483, 0.06077, -0.024831, 0.032205, 0.088513, -0.20132, 0.0025484, 0.14012, 0.019619, 0.03077, -0.044844, 0.010829, -0.018605, 0.0048701, -0.053836, 0.065656, -0.087834, -0.1002, 0.019099, 0.032626, 0.013786, 0.014593, -0.022453, 0.023627, 0.044568, 0.05182, 0.058961, 0.011809, -0.24303, -0.10331, 0.043122, 0.044784],
[-0.11132, -0.14268, -0.1132, 0.16617, 0.21669, 0.1458, 0.015659, 0.0813, -0.024809, 0.04021, 0.11478, 0.01893, -0.080897, -0.059337, -0.10482, 0.10574, 0.063141, 0.059506, -0.10686, 0.034082, -0.044929, -0.023391, -0.021034, 0.011729, -0.12519, -0.24525, 0.075036, 0.16915, -0.011043, 0.018698, 0.0089194, -0.0095742, 0.074951, 0.052516, 0.00076256, 0.14447, -0.16117, -0.29435, 0.21098, 0.15322, -0.031397, -0.073199, -0.00058139, 0.038374, 0.071661, -0.025228, 0.094356, -0.0055066, -0.31677, -0.17018, 0.20181, 0.038951, 0.020699, 0.0073525, 0.019251, 0.027713, 0.022208, 0.017802, 0.16127, -0.0097927, -0.39692, -0.016345, 0.084335, 0.12332, 0.046852, 0.0026368, -0.015618, -0.0094365, -0.026158, 0.093092, 0.015837, -0.036104, -0.25195, 0.066519, 0.088769, -0.054177, 0.11363, -0.074336, 0.026412, -0.0069935, -0.011837, 0.20496, 0.040653, -0.10952, -0.19526, -0.02669, 0.025635, 0.084142, 0.081561, 0.0339, -0.041778, -0.0095017, 0.014147, -0.0083457, 0.066156, -0.13608, -0.0752, -0.099487, 0.097955, -0.068031, -0.028817, 0.062117, -0.05651, -0.016458, 0.078179, -0.011548, 0.054587, -0.017563, -0.072691, -0.034856, 0.058574, -0.060289, -0.012303, 0.052155, 0.075228, 0.053727, 0.0021832, -0.0023449, 0.069002, -0.05515, -0.18138],
[-0.23224, 0.079035, 0.20679, 0.17117, 0.060393, 0.070072, -0.061905, 0.10747, 0.014332, -0.032562, 0.096137, -0.11702, -0.18648, -0.072636, 0.12519, 0.070887, -0.032713, -0.014133, 0.0038162, 0.065966, 0.020457, 0.051334, -0.0011168, -0.086504, -0.17856, -0.024882, 0.17292, 0.076636, 0.095776, -0.076644, -0.054109, -0.03761, 0.10647, 0.005106, 0.056304, -0.028155, -0.31729, -0.058091, 0.11556, 0.065723, 0.030551, 0.041747, -0.069588, 0.092461, 0.052299, -0.010486, 0.011062, -0.045253, -0.23598, -0.070893, 0.10681, 0.11991, -0.020183, 0.00057273, 0.096563, 0.084394, 0.0061097, 0.052438, 0.012128, -0.025706, -0.37426, -0.12769, 0.057044, 0.11342, 0.089909, 0.088759, -0.017367, 0.058574, 0.0024242, 0.0811, 0.071615, -0.015636, -0.21764, -0.20281, -0.10017, 0.076481, 0.072072, 0.074832, -0.071669, 0.0033343, -0.020106, 0.12485, 0.088742, 0.012539, -0.080372, -0.20668, -0.042825, -0.041961, -0.011319, 0.0087351, -0.0073466, -0.014035, 0.060981, 0.0044957, 0.060136, 0.12863, -0.043407, -0.17199, -0.12412, -0.067878, -0.014543, 0.013304, 0.086616, -0.050869, 0.059037, -0.030082, -0.039151, -0.01341, 0.082024, -0.1843, 0.04382, 0.031005, 0.010111, -0.0064174, 0.024543, 0.0033265, 0.04021, 0.1055, 0.066466, 0.049202, -0.093932],
[-0.12203, -0.03698, 0.12683, 0.10063, 0.082154, 0.031377, 0.076193, 0.029644, 0.067195, 0.014606, 0.21693, -0.091991, -0.11496, -0.057854, 0.026983, 0.053704, -0.027394, 0.062051, -0.014065, -0.030464, 0.050223, 0.069522, -0.047915, -0.076313, -0.10543, -0.069963, 0.063888, 0.047704, 0.049626, 7.9371e-07, 0.066938, 0.022331, -0.013204, -0.051208, 0.017252, -0.16856, -0.081718, -0.051493, 0.044258, 0.079861, 0.040257, 0.061168, -0.044454, 0.076059, 0.024485, 0.023739, 0.022211, -0.039096, -0.26994, -0.1381, 0.10638, 0.074165, 0.13611, 0.08862, 0.023943, 0.059455, 0.018811, 0.13333, 0.019081, 0.040954, -0.19369, -0.33097, -0.31537, -0.051012, 0.10153, 0.10646, 0.014631, -0.0037912, -0.031174, 0.12574, 0.082747, 0.1391, 0.015618, -0.09701, -0.25737, -0.2389, -0.39201, 0.014632, -0.0049577, 0.032249, 0.019906, 0.0090031, 0.026111, 0.062898, 0.14639, 0.10175, -0.0083665, -0.22695, 0.016645, 0.01064, -0.033903, -0.05887, 0.022391, 0.010862, 0.028661, -0.0089732, 0.052004, 0.030893, -0.066299, -0.045463, -0.036534, 0.058255, -0.090301, 0.087529, -0.048367, -0.02187, -0.061935, 0.022843, 0.087099, -0.038226, 0.042583, 0.046404, 0.038044, 0.01328, -0.024476, 0.042648, 0.021205, 0.023541, -0.0073299, 0.0090777, 0.072704],
[0.076135, 0.075929, 0.10248, 0.12142, 0.061859, 0.025464, 0.048676, 0.030286, 0.11129, 0.19455, 0.11003, 0.074607, 0.013898, -0.012869, 0.03812, 0.0071485, -0.03739, 0.027892, -0.0040181, 0.051192, -0.051415, -0.065948, -0.077216, 0.078792, -0.01494, -0.042428, -0.022774, 0.0095521, 0.089225, 0.0026288, 0.027795, -0.011245, 0.002779, -0.084646, 0.10851, 0.064787, 0.071775, 0.10157, 0.13539, 0.022702, 0.081383, 0.10182, 0.13415, -0.067255, -0.252, -0.13138, -0.16366, -0.018741, -0.062883, -0.022204, -0.072308, -0.060022, -0.15902, -0.23762, -0.27876, -0.040264, -0.080156, -0.054339, -0.19775, -0.28232, -0.23354, -0.28871, -0.14102, -0.10254, -0.091079, -7.6022e-05, 0.084334, 0.025777, 0.027111, 0.12587, 0.17095, 0.12108, 0.23254, 0.022508, 0.10869, 0.10336, -0.0044697, -0.019044, -0.038539, 0.059623, -0.028373, -0.02936, 0.00087517, -0.065918, -0.069356, 0.02358, 0.021727, 0.039571, -0.029877, 0.038706, 0.054323, -0.04361, -0.014678, -0.039397, 0.028347, 0.13841, -0.090661, 0.036896, -0.037229, -0.0098949, -0.045239, -0.027745, 0.04194, 0.010554, -0.12123, -0.0087493, -0.022343, -0.036723, -0.074235, 0.13503, 0.046152, -0.00089713, 0.055905, 0.072801, -0.014134, 0.047446, 0.085859, 0.05507, 0.022279, 0.064172, -0.070766],
[0.118, 0.07821, 0.12816, -0.020597, 0.014337, 0.11621, 0.089056, 0.054438, 0.040501, 0.077089, -0.16589, 0.098328, -0.028103, -0.026588, 0.024055, 0.072814, -0.012894, 0.081294, -0.019639, -0.059461, -0.070719, -0.12759, 0.029993, 0.0019697, 0.026357, 0.077456, -0.0065799, 0.034984, -0.011141, 0.037206, -0.078048, -0.042937, -0.12754, 0.028459, -0.025141, 0.032111, 0.042952, 0.11294, 0.020048, 0.051516, -0.23573, -0.072308, -0.019056, 0.0030321, 0.096971, 0.07581, 0.11716, 0.10957, -0.0024781, -0.064158, -0.26848, -0.059754, 0.061911, -0.021664, 0.08611, 0.053234, 0.17175, 0.028047, -0.085903, -0.33611, -0.28144, -0.008033, 0.10514, -0.016383, 0.068947, 0.032998, -0.25751, -0.14537, -0.35542, -0.31544, -0.015389, 0.25816, 0.089607, 0.024874, 0.06881, 0.03489, 0.0094402, -0.3317, -0.084022, 0.051, 0.11407, 0.12381, 0.061542, 0.024538, -0.051413, -0.037969, -0.083159, 0.060974, -0.069683, 0.013137, 0.054335, 0.086376, 0.025768, -0.030285, 0.0046746, 0.014048, 0.0039043, -0.013244, -0.010235, -0.034349, 0.089307, 0.023673, -0.074064, -0.039416, -0.051468, 0.0066514, -0.0056021, 0.03753, 0.022918, -0.028514, 0.047001, 0.011664, 0.031577, 0.036743, 0.0001679, -0.032413, 0.061177, -0.014966, 0.027964, 0.049596, 0.017494],
[0.095112, -0.061598, -0.027849, 0.16285, 0.011485, 0.088228, 0.033477, 0.21312, 0.12563, 0.0056585, -0.19669, 0.12202, 0.065004, -0.064638, 0.0076011, -0.014993, -0.013714, 0.06519, 0.060502, -0.0073205, -0.15837, -0.11375, -0.01122, -0.037241, -0.0035346, 0.014184, -0.018805, 0.0022003, 0.086304, 0.05073, -0.19348, -0.024337, -0.022104, 0.11856, -0.0040747, -0.021636, 0.032835, 0.080034, 0.18177, 0.040195, -0.27027, -0.046765, 0.0088521, -0.0095398, 0.073838, 0.0022341, 0.080947, 0.064911, 0.068853, 0.052927, -0.41011, -0.0033883, -0.07662, 0.028027, 0.076992, 0.135, 0.0010836, -0.0094522, 0.11898, -0.10886, -0.31839, -0.079537, 0.088035, -0.019948, 0.055031, 0.017356, 0.11549, 0.047319, 0.0035589, -0.1909, -0.16923, -0.10344, 0.11611, 0.03014, 0.092038, -0.00052811, -0.0199, 0.11041, -0.11355, -0.13266, -0.16828, -0.036676, 0.078177, 0.065049, 0.061266, -0.045421, 0.038674, 0.026641, -0.10482, -0.10701, -0.065259, 0.1028, 0.025141, 0.078995, 0.055586, -0.028237, -0.0025877, 0.033127, -0.028093, -0.19115, -0.084372, 0.032752, 0.044573, 0.07857, -0.076168, -0.011918, 0.038863, -0.044585, -0.041775, 0.066544, -0.20856, 0.16839, 0.028096, 0.029747, -0.028107, 0.040207, -0.0050223, 0.061683, 0.11123, 0.002529, -0.021203],
[0.090436, -0.042297, 0.079436, 0.038426, 0.018479, 0.15189, 0.24325, 0.11802, -0.080157, -0.21178, -0.13219, 0.018475, 0.092018, -0.050722, -0.068375, -0.015375, 0.03148, 0.087358, -0.068354, -0.14664, -0.00015826, 0.015682, 0.051709, 0.0087471, -0.082976, 0.061059, 0.055713, 0.11256, 0.1201, -0.2412, -0.014823, -0.021321, -0.0064827, 0.011517, -0.0029379, -0.036512, 0.040278, 0.051444, 0.17561, -0.1656, -0.17724, 0.066641, 0.025444, 0.011885, 0.028951, -0.06227, 0.008151, 0.074139, 0.15952, -0.023426, -0.39782, -0.10909, 0.19811, -0.039694, 0.074717, 0.067657, 0.0023721, 0.050106, 0.11669, 0.10445, -0.18066, -0.13733, 0.12306, 0.037249, 0.040395, -0.013511, -0.012464, -0.011253, 0.057264, 0.064124, -0.18291, -0.28694, 0.16662, 0.052134, -0.03452, -0.0020693, 0.067413, 0.069379, 0.017341, 0.1125, -0.12114, -0.16394, 0.042619, 0.0082442, 0.032212, 0.0013431, 0.059794, -0.041854, 0.16142, 0.02529, -0.092772, -0.2216, -0.01754, 0.044685, 0.076526, 0.056282, -0.038323, -0.024136, -0.063727, 0.10195, -0.11144, -0.13769, 0.050856, 0.011876, 0.075788, -0.07629, -0.081411, 0.072942, 0.068768, -0.033998, -0.1679, -0.13094, 0.030093, -0.020742, 0.00030251, 0.088643, 0.052492, 0.087008, 0.024693, -0.11263, 0.075664],
[0.10662, -0.024041, 0.023732, 0.012547, 0.0662, 0.072881, 0.14196, -0.18846, -0.10001, -0.030399, 0.0065084, 0.035396, -0.016756, 0.039963, -0.032921, -0.0052279, 0.14555, -0.045218, -0.15713, 0.019388, 0.069073, -0.029885, -0.013668, 0.035507, -0.033905, -0.066398, 0.069367, 0.099068, -0.16177, -0.049744, 0.049417, 0.11584, -0.0099765, -0.0058946, 0.024852, -0.022954, 0.035365, 0.070911, 0.16507, -0.20261, 0.0040823, -0.020995, -0.01738, -0.068169, -0.016583, 0.016335, 0.017415, -0.06551, 0.17533, -0.077798, -0.16426, 0.067991, 0.015164, 0.0078509, 0.023953, -0.022724, 0.006469, -0.0046863, 0.023956, 0.17797, -0.14584, -0.064279, 0.0072859, 0.10176, -0.053758, 0.03183, -0.0069311, 0.011744, -0.02288, 0.061704, 0.073774, -0.20953, 0.022857, 0.054729, -0.019112, -0.03021, 0.0030313, 0.015874, -0.0064523, -0.02938, 0.17845, -0.071105, -0.12963, 0.074504, 0.028226, 0.028593, -0.019591, 0.026275, 0.049329, -0.0025258, 0.015184, 0.079378, -0.19506, -0.034582, 0.039284, -0.060962, 0.032105, 0.0010087, -0.0029092, 0.0013445, 0.0050237, 0.10379, 0.022548, -0.11489, -0.022121, 0.043655, 0.0067757, 0.025228, -0.019274, 0.021907, 0.076111, 0.017668, -0.015509, -0.23798, -0.10029, 0.068962, -0.0095808, 0.071808, 0.0096925, 0.0089571, -0.0082775],
[0.14712, 0.048704, 0.038282, 0.073332, 0.092603, -0.069406, -0.18039, 0.030462, -0.076528, -0.02846, 0.0039885, 0.091531, -0.097047, -0.021416, 0.022881, 0.1163, -0.11091, 0.0052601, -0.0013446, 0.019773, -0.010681, 0.087902, -0.0062328, -0.022953, -0.011871, 0.0057627, 0.09059, -0.032591, -0.02872, 0.018765, 0.034198, 0.092483, -0.039036, 0.046061, -0.03192, 0.035976, -0.02143, 0.087312, -0.10752, 0.0015208, 0.010464, 0.017721, -0.05437, -0.041949, 0.025353, -0.033214, -0.021243, -0.0008824, 0.12799, -0.14588, 0.0049155, 0.11545, 0.024394, 0.026837, -0.007026, -0.020081, 0.023705, 0.02295, -0.053385, 0.083134, -0.19191, 0.028256, 0.051623, 0.026883, 0.0083776, -0.005671, -0.015188, -0.052822, 0.0039064, 0.0052812, 0.10528, -0.15535, 0.012627, 0.033272, -0.016016, 0.047323, 0.029676, 0.062672, 0.02036, -0.056328, 0.062032, 0.13944, -0.16288, -0.062736, 0.0089074, -0.0034475, -0.016188, -0.058358, -0.038566, -0.0077422, -0.045255, 0.13887, 0.084802, -0.19493, 0.067962, -0.039669, -0.042999, 0.056923, 0.02131, 0.023652, 0.005385, -0.031872, 0.12124, -0.096718, -0.094641, 0.050053, -0.041096, 0.067669, -0.01302, -0.017936, 0.030885, 0.017941, 0.12318, 0.082612, -0.19694, -0.084587, -0.0036588, 0.046191, -0.015214, -0.037797, -0.03766],
[0.02879, 0.024919, 0.046184, 0.11407, 0.12089, -0.33168, -0.30199, 0.075505, 0.015981, -0.030246, 0.070778, 0.021705, -0.014784, -0.092797, 0.073387, 0.21513, -0.13136, -0.04101, 0.0027233, 0.10444, 0.019235, 0.026668, 0.077454, 0.037705, 0.028346, -0.0099782, 0.16392, -0.12998, -0.16954, 0.044202, 0.022535, -0.08057, 0.028323, 0.030852, -0.057281, -0.030642, 0.02744, 0.19419, -0.21394, -0.10823, 0.078776, -0.054726, -0.0018936, 0.027554, 0.12724, -0.053402, 0.032579, -0.0053669, 0.14926, -0.15555, 0.0070015, 0.047597, 0.15763, -0.0017752, -0.07848, 0.047381, -0.054017, -0.01081, 0.03169, 0.23863, -0.17968, -0.0025415, -0.0044923, -0.03345, 0.073251, -0.0025313, 0.04727, -0.018764, -0.085707, 0.037456, 0.24243, -0.25409, 0.043294, 0.040148, 0.013087, -0.019853, -0.023226, 0.030177, 0.030922, -0.040953, -0.0059331, 0.059824, -0.2284, 0.053836, 0.039215, -0.019168, 0.036601, 0.0071217, 0.0055195, 0.017118, -0.010329, 0.022892, 0.10731, -0.081072, -0.052731, 0.020939, 0.027473, 0.0087321, -0.011973, 0.029541, 0.025438, -0.0032417, 0.092169, -0.063485, -0.084864, -0.0055455, 0.04783, -0.038729, 0.021656, -0.048404, 0.081106, -0.050253, 0.062539, 0.050009, -0.066834, -0.22863, 0.13881, 0.081957, -0.036534, -0.019724, 0.074253],
[0.080975, 0.05653, 0.032548, 0.10153, 0.046435, -0.21467, -0.20895, -0.014893, 0.020894, -0.0067217, 0.035252, -0.0060355, -0.027461, 0.010096, 0.054592, 0.16829, -0.17463, 0.021868, -0.041396, 0.01938, 0.012675, -0.027695, -0.041244, 0.016052, -0.0010187, 0.14438, 0.078408, -0.21215, -0.057681, 0.12665, -0.12395, 0.071773, 0.0075741, -0.051866, 0.038445, -0.11282, -0.013662, 0.21925, -0.14332, -0.054997, 0.0029603, 0.047503, -0.028486, 0.020467, -0.10612, 0.011156, 0.013002, 0.023296, 0.26377, -0.25931, -0.081091, -0.00039674, 0.042663, -0.0029479, -0.026706, -0.08931, -0.0050439, -0.005502, -0.045367, 0.23013, -0.090116, -0.21359, 0.069011, 0.019878, 0.0044609, 0.029591, -0.035017, -0.01693, -0.028665, -0.014127, 0.23223, 0.020022, -0.25101, 0.089307, -0.0077045, 0.033183, 0.0097764, 0.034273, 0.020165, -0.010043, 0.0084138, 0.23503, -0.02443, -0.16832, 0.00052901, -0.023488, 0.096816, -0.036178, 0.0026701, 0.0060485, -0.03295, -0.029843, 0.14656, 0.035391, -0.20847, -0.057892, -0.01027, 0.076538, 0.082782, 0.11259, -0.016599, -0.093948, -0.025158, 0.13711, 0.13285, -0.2231, -0.12554, 0.02511, -0.030215, -0.011749, 0.144, 0.043164, 0.085941, 0.035185, 0.17622, 0.19444, -0.23633, -0.077389, 0.014639, 0.0228, 0.083546],
[0.12261, 0.16705, 0.19069, 0.064201, -0.00016272, -0.065943, -0.0079351, -0.057893, -0.054006, -0.10459, -0.05418, 0.06699, -0.09922, 0.062446, 0.090945, 0.028278, -0.047069, -0.007151, -0.050253, -0.014707, 0.09548, -0.11062, -0.14256, 0.026859, -0.19465, 0.18485, 0.1789, 0.15499, -0.028242, 0.044796, -0.058444, 0.013625, -0.079693, -0.1145, -0.12378, -0.065906, -0.15742, 0.12985, 0.20266, 0.038497, -0.025654, 0.075726, -0.022083, -0.085487, 0.032081, -0.16479, -0.22038, -0.22297, -0.38061, 0.12776, 0.3174, -0.015834, 0.055459, 0.011929, 0.024193, 0.090971, 0.16123, 0.0089118, -0.017295, -0.35854, -0.48144, 0.033786, 0.12099, -0.022527, 0.049459, -0.029491, 0.25613, 0.11469, 0.12808, 0.11403, 0.30507, -0.19905, -0.20054, 0.039641, -0.043767, 0.03361, 0.0098997, 0.11272, 0.18547, 0.15244, 0.061145, 0.11826, 0.12075, -0.019667, -0.00048386, -0.12176, 0.036172, -0.11869, -0.12502, 0.035905, 0.01784, 0.060859, 0.096352, -0.049212, -0.045373, -0.055897, -0.0023764, -0.038383, 0.0064116, -0.17559, 0.002325, -0.051727, -0.057791, 0.013791, 0.13645, -0.010155, -0.017626, 0.073653, 0.00069329, -0.050008, -0.31928, -0.18353, -0.085538, -0.073096, 0.09019, 0.10661, 0.090351, 0.13292, -0.011857, 0.052935, 0.043013],
[0.063687, -0.027474, 0.040793, 0.033944, 0.067494, -0.084203, -0.024907, 0.0091584, -0.06882, 0.0031107, -0.097109, 0.11878, 0.0371, -0.089403, 0.021829, 0.050693, 0.01234, -0.023686, -0.02684, 0.034846, -0.016166, -0.027865, 0.12116, 0.0037369, 0.13532, 0.021592, 0.018171, 0.015073, 0.070401, 0.0022894, -0.038532, 0.073413, -0.029637, 0.14797, 0.12294, 0.068355, 0.16847, 0.092089, 0.12471, 0.06941, 0.0028282, 0.028941, -0.082406, -0.09934, -0.0023105, -0.044478, 0.00088096, -0.085099, -0.0064586, -0.044295, 0.10096, 0.14859, 0.1447, 0.078676, 0.041103, -0.18575, -0.17065, -0.17155, -0.25171, -0.27337, -0.21265, -0.17173, 0.027527, 0.05618, 0.12158, 0.079338, -0.12195, -0.13969, -0.026572, -0.07417, -0.14513, -0.115, -0.18279, -0.24715, -0.13748, -0.068393, 0.098672, -0.1674, 0.075274, -0.0044961, 0.1326, 0.31234, 0.15518, 0.06646, -0.015468, -0.030267, -0.05626, -0.038216, 0.067129, 0.12319, 0.18469, 0.086525, 0.095784, 0.15931, 0.07563, 0.11757, -0.076016, -0.011817, -0.051957, 0.17489, 0.14148, 0.086957, 0.081058, 0.046959, 0.049182, 0.003411, 0.015581, 0.026515, -0.062879, -0.056347, -0.093781, -0.23964, -0.13259, -0.084366, -0.12791, -0.070084, -0.044962, 0.049251, 0.072447, -0.016197, 0.10029],
[0.022795, 0.031855, 0.024367, -0.088291, 0.072323, -0.062925, -0.0040861, -7.973e-05, 0.013966, -0.025131, 0.017076, 0.043144, -0.077791, 0.048534, 0.007217, -0.035475, 0.035692, -0.0053752, 0.043054, 0.036426, 0.026332, 0.018922, 0.034425, -0.043307, -0.023769, 0.080994, 0.0014023, 0.068008, 0.095105, 0.10798, 0.024411, 0.043708, 0.05651, 0.038013, -0.016919, 0.13076, 0.11446, 0.21239, 0.28796, 0.092687, 0.096764, 0.070116, 0.046945, -0.02811, 0.18644, 0.077871, 0.11792, -0.035608, -0.036649, -0.13441, -0.12092, -0.15624, -0.17026, -0.12518, -0.14934, 0.15932, 0.04839, -0.10848, -0.12256, -0.19726, -0.15716, -0.21753, -0.20063, -0.092267, -0.020573, -0.071637, 0.063398, -0.10021, -0.1558, -0.14944, -0.11921, -0.081202, -0.11695, -0.0067284, -0.046838, -0.0077863, 0.019981, -0.12167, -0.11523, -0.057472, -0.052229, -0.046891, 0.061574, 0.11811, 0.17402, 0.13372, 0.19273, 0.13838, -0.043682, -0.035941, 0.011031, 0.066035, 0.16274, 0.10016, 0.15019, 0.051561, 0.058406, 0.020233, 0.080342, -0.066884, 0.043092, 0.061076, 0.043765, 0.031379, -0.0054635, 0.039411, -0.017169, -0.027826, -0.0047149, 0.036104, 0.054667, 0.04624, -0.045456, 0.049402, -0.047668, -0.014225, -0.059509, -0.13174, -0.010384, -0.087812, -0.077603],
[-0.032356, 0.018327, 0.017296, -0.027671, -0.0076809, -0.041377, -0.015062, -0.043781, 0.036477, 0.044229, 0.18106, 0.042891, -0.020853, -0.024082, 0.041552, -0.014679, -0.040842, 0.017432, 0.0070217, 0.1293, 0.15511, 0.2479, 0.015244, -0.016083, -0.051589, -0.092487, 0.045744, 0.057517, 0.1687, 0.26355, 0.13879, 0.14252, -0.078456, 0.0045618, -0.049966, 0.080369, 0.050147, 0.067477, 0.13152, 0.16709, 0.014141, -0.095378, -0.20288, -0.39934, 0.018783, 0.055848, -0.005273, 0.094884, 0.092662, 0.026342, -0.086839, -0.21346, -0.28211, -0.14896, -0.15888, 0.014524, 0.064105, 0.015209, 0.094836, 0.056563, -0.16636, -0.24132, -0.25962, -0.13982, -0.15532, 0.011695, 0.032011, -0.037561, 0.066608, -0.0076642, -0.04071, -0.04226, -0.090012, 0.069267, 0.15115, 0.15845, 0.15654, 0.057963, -0.031603, -0.0055733, -0.063345, 0.014275, 0.031681, 0.03982, 0.093416, 0.11919, 0.039897, 0.1715, 0.0032917, 0.0044847, -0.021099, 0.02581, -0.13673, -1.2468e-05, 0.045304, -0.052655, 0.020909, 0.08479, -0.063339, 0.091377, 0.072522, -0.07921, -0.067294, -0.04391, 0.029396, 0.023947, 0.017167, 0.030553, -0.058622, -0.0098427, 0.20196, -0.023669, -0.014002, -0.037283, -0.023078, 0.01559, -0.013169, -0.031499, -0.039786, 0.054516, -0.040513],
[-0.11875, -0.082293, -0.095608, -0.020578, -0.051846, -0.010859, -0.022717, 0.12821, 0.20208, 0.10327, 0.19572, 0.018529, -0.062344, 0.036177, 0.04107, 0.0079762, -0.10314, 0.0064955, 0.12399, 0.024168, 0.030885, -0.074999, -0.0404, -0.026348, -0.0040063, -0.098214, -0.033436, 0.11941, 0.25556, 0.03896, -0.072604, -0.080306, -0.10381, -0.05732, 0.015516, 0.062556, -0.073829, 0.092347, 0.19891, 0.16973, -0.044618, -0.17459, -0.16856, -0.12959, 0.0028653, 0.039282, 0.051811, 0.05423, 0.13871, 0.27288, -0.31439, -0.4393, -0.14064, -0.11423, 0.047797, -0.065062, -0.0042604, 0.029463, 0.025105, 0.14743, -0.34598, -0.42017, 0.035073, 0.079596, 0.13323, 0.1334, -0.061958, 0.06892, -0.038536, 0.047215, -0.14334, -0.21161, 0.14176, 0.17098, 0.14175, 0.037859, 0.31086, -0.029229, 0.01515, 0.034324, -0.011782, -0.077397, 0.00082481, 0.042535, 0.049854, 0.13021, 0.20732, 0.070042, -0.037027, -0.031792, -0.064806, -0.082587, -0.074375, 0.013859, 0.15057, 0.13055, 0.023194, -0.079371, -0.076747, -0.056515, 0.070663, -0.082981, 0.038591, 0.036885, 0.10304, 0.028582, -0.11389, -0.023276, -0.020208, -0.1467, 0.023731, -0.018263, 0.11113, 0.01781, 0.20204, 0.050785, 0.06147, -0.0075508, 0.00039041, -0.14722, -0.3692],
[-0.11817, 0.050808, 0.027086, -0.058324, -0.069752, -0.021027, -0.0010775, 0.07435, -0.0083997, 0.024897, 0.087436, -0.019099, -0.046098, -0.039781, 0.0088895, 0.0075569, -0.019311, 0.055368, 0.044256, 0.0032692, -0.010373, 0.072601, -0.0081004, -0.024375, -0.0051757, -0.0076083, -0.038608, 0.092478, 0.00029774, 0.041278, 0.081716, 0.02474, 0.18486, -0.025645, -0.025676, -0.069747, 0.054381, 0.049825, 0.13027, 0.1711, 0.059608, 0.089855, 0.095437, 0.15876, -0.059134, 0.090977, 0.095109, 0.11556, 0.17971, 0.033055, -0.035525, -0.10878, -0.050794, -0.076391, -0.056758, 0.13477, 0.12869, 0.13014, 0.0063887, -0.089729, -0.31295, -0.28325, -0.22477, -0.21457, -0.13308, -0.26981, 0.0050166, -0.080398, -0.085216, -0.18399, -0.23965, -0.12035, -0.076984, -0.01802, -0.023775, -0.10766, -0.167, 0.015041, 0.04251, -0.12958, 0.029351, -0.019786, 0.12164, 0.19449, 0.18157, 0.13918, 0.036259, -0.05933, -0.053816, -0.058012, -0.024991, -0.039656, 0.16051, 0.14621, 0.076529, 0.20618, 0.08613, 0.23683, 0.178, -0.031569, -0.011339, 0.0075929, 0.036795, 0.033074, 0.024137, 0.025796, 0.012497, -0.019553, 0.05285, 0.090518, -0.012948, 0.077672, 0.03561, 0.077328, -0.037094, -0.0047151, -0.059217, -0.13706, -0.084998, -0.20364, -0.1024],
[0.0032467, -0.0050619, -0.021818, 0.020874, -0.023531, 0.032369, 0.02328, -0.069079, 0.028859, -0.022912, 0.03505, 0.021373, 0.043177, 0.031001, -0.022728, -0.04113, -0.011957, -0.0073658, 0.019513, 0.056489, -0.018007, 0.023594, -0.060975, 0.13275, -0.020289, 0.093323, 0.18376, 0.093308, 0.017002, 0.029001, -0.03262, -0.077144, -0.026313, -0.036376, 0.030017, 0.081068, 0.17134, 0.14545, 0.14412, 0.2509, 0.18953, 0.10962, 0.11869, 0.097649, 0.017539, -0.16077, -0.089442, -0.16627, -0.19946, -0.12054, -0.099975, -0.0030788, 0.17592, 0.0094048, 0.24138, -0.10617, -0.041295, -0.18663, -0.10129, -0.15612, -0.19263, -0.26517, -0.21075, -0.1524, -0.016384, 0.10147, 0.0087661, 0.033117, 0.022842, -0.12277, -0.10457, -0.046811, -0.05131, -0.12955, -0.085883, -0.21065, 0.067424, 0.07409, 0.082147, 0.095757, 0.12801, 0.19242, -0.010488, 0.002463, -0.014173, -0.069939, -0.071938, -0.073642, 0.031404, 0.11052, 0.082629, 0.072224, 0.081941, 0.14731, 0.13688, 0.093928, 0.026163, -0.034217, -0.096254, 0.052569, 0.058021, -0.069487, 0.10387, 0.016885, 0.0057524, -0.033858, 0.0992, 0.0027588, 0.028883, 0.0077988, -0.02613, -0.10093, -0.059725, -0.16032, -0.026296, -0.081817, 0.019856, 0.011593, 0.033536, -0.03719, 0.039209],
[0.15106, 0.0077706, 0.040428, -0.0017943, -0.041654, -0.068591, 0.0062988, 0.026863, -0.032304, -0.019033, 0.007998, 0.27836, 0.068631, 0.10034, 0.09688, -0.0033598, 0.054326, -0.055942, -0.0054187, -0.0077552, 0.0045759, -0.00017646, -0.009476, 0.20486, 0.23126, 0.16314, 0.098539, -0.0099257, 0.053672, -0.088889, 0.023933, 0.012746, 0.013848, -0.39204, -0.21351, -0.17917, 0.010687, 0.16695, 0.2016, 0.16449, 0.011415, -0.026561, 0.0072565, -0.0063508, -0.16007, -0.15189, -0.22446, -0.21975, -0.14908, -0.011673, 0.10656, 0.16673, 0.027289, -0.0080445, 0.075809, 0.023838, -0.060319, -0.15809, -0.1508, -0.21785, -0.18411, -0.034762, -0.0030781, 0.14435, 0.098192, 0.0189, 0.14331, 0.13334, 0.10003, -0.011991, -0.081184, -0.091853, -0.059061, -0.030702, 0.0091318, 0.030031, -0.029166, 0.11125, 0.10479, 0.060406, 0.13088, 0.094447, 0.046888, -0.099894, 0.00043867, -0.079159, -0.030958, 0.051181, 0.036532, -0.026314, 0.048772, -0.019627, 0.041812, 0.020275, -0.035311, -0.0357, 0.037776, -0.01539, 0.10246, -0.004495, 0.0051588, 0.038344, 0.052952, -0.020141, 0.038911, -0.02581, -0.054107, -0.059081, -0.019798, 0.051849, -0.073763, -0.038341, -0.06688, -0.018986, 0.04871, -0.019809, 0.010562, -0.024563, -0.015141, -0.047958, 0.21089],
[-0.12519, -0.11688, -0.058961, 0.042235, 0.027385, 0.073378, 0.1997, 0.18078, 0.17754, -0.12636, 0.08321, 0.029824, -0.0015425, -0.016459, 0.077534, 0.00013268, 0.09375, -0.044727, -0.19635, -0.22782, 0.11588, 0.28944, -0.068772, 0.010802, -0.0078676, 0.079851, 0.21293, -0.0089784, -0.068418, 0.022956, -0.026211, 0.057828, -0.079483, -0.016172, 0.062689, -0.021796, 0.12691, -0.047525, -0.049301, 0.048206, -0.21716, 0.02813, 0.12406, -0.086131, 0.076895, 0.038135, 0.011629, 0.070698, 0.0084135, -0.11267, -0.39755, 0.073041, 0.16994, -0.11001, -0.24501, -0.01654, 0.037589, 0.12221, 0.04684, -0.19362, -0.50341, -0.46225, 0.30127, 0.38513, -0.19299, -0.50883, 0.057766, 0.085916, 0.0025825, -0.15402, -0.081067, 0.13999, 0.1736, -0.0082113, 0.034164, 0.033688, -0.15384, -0.0035718, 0.011347, -0.017873, 0.039147, 0.10637, 0.076248, 0.13996, -0.12176, -0.064375, 0.022872, 0.20474, 0.014948, -0.039363, 0.024752, 0.06253, 0.0078273, 0.08754, -0.034543, 0.058746, -0.075126, 0.076597, 0.19454, 0.021682, -0.073489, -0.058083, 0.012328, 0.076039, -0.036913, -0.018863, -0.079317, 0.016094, -0.18419, 0.049227, -0.061457, 0.028283, 0.10422, 0.018037, 0.062905, 0.072053, 0.012388, 0.09073, 0.11439, 0.10143, 0.19506],
[-0.037472, 0.079003, -0.11809, -0.011576, -0.047355, -0.04382, -0.022041, -0.015582, -0.06045, 0.0056711, 0.087342, -0.047485, 0.055578, 0.014641, 0.10885, 0.072561, 0.053636, -0.017556, 0.042134, -0.029061, -0.12502, -0.017197, -0.013398, 0.011501, 0.027702, 0.027412, 0.029975, 0.073364, 0.010914, 0.07541, 0.13044, 0.023411, -0.0048254, 0.074978, 0.054355, 0.042047, -0.015464, 0.022631, -0.063888, -0.040446, -0.11272, -0.077312, 0.018981, 0.079484, 0.042423, -0.00069404, -0.069229, 0.07743, 0.20474, 0.28719, 0.30504, 0.3255, 0.14073, -0.015201, -0.04186, 0.17136, 0.15274, 0.15944, -0.046361, -0.22277, -0.34374, -0.38756, -0.37353, -0.17546, 0.024942, 0.038533, 0.12622, -0.29897, -0.47417, -0.40534, -0.044667, 0.12588, 0.18503, 0.074482, -0.10022, -0.34732, -0.099282, -0.29838, -0.18662, 0.035652, 0.4013, 0.060801, -0.020916, -0.017432, 0.0064527, 0.31447, 0.27814, -0.042857, -0.10711, 0.12305, 0.34204, 0.11781, -0.098208, -0.22534, -0.17337, 0.025185, -0.11168, 0.2142, -0.04395, -0.023907, -0.065585, 0.092041, -0.03531, -0.13397, -0.038995, -0.12154, -0.13006, -0.17042, 0.11042, 0.092651, 0.13111, 0.058002, -0.0026521, 0.15722, 0.066071, 0.039488, 0.039274, 0.19072, 0.10773, -0.028126, 0.057979],
[0.14781, -0.039386, -0.022921, 0.053882, 0.12599, 0.028203, 0.034607, -0.042381, 0.03885, 0.03641, 0.1629, 0.089845, -0.046053, -0.082096, -0.22397, -0.11679, 0.10054, -0.0082322, -0.010907, -0.029538, 0.0049451, 0.10219, 0.18664, 0.21337, 0.096928, 0.082225, -0.042534, -0.052259, -0.020309, -0.10672, -0.088221, -0.15579, 0.23093, -0.079956, -0.13801, -0.056966, -0.28523, -0.0068234, 0.26377, 0.035257, -0.00096948, -0.13355, -0.095292, 0.10809, -0.22622, 0.13751, 0.30589, 0.4709, -0.26226, -0.24292, 0.22232, 0.090544, 0.043301, -0.055195, 0.01245, -0.48339, -0.41102, 0.015183, 0.26867, -0.18588, -0.65746, -0.3708, 0.26182, 0.20686, -0.062913, -0.0046315, -0.34603, -0.057876, -0.080074, -0.060733, -0.063132, 0.33223, 0.16004, 0.084047, -0.02977, 0.045421, 0.034504, 0.37536, 0.088936, 0.18256, 0.079936, 0.23524, 0.11129, 0.10974, -0.047221, -0.11616, -0.06731, 0.034599, 0.23286, 0.1319, -0.041749, -0.18972, -0.070314, -0.04434, -0.052799, -0.12426, 0.045488, -0.13703, 0.059172, -0.056679, -0.074185, -0.096952, -0.021836, -0.065731, 0.021349, -0.083419, 0.052566, -0.0026602, 0.038735, 0.068176, 0.22646, 0.08289, 0.035399, 0.067321, 0.1424, 0.085139, 0.05037, 0.0010888, -0.01828, -0.017226, 0.08422],
[0.11801, 0.048642, -0.10679, 0.0052911, 0.23136, 0.17221, 0.17682, 0.20045, 0.052122, -0.14026, 0.022439, -0.019828, -0.13731, 0.092577, 0.20996, -0.16372, -0.15701, -0.17369, -0.058054, -0.015724, 0.019399, -0.04931, -0.11375, -0.014247, 0.070739, -0.088328, -0.13682, -0.078888, 0.053145, -0.19438, -0.00017069, 0.13425, 0.0093321, -0.18143, 0.12021, 0.29639, -0.0090975, 0.039856, -0.084631, 0.036932, -0.14789, 0.19687, 0.40664, -0.14336, -0.18437, -0.038752, 0.29571, 0.053689, -0.19565, -0.34486, -0.50121, -0.40626, 0.13382, -0.00028762, -0.20092, 0.11021, -0.18696, -0.23952, -0.1882, -0.020408, -0.10626, 0.10776, 0.19942, -0.058277, 0.027522, 0.18135, 0.068695, 0.01411, 0.019796, -0.069519, 0.085999, 0.25122, 0.24992, 0.20675, 0.093802, -0.071506, 0.083957, 0.042664, -0.044898, 0.075633, 0.18471, 0.092312, 0.16477, 0.067407, -0.035391, -0.10051, -0.14948, -0.085912, 0.119, 0.022232, -0.059604, -0.083714, -0.12267, -0.071818, -0.061365, -0.037122, -0.024043, -0.0077183, -0.027903, -0.070229, 0.067283, -0.022097, 0.030069, 0.016509, 0.007991, 0.053658, -0.016975, 0.037888, -0.1034, 0.093947, 0.17569, 0.053193, 0.083328, -0.012242, 0.11153, 8.8778e-05, -0.0059795, 0.079576, -0.011219, 0.13063, 0.13094],
[0.14423, -0.010081, 0.0073771, 0.065269, 0.055849, 0.052364, -0.022519, -0.0099854, 0.0074881, -0.007637, 0.095115, 0.0074869, 0.01523, 0.040218, -0.085367, -0.17283, 0.011588, -0.058982, -0.091214, -0.055486, -0.085056, -0.012889, 0.082192, -0.088216, -0.1761, 0.020768, 0.29732, 0.34473, 0.35075, 0.16758, -0.084317, -0.08765, -0.029301, 0.0082198, -0.14179, 0.20164, 0.30623, -0.089834, -0.32991, -0.2377, 0.14059, 0.22935, -0.069549, 0.13057, -0.031497, 0.0079274, 0.084812, -0.29146, -0.12913, 0.070966, -0.089487, -0.076857, -0.031867, -0.094906, -0.076821, -0.28838, 0.0878, 0.20019, -0.17097, 0.015334, -0.28908, -0.029527, -0.31385, 0.04304, 0.45577, -0.18071, -0.13847, 0.042623, 0.27232, -0.19148, -0.11016, -0.1177, -0.20542, -0.34623, 0.23755, 0.286, -0.077963, 0.034879, -0.026162, 0.12712, 0.14403, -0.034149, -0.088551, -0.027746, 0.12772, 0.10002, -0.18643, 0.041461, 0.057714, -0.083882, -0.083313, 0.026147, 0.057512, 0.098777, 0.20838, 0.081416, -0.031359, 0.010864, 0.054168, 0.036336, -0.037734, -0.05846, -0.050706, 0.0721, 0.077237, 0.032034, 0.083688, -0.018741, -0.068237, -0.067252, 0.12643, 0.092411, -0.032832, 0.10361, -0.020642, 0.050396, 0.014052, -0.024231, -0.050094, 0.029354, 0.10979],
[0.060638, 0.011634, 0.11414, 0.11755, 0.020855, 0.10975, -0.04499, -0.011033, -0.053613, -0.044758, -0.10039, 0.13435, -0.024159, -0.084524, -0.09196, 0.10789, 0.045998, 0.055275, 0.064359, 0.01579, 0.02093, 0.040827, 0.13163, 0.059409, -0.026657, -0.14317, -0.10542, 0.073237, 0.082434, 0.062596, -0.0031044, -0.08584, -0.052855, -0.058037, 0.029722, 0.092669, -0.14987, -0.13354, 0.050258, 0.014996, 0.11314, 0.052153, 0.010578, 0.013768, -0.23145, -0.067587, 0.14188, 0.21502, -0.237, -0.2807, 0.024433, 0.017266, 0.017658, 0.026414, 0.088078, -0.19379, -0.33747, 0.1001, 0.36813, -0.034259, -0.51529, -0.21456, -0.029064, 0.029684, 0.11428, 0.035997, -0.31781, -0.038939, 0.17083, -0.019832, -0.015435, 0.21067, -0.06212, -0.026936, -0.055531, -0.02588, -0.056537, 0.082252, 0.13249, -0.050895, -0.023069, -0.0065804, -0.029029, 0.16671, 0.037287, 0.032007, 0.022986, 0.033098, 0.25107, 0.055248, -0.078427, -0.06518, 0.001903, 0.015118, 0.031629, 0.074471, 0.032408, 0.033763, -0.055109, 0.029518, -0.0055725, -0.022572, 0.0049783, -0.034893, 0.030152, -0.046318, 0.017217, -0.090595, 0.010987, 0.014754, 0.11881, -0.018854, 0.05457, 0.05288, 0.083388, 0.068291, 0.063598, 0.051887, 0.083087, 0.021603, -0.059861],
[0.090807, 0.044777, -0.0060042, -0.050363, -0.038872, -0.12117, 0.022973, -0.031712, 0.038054, 0.0045987, -0.03566, -0.035675, -0.09299, -0.039163, -0.0069044, 0.013836, 0.030661, 0.070549, 0.02941, -0.012522, 0.051323, -0.0037635, -0.070014, 0.010861, 0.032727, 0.13749, 0.058184, 0.13751, 0.07872, 0.10379, -0.028949, 0.062082, -0.036945, 0.1129, 0.034426, 0.044915, -0.057007, -0.15438, -0.082871, -0.12982, -0.043612, 0.065964, 0.036324, 0.063714, 0.021735, -0.078259, -0.036957, 0.13355, 0.28201, 0.32487, 0.33827, 0.18538, 0.073223, 0.019788, 0.13765, 0.078068, 0.08518, -0.069126, -0.090879, -0.22904, -0.33514, -0.34107, -0.35148, -0.14298, 0.075348, 0.14776, -0.045856, -0.24152, -0.21753, -0.13094, 0.020511, 0.097672, 0.14601, -0.12507, -0.37252, -0.40824, -0.045906, -0.16008, 0.079378, 0.3144, 0.19158, 0.029031, -0.11483, 0.076726, 0.30135, 0.27546, -0.0068621, -0.36522, -0.067019, 0.2062, 0.0525, -0.13265, -0.07895, -0.20642, -0.24381, -0.086798, 0.23653, 0.22019, -0.036973, -0.049162, 0.14626, 0.14505, -0.22743, -0.082066, -0.12119, -0.043182, -0.098016, 0.02947, 0.13747, 0.0062917, 0.16322, -0.091364, 0.073288, 0.11423, 0.08521, 0.15332, -0.072661, 0.20467, 0.026701, 0.036011, 0.078828],
[0.18112, 0.073306, 0.040736, -0.030592, -0.014723, -0.0097177, 0.12725, 0.030397, -0.058889, -0.026611, 0.066681, 0.066608, -0.071919, -0.0083165, -0.017286, 0.038603, 0.067084, -0.070282, -0.069691, -0.025275, -0.11015, 0.24938, 0.13938, -0.057198, -0.073331, -0.14479, 0.05242, -0.12935, 0.030685, 0.061611, -0.10213, 0.22393, 0.11686, 0.16687, -0.11111, -0.17122, 0.056582, -0.048939, 0.15918, 0.19178, -0.34144, -0.00029347, -0.046901, -0.19494, 0.045412, -0.0095034, -0.029117, 0.04141, 0.2315, 0.052449, -0.56727, 0.30029, 0.46091, 0.068319, -0.37008, 0.042656, -0.13943, 0.11478, 0.26741, -0.10449, -0.66828, -0.28238, 0.17754, 0.1737, -0.17216, -0.47505, 0.054836, -0.030162, 0.068493, 0.14671, 0.0071732, 0.29966, 0.2025, -0.17784, -0.11562, -0.13324, -0.097222, -0.028986, -0.035807, -0.10615, -0.13902, 0.016241, 0.1731, 0.19619, 0.11532, 0.085863, 0.16627, 0.31074, 0.046359, -0.0066806, -0.1195, 0.04915, -0.11685, -0.077622, -0.15566, -0.042823, -0.075959, -0.047232, 0.18267, 0.10711, -0.031804, 0.0641, -0.08334, 0.088606, -0.049002, -0.060791, -0.011939, -0.028966, -0.020443, 0.03072, 0.060614, -0.039898, 0.063701, 0.047369, 0.029398, 0.10606, 0.087013, 0.067144, -0.017892, 0.069808, 0.20794],
[-0.036185, -0.068424, 0.033948, 0.25798, 0.055755, 0.14929, 0.20629, 0.22367, -0.046034, -0.10955, 0.12202, 0.033686, -0.11812, 0.12834, -0.12897, -0.056304, -0.29473, -0.025196, -0.049804, 0.052954, -0.067019, -0.068227, -0.047831, 0.026913, 0.088734, -0.19263, -0.011955, 0.086306, -0.16802, -0.083379, 0.087896, 0.12512, -0.12768, -0.2193, 0.40485, 0.21682, -0.072674, -0.087649, -0.11089, 0.015296, -0.1123, 0.29574, 0.080991, -0.1695, -0.097181, -0.07649, 0.24096, -0.24206, -0.33279, -0.40824, -0.16983, -0.11497, 0.28958, 0.028529, -0.048023, 0.063, -0.030722, -0.066963, -0.011014, 0.075932, -0.080862, -0.16771, 0.101, -0.24229, -0.31555, 0.037389, 0.1555, -0.021451, 0.078024, 0.2267, 0.30002, 0.24804, 0.095539, -0.038035, -0.028632, 0.0083028, 0.096554, -0.093656, -0.17003, -0.046728, 0.054387, -0.011591, 0.19039, 0.080097, 0.18123, 0.11932, 0.021024, 0.0092452, 0.067406, 0.017941, -0.04075, -0.082441, -0.11871, -0.13318, -0.054036, -0.081002, -0.026664, -0.010407, 0.076209, 0.011612, -0.0056684, -0.030538, 0.020575, 0.053928, 0.047349, -0.038219, 0.034337, -0.00018566, -0.026357, 0.080691, 0.12907, 0.054592, 0.056561, 0.048194, -0.032352, 0.015293, 0.016805, 0.13319, 0.0038584, 0.11728, 0.10129],
[0.087039, -0.086031, 0.023999, -0.055001, -0.045275, 0.028719, 0.023279, 0.0072154, 0.079227, -0.032632, 0.15267, 0.044269, 0.10052, -0.11766, 0.067446, -0.016435, 0.030053, 0.10106, -0.1017, -0.066477, 0.012013, 0.0062465, -0.05766, -0.11952, -0.014951, -0.030954, 0.18712, 0.21588, 0.18761, 0.095823, -0.040222, -0.07325, 0.0042778, 0.055782, 0.082192, -0.012446, 0.17705, 0.1158, -0.24107, -0.085837, 0.15007, 0.28498, -0.14535, 0.010094, 0.095917, -0.29873, 0.17875, -0.22302, -0.17488, -0.043713, -0.1162, -0.23807, 0.0043004, 0.054212, -0.11568, -0.29339, 0.121, 0.4419, -0.15497, -0.022722, -0.21405, -0.020547, -0.27084, -0.095044, 0.2806, -0.27074, -0.13687, 0.17055, 0.3386, -0.2711, -0.35586, -0.26535, 0.082943, -0.35847, 0.34731, 0.15494, -0.1054, 0.094828, -0.10941, 0.019909, 0.13262, -0.049725, -0.10697, -0.25439, 0.17441, 0.1069, -0.077671, -0.0093719, 0.11752, 0.025752, 0.068028, 0.10986, 0.19781, 0.2037, 0.17359, 0.16858, -0.071588, -0.027858, 0.026995, -0.047967, -0.17448, -0.096432, -0.070821, 0.12976, 0.10169, -0.012905, -0.0072145, -0.076309, -0.074777, 0.049862, 0.13897, -0.01642, 0.087861, -0.035559, -0.034266, -0.041158, 0.11153, 0.021064, 0.066654, 0.031123, 0.21873],
[0.024272, 0.21153, 0.10969, 0.059161, -0.04225, -0.08748, -0.010603, 0.082455, 0.12208, 0.17548, 0.048487, -0.10566, 0.0072713, 0.0048265, -0.037108, 0.036969, 0.059266, -0.091124, 0.016032, -0.026239, -0.059022, -0.088673, -0.077264, 0.056275, -0.051047, 0.023388, -0.017324, 0.012251, 0.025666, -0.020853, 0.0066968, 0.073686, -0.099903, -0.12413, -0.018049, -0.018586, -0.044793, 0.017308, 0.10244, 0.000328, 0.0064671, -0.10225, -0.025294, -0.034442, -0.12789, -0.022149, 0.014835, 0.12138, 0.031883, 0.03247, 0.0090957, -0.063479, 0.10607, -0.099169, -0.16382, -0.14343, -0.032183, -0.058018, 0.022916, 0.04015, 0.10591, 0.11703, 0.051143, 0.024664, 0.022331, -0.14794, -0.046226, -0.052976, 0.017633, -0.083088, 0.039154, 0.083559, 0.074372, -0.010152, 0.0052221, -0.094777, -0.071077, -0.01963, -0.040408, -0.046653, -0.012629, 0.026326, 0.057107, 0.091724, -0.0027242, -0.15414, 0.044172, -0.03748, -0.058582, -0.10282, -0.030064, -0.030479, 0.092608, 0.044945, 0.045404, -0.010357, 0.0060041, -0.074053, -0.041777, -0.00050145, -0.034991, -0.036126, -0.0451, 0.025861, -0.053218, 0.012117, 0.12779, -0.16438, -0.01274, 0.019185, 0.084771, 0.019614, -0.034807, -0.0017216, 0.15755, 0.005375, 0.039444, 0.14283, -0.047934, -0.10056, 0.083257],
[-0.12767, -0.062412, -0.094141, -0.064796, -0.01781, -0.0691, -0.023075, -0.017484, -0.066453, -0.036872, 0.24167, -0.043101, 0.088798, 0.074579, 0.041306, 0.0411, 0.054755, 0.084087, -0.0097248, -0.049453, -0.081133, 0.064803, 0.058334, 0.048858, 0.003069, -0.037722, 0.054194, 0.0081354, 0.012382, -0.0081329, -0.053456, -0.091653, 0.06463, -0.0018238, 0.079983, -0.085168, 0.078834, -0.036841, 0.14405, 0.015137, -0.15092, -0.035986, 0.070901, 0.0031645, 0.012722, 0.017055, 0.03574, 0.020664, 0.288, -0.043946, -0.069905, -0.028876, 0.013241, -0.093933, 0.0073548, 0.021223, 0.088674, 0.15572, 0.18554, 0.051416, -0.30814, -0.1535, 0.015614, 0.033258, 0.007274, 0.068546, 0.15638, 0.027911, 0.18476, 0.017477, -0.32883, -0.27338, -0.082442, 0.040346, -0.010355, 0.048333, 0.10853, 0.20223, 0.060164, -0.016735, -0.16834, -0.29914, 0.034354, 0.045518, 0.020288, 5.4206e-05, 0.055521, 0.078561, 0.1685, -0.070184, -0.079489, -0.2965, 0.10263, 0.11174, 0.13931, 0.026571, 0.081658, 0.081828, 0.083098, 0.11143, -0.13933, -0.22918, -0.064352, 0.16181, 0.25167, 0.042481, 0.088318, 0.10703, 0.097667, 0.24657, 0.00077544, -0.20365, -0.12891, 0.074372, 0.25016, -0.0027412, -0.09113, -0.23136, -0.30385, -0.14846, -0.10313],
[0.0047306, -0.025051, -0.005842, 0.023077, -0.0021831, 0.093205, 0.16892, 0.13474, -0.019109, -0.10105, 0.062619, 0.01684, 0.01172, -0.0013488, 0.038407, 0.054231, 0.20955, 0.051311, -0.17892, -0.15157, -0.10803, 0.021082, 0.050527, 0.037029, 0.084086, 0.097194, 0.1163, 0.10292, -0.16563, -0.29211, -0.054203, -0.025851, 0.13698, -0.071433, 0.10358, -0.058267, 0.041899, 0.12303, -0.12859, -0.32801, -0.028641, 0.13915, 0.070612, 0.17863, 0.03674, 0.082604, 0.0015218, 0.093696, -0.11859, -0.24264, -0.17082, 0.31937, 0.10806, -0.025076, 0.28906, 0.16912, -0.0059925, 0.11217, -0.11767, -0.055105, -0.35075, 0.075522, 0.29102, 0.032924, 0.073925, 0.13286, 0.11032, 0.017466, -0.0088771, -0.12337, -0.02645, -0.032574, -0.17412, 0.27115, 0.13019, -0.072333, -0.22304, -0.0049243, 0.062008, -0.054843, -0.077837, 0.062096, 0.21463, -0.092882, -0.28273, -0.2134, -0.17286, -0.2332, 0.10998, -0.0075162, -0.11007, -0.003427, 0.078591, 0.1035, 0.25431, -0.15927, -0.27034, -0.10635, 0.048935, -0.021263, -0.12239, 0.0070055, -0.042365, 0.067623, -0.048467, 0.15103, 0.22133, 0.039738, -0.08448, 0.051462, -7.7552e-07, -0.0097437, -0.011729, 0.091255, 0.03032, -0.0098684, -0.0043867, -0.063745, 0.18972, 0.083907, 0.081622],
[0.35397, 0.22349, 0.057984, -0.17548, -0.28193, -0.035047, -0.061419, 0.073064, 0.061645, 0.077309, 0.17389, 0.092585, -0.19128, -0.21873, -0.15487, 0.14902, 0.20523, 0.089398, 0.029361, 0.18968, 0.069481, 0.22548, 0.093546, -0.13281, -0.17716, -0.13346, 0.26005, 0.18501, 0.053589, -0.04795, -0.068454, 0.090671, 0.11836, 0.067374, -0.079589, 0.00040371, -0.18012, 0.09018, 0.17516, 0.066704, -0.32349, -0.43602, -0.15344, 0.078031, 0.0026002, -0.0068308, 0.25009, 0.086593, -0.2945, -0.28058, -0.21672, 0.0075954, -0.057357, 0.050786, -0.13228, 0.063816, -0.02493, 0.1032, 0.27362, 0.10838, -0.10089, -0.36636, -0.099771, 0.16157, 0.055579, -0.12792, -0.097782, 0.03895, -0.011347, -0.0057841, 0.1616, 0.22732, 0.17202, 0.11473, -0.02501, -0.012533, -0.18287, 0.005862, 0.087637, -0.037285, -0.028907, -0.012641, 0.029752, 0.023716, 0.018978, -0.068872, 0.062344, -0.029721, -0.027412, 0.092857, -0.017031, -0.040569, 0.028207, -0.066991, 0.018046, 0.027421, 0.026029, -0.012257, 0.071946, 0.13443, -0.055826, 0.029494, 0.067669, -0.096084, 0.029157, -0.00057045, -0.10127, -0.024999, 0.1115, 0.06808, -0.0045362, -0.029235, -0.10839, -0.030881, -0.021536, 0.034917, -0.055573, 0.14693, 0.057093, 0.070054, 0.09283],
[0.090302, -0.032234, 0.086011, 0.057656, 0.085002, -0.018557, 0.10988, 0.15414, 0.039386, 0.047347, 0.13261, 0.17209, 0.087977, 0.10798, 0.063005, -0.025038, 0.0015666, 0.042298, -0.010857, 0.038565, 0.09115, 0.070429, -0.33965, -0.21627, -0.079793, 0.052482, 0.11737, 0.12356, 0.14986, 0.15132, -0.020854, -0.27884, -0.36994, -0.23348, -0.35031, -0.21236, -0.0096203, 0.16879, 0.10884, 0.1951, -0.02216, -0.13795, -0.3823, -0.15708, 0.2465, 0.21041, 0.0038882, -0.15092, -0.14973, -0.27658, -0.13643, -0.20644, -0.10322, 0.20312, 0.24972, 0.098784, 0.050022, 0.11216, 0.0082125, -0.15896, -0.24966, -0.2242, -0.081867, 0.16097, 0.13085, 0.089777, 0.0095536, -0.045308, -0.023385, 0.05727, 0.11323, 0.14404, 0.076514, 0.16611, 0.0012914, -0.061225, 0.023338, 0.046303, 0.046502, 0.05308, -0.02208, -0.016463, -0.02459, 0.036155, 0.016853, 0.038351, -0.031623, -0.015009, -0.00256, -0.044171, 0.020136, 0.038923, 0.023164, 0.01893, 0.016295, -0.02645, -0.031756, 0.037952, 0.04783, 0.039081, 0.012653, 0.019182, 0.052408, 0.067772, 0.071084, -0.036646, 0.13604, 0.010095, 0.020674, 0.050958, -0.017289, -0.021564, -0.011485, -0.076477, 0.0025912, -0.03506, 0.022443, -0.022651, -0.013427, -0.084684, -0.02786],
[0.22047, 0.13488, -0.0045314, -0.027832, 0.0031928, -0.11096, -0.14951, -0.26497, -0.0046697, 0.18623, 0.43027, 0.08365, 0.057113, 0.1422, 0.10169, 0.097731, 0.21612, 0.15447, -0.1386, -0.29659, -0.17497, 0.19818, 0.16783, 0.035357, -0.028903, -0.021291, 0.087221, 0.16959, 0.29274, -0.061147, -0.1512, -0.14884, -0.03919, 0.045408, -0.078471, -0.273, -0.38646, -0.05976, 0.17696, 0.1589, -0.090045, -0.0058036, -0.029934, 0.053751, 0.037133, 0.040635, -0.04802, -0.2107, -0.1441, -0.18667, -0.28265, -0.0036369, 0.22241, 0.039353, -0.0086786, -0.15038, -0.012859, 0.15635, 0.042299, -0.29268, -0.40523, 0.096518, 0.23155, 0.13543, 0.012292, -0.052369, -0.13532, -0.033103, 0.073328, 0.044657, 0.086151, 0.27385, 0.16267, 0.061526, -0.019745, 0.10503, -0.019421, -0.10477, -0.0051748, -0.069612, 0.013175, 0.080847, 0.064601, -0.021748, -0.0094289, -0.016282, -0.036344, 0.030459, 0.056434, 0.11018, -0.043666, -0.0042556, -0.073124, 0.029157, -0.045782, -0.018178, -0.026034, 0.062742, 0.057057, 0.11269, -0.014281, 0.066092, -0.026887, 0.015276, 0.0076592, -0.048903, -0.10792, 0.09321, 0.028853, 0.032763, -0.011491, 0.17616, 0.1057, 0.021853, -0.0058603, 0.0052496, 0.020608, 0.026462, -0.082618, -0.079352, -0.012265],
[0.024463, -0.027352, -0.023265, 0.11579, 0.12541, 0.071656, 0.059076, -0.021125, -0.05219, -0.0033401, -0.0084537, 0.080912, -0.057403, -0.16721, -0.158, 0.063754, 0.19561, 0.071414, 0.11892, 0.037161, 0.077087, 0.035863, 0.1314, -0.1115, -0.040614, -0.26028, -0.18926, 0.066083, 0.13274, 0.034849, 0.019788, 0.014095, 0.062232, 0.14344, 0.042856, 0.10733, 0.0098224, -0.23834, -0.21249, 0.084274, 0.0088423, 0.032948, 0.071734, 0.0063217, 0.194, 0.014862, 0.10869, 0.19643, 0.010298, -0.29226, -0.080019, -0.013688, 0.11311, 0.012928, 0.1563, 0.25797, 0.0068688, 0.15136, 0.20517, 0.22377, -0.37619, -0.13386, -0.020441, -0.013775, 0.040573, 0.055189, -0.12709, -0.05821, -0.008442, 0.17523, 0.03337, -0.18113, 0.034219, -0.1109, -0.1463, -0.0069699, 0.094796, -0.23705, -0.15881, -0.22841, -0.054433, -0.17474, 0.067644, 0.085915, 0.063464, -0.020901, -0.038395, 0.071986, -0.052571, -0.092667, -0.13827, -0.249, 0.047883, 0.31224, 0.088266, -0.06281, 0.034915, -0.069708, -0.0018865, 0.098095, -0.055813, -0.060679, 0.056062, 0.17983, 0.074314, -0.027045, -0.00044359, -0.067458, -0.045453, 0.042969, 0.079381, 0.058881, 0.16904, 0.010963, 0.042321, -0.071452, 0.043646, 0.077058, 0.080224, -0.017561, -0.044482],
[0.084549, 0.014073, -0.12307, -0.061069, 0.03087, -0.093121, -0.025168, 0.015404, -0.056966, -0.10833, -0.16715, 0.12222, 0.013801, -0.10225, 0.0023687, 0.087394, 0.049218, 0.029334, -0.00088026, 0.11339, 0.07953, 0.064893, 0.076669, -0.063082, 0.037023, -0.059661, 0.0166, 0.091314, -0.011486, -0.099932, 0.06516, -0.037572, 0.014463, 0.067622, 0.0025458, 0.015803, -0.10994, -0.069419, 0.021295, 0.060596, 0.026424, 0.0099006, 0.06539, 0.043328, 0.0095511, -0.076475, -0.034131, -0.075099, -0.049787, -0.0042179, 0.20028, -0.0015735, 0.11546, -0.0078019, 0.04754, 0.0074074, -0.0035661, 0.050506, 0.075847, -0.14426, -0.24271, -0.046073, 0.24353, 0.10855, 0.021319, 0.18208, 0.070465, 0.030956, 0.021331, 0.016481, 0.0086198, -0.29742, -0.41813, -0.16138, 0.14572, 0.16943, 0.15423, 0.11273, 0.046495, -0.023985, 0.1262, 0.029741, -0.012888, -0.11865, -0.25933, -0.10806, 0.041596, 0.18022, 0.1017, 0.018289, 0.13184, -0.004466, 0.052209, 0.17237, 0.14892, -0.1153, -0.2924, -0.13274, 0.14349, 0.12546, 0.1197, 0.096606, 0.083929, 0.24096, 0.18159, 0.21526, 0.094817, -0.17303, -0.16751, 0.053189, -0.014843, -0.13263, -0.2276, -0.28474, -0.2675, -0.11356, 0.12872, 0.2094, 0.038068, -0.18389, -0.098722],
[-0.29332, -0.076674, -0.03075, 0.12028, 0.12711, 0.051897, 0.13914, 0.1154, -0.068125, -0.0090238, -0.29102, -0.061269, -0.054506, 0.051034, 0.012541, -0.0064693, 0.017938, -0.05423, 0.011336, -0.025654, 0.0483, -0.11406, -0.024236, 0.09794, -0.043137, -0.070786, -0.068497, 0.096858, -0.061432, -0.038064, 0.057071, -0.035895, 0.015329, 0.056504, -0.010336, 0.027054, -0.034953, -0.012868, 0.076343, 0.047322, -0.037463, -0.0093979, -0.014027, 0.064562, 0.053722, -0.06759, 0.013911, -0.016445, -0.019462, 0.01044, 0.099418, -0.092003, -0.01811, -0.069116, 0.090085, 0.05416, -0.0018643, 0.0040598, -0.085946, 0.10862, 0.0271, 0.099142, 0.00066682, -0.057661, 0.024057, 0.068221, 0.036722, -0.0013717, -0.028206, -0.04576, 0.053362, 0.052631, 0.0098104, -0.012204, -0.16439, -0.021002, 0.10557, 0.13827, -0.0070213, -0.16276, -0.18906, 0.059904, 0.10226, 0.07404, 0.0042852, -0.18459, -0.069684, 0.14111, 0.12749, -0.10699, -0.058973, -0.027184, 0.092294, 0.042731, 0.029014, 0.091553, -0.075057, -0.13843, 0.0049805, 0.0097377, -0.17763, -0.053056, 0.0051213, -0.03116, 0.018286, -0.062989, 0.0087673, 0.045406, -0.15525, -0.10424, -0.33859, 0.00092931, 0.071524, 0.24813, 0.17765, 0.054742, 0.12449, 0.21578, 0.11743, 0.1181, -0.27756],
[0.23861, 0.03722, 0.03191, -0.14966, -0.09855, -0.095091, -0.030803, -0.040663, 0.017507, 0.028514, 0.08306, 0.0012191, -0.033229, -0.063142, 0.035545, -0.023608, 0.022431, -0.018828, 0.052736, 0.041581, 0.031034, -0.020525, -0.074378, -0.058852, -0.018417, -0.020185, 0.056556, -0.0026618, 0.052188, 0.12532, 0.019468, 0.096993, 0.052629, -0.095668, -0.1078, 0.047013, 0.12881, 0.1185, 0.046939, 0.011552, -0.10252, 0.034819, 0.089993, 0.11884, -0.026071, -0.10859, -0.028993, 0.12481, 0.24007, 0.40869, 0.26105, 0.050072, -0.0099467, -0.032287, -0.037881, -0.042541, 0.18047, 0.10729, 0.056245, -0.45229, -0.83931, -0.32647, 0.14836, 0.15629, 0.1474, 0.048456, 0.083157, 0.096331, -0.042531, 0.024992, -0.13245, -0.1692, -0.46441, -0.34745, -0.04738, 0.014762, 0.056736, 0.036695, 0.013279, -0.054248, -0.014839, 0.16411, 0.28499, 0.3327, 0.077933, -0.21058, -0.18028, -0.28799, 0.04902, -0.037058, 0.0052055, -0.017126, -0.0034699, 0.11284, 0.050042, 0.03923, 0.083779, 0.03011, -0.10733, 0.052781, 0.030826, 0.048218, -1.218e-05, 0.037878, -0.11301, 0.025972, -0.040362, 0.060663, -0.0029176, 0.019233, -0.023247, -0.024268, -0.048051, -0.039101, 0.055724, 0.019594, 0.001931, 0.052875, 0.11053, 0.059716, 0.065829],
[0.067034, 0.026573, 0.061903, -0.050613, -0.071247, -0.061282, -0.13244, -0.077383, -0.032986, 0.050994, 0.23206, -0.017426, 0.016764, -0.0045263, 0.07268, 0.072143, -0.025652, 0.011719, 0.015719, -0.14235, -0.012766, -0.055815, 0.062228, 0.11099, 0.12777, 0.039054, -0.010543, 0.052522, 0.0455, 0.0047552, 0.040037, -0.04187, -0.077744, 0.036623, 0.026947, 0.0048713, 0.01145, -0.012158, 0.024207, 0.083283, 0.079838, 0.073616, -0.072412, -0.039881, 0.090275, -0.0059398, -0.079683, -0.055949, 0.16965, 0.46194, 0.27437, 0.17637, 0.0055755, -0.040969, -0.048391, 0.025695, 0.099983, 0.12605, 0.27677, -0.090382, -0.72367, -0.66542, -0.093851, 0.125, 0.090998, 0.018067, 0.023896, 0.1111, 0.033726, -0.22605, -0.55798, -0.23541, -0.094805, -0.091208, 0.0077773, 0.13248, 0.03986, -0.25216, -0.2025, -0.17881, -0.11431, 0.29677, 0.22717, 0.2741, 0.049649, -0.056866, -0.064785, 0.037313, -0.11707, -0.052502, 0.047053, 0.024036, 0.13017, 0.056206, -0.040238, 0.048845, -0.010397, 0.0059061, 0.038086, -0.010127, -0.011702, -0.036779, 0.010231, 0.010569, -0.0050323, 0.0022982, 0.017051, 0.01618, 0.046103, 0.010502, 0.092567, 0.079401, 0.1057, 0.10683, 0.057219, -0.049671, 0.042693, -0.038684, -0.039504, -0.02074, 0.014244],
[0.062853, 0.070715, 0.0043518, -0.026667, 0.044525, 0.0088609, -0.059432, 0.12209, 0.10824, -0.025643, 0.055453, -0.03091, 0.0048755, -0.11083, -0.028824, -0.0050464, -0.0020802, 0.065154, 0.0042318, -0.016502, 0.039369, 0.1447, 0.036147, -0.025105, -0.0029753, -0.027231, -0.0265, 0.052084, 0.15939, 0.029111, 0.005888, 0.070684, -0.10502, -0.012995, -0.027731, -0.038084, -0.02885, 0.088899, 0.12716, 0.093878, 0.12446, -0.060464, -0.12926, 0.058859, 0.16395, 0.066259, 0.040324, -0.035531, 0.074783, 0.027442, -0.034548, -0.15238, -0.13605, 0.065147, -0.0074265, 0.004604, 0.078352, 0.12973, 0.095682, 0.10648, -0.47116, -0.76254, -0.35821, -0.013246, -0.13303, -0.10815, 0.012183, 0.014157, -0.026232, -0.04006, 0.013821, 0.24427, 0.3074, 0.050528, -0.023096, 0.032938, 0.085879, 0.041108, -0.0006755, 0.0383, -0.054725, -0.032597, 0.078231, 0.16873, 0.085156, -0.075477, 0.075846, -0.065616, 0.026372, -0.012261, 0.018816, -0.046021, 0.063677, 0.0091643, 0.021381, 0.010299, 0.025836, -0.0032034, 0.09386, -0.044507, -0.0094275, 0.014357, 0.00037736, -0.047078, -0.00096697, -0.010147, 0.0099517, -0.00041656, -0.03546, 0.013201, -0.034598, -0.040736, 0.051474, -0.030682, 0.033804, 0.043771, 0.089867, 0.0076302, 0.042986, 0.0073348, 0.089498],
[0.15589, 0.01563, 0.077531, 0.035199, 0.098615, 0.06922, -0.051016, 0.013532, -0.16689, -0.077939, 0.021709, 0.051428, -0.064349, -0.015228, 0.012759, -0.012492, -0.052545, -0.06904, 0.050431, 0.036664, 0.10485, 0.086416, 0.050032, 0.056994, -0.002549, -0.0007908, 0.0014992, -0.18329, -0.0010931, -0.051995, 0.0076178, 0.05014, 0.083661, -0.028368, -0.057671, -0.024747, -0.17552, -0.053854, -0.049492, 0.028096, 0.16657, 0.17516, 0.11078, 0.23647, -0.019601, 0.0020069, -0.10476, -0.053073, 0.078984, 0.28337, 0.35166, 0.20796, -0.0051423, -0.066194, -0.049047, -0.035658, -0.053202, 0.076803, 0.29382, 0.27042, 0.32595, -0.14797, -0.18679, -0.049879, -0.099671, -0.040296, 0.022962, 0.11787, -0.072577, 0.15221, -0.11057, -0.27509, -0.22644, -0.21712, -0.065674, -0.05204, -0.09196, 0.052341, -0.029014, -0.026487, -0.099176, -0.11757, -0.13254, -0.076327, 0.079955, -0.17744, 0.080376, -0.073856, 0.08774, -0.13915, 0.0099844, -0.05868, -0.057029, -0.079794, 0.0015768, -0.0041526, 0.034597, 0.0086646, 0.057269, -0.026265, 0.048094, 0.021793, -0.11755, 0.00049937, -0.09137, 0.17327, 0.031573, 0.022297, 0.0028041, 0.12055, 0.22973, 0.053206, -0.01461, 0.11664, 0.082758, -0.089172, 0.061309, -0.041124, 0.0013241, -0.022405, 0.066514],
[0.10641, 0.094792, -0.031529, -0.068663, -0.045583, -0.044171, -0.062373, -0.040882, 0.036681, -0.031891, -0.088635, 0.072486, 0.0017913, 0.071618, -0.10841, 0.055537, 0.020791, 0.052668, -0.011258, -0.084503, -0.055355, 0.069471, -0.028455, -0.092204, -0.059139, -0.0088604, 0.013756, 0.013008, 0.11917, -0.0054767, -0.0046385, 0.10607, 0.1319, 0.033045, -0.0059853, -0.063203, 0.04293, -0.07752, 0.10193, -0.12768, -0.091567, -0.057976, -0.13595, -0.048452, 0.011192, -0.0068851, -0.096621, 0.081772, -0.049007, 0.19762, 0.18536, 0.054459, -0.085416, -0.1103, 0.26784, -0.042453, 0.07976, 0.15028, 0.27327, 0.23584, 0.029238, 0.14907, 0.31049, 0.40128, 0.38541, 0.27327, 0.15637, 0.14855, 0.13417, -0.1554, -0.21625, -0.28189, -0.25441, -0.24392, -0.045056, -0.13584, -0.36047, 0.05411, -0.27378, -0.087569, -0.027321, -0.039262, 0.17563, 0.0038011, -0.11816, -0.14962, -0.071035, -0.11256, -0.067348, 0.043317, -0.10302, -0.15125, -0.045348, -0.22755, 0.0502, -0.02991, -0.10883, -0.0018045, -0.14576, 0.0095245, 0.017125, -0.0035127, -0.058373, 0.08984, -0.043367, 0.096739, 0.037002, 0.086995, 0.019892, 0.021145, -0.093457, 0.027113, -0.10194, 0.083879, 0.075076, 0.050127, 0.088653, 0.020525, 0.086116, -0.0054914, 0.1418],
[-0.023176, -0.024545, -0.032358, 0.061548, -0.028032, -0.11117, -0.028557, 0.034625, -0.076973, -0.011746, -0.0099598, -0.054284, 0.047969, -0.058235, 0.032203, 0.031829, -0.0085909, -0.01854, 0.059493, 0.032667, 0.011822, 0.011903, -0.091303, 0.010421, 0.047574, -0.010086, -0.082131, -0.035238, -0.0095366, -0.0021083, -0.011205, -0.10622, 0.0088673, 0.080682, -0.090533, 0.0092003, 0.04758, -0.0034736, -0.26095, -0.19924, 0.12708, 0.076817, 0.0089468, -0.01743, 0.27183, 0.29541, 0.24001, 0.32835, 0.30453, 0.15738, 0.27144, 0.27187, 0.31738, 0.17968, 0.34964, 0.17948, -0.19852, -0.23132, -0.30349, -0.018142, 0.32802, 0.10088, -0.27373, -0.34405, -0.10799, -0.028605, -0.19185, -0.027746, -0.010639, -0.062358, -0.22873, -0.17307, -0.10579, -0.12595, 0.0052134, -0.033021, -0.071929, -0.084042, 0.037289, -0.14901, -0.051878, -0.06245, -0.14709, 0.018449, 0.0039521, -0.079257, -0.068342, -0.12332, -0.099563, -0.12283, -0.0063814, 0.15237, 0.056225, -0.0045107, -0.057588, 0.098403, 0.027092, -0.0051265, -0.17882, 0.012717, 0.014254, 0.10921, 0.12698, -0.041269, 0.08552, 0.043847, 0.024665, 0.12247, 0.1344, 0.0562, -0.070487, 0.050115, -0.00030554, -0.0023067, 0.054046, -0.05889, 0.056482, -0.074701, 0.054307, -0.0024485, -0.12796],
[-0.0087719, -0.087903, -0.055052, -0.053895, -0.021765, -0.032496, -0.053937, -0.059602, 0.018682, -0.024042, 0.1808, 0.013387, -0.01946, 0.085841, -0.04296, 0.05614, -0.0074823, 0.072638, -0.045773, -0.0079074, -0.039618, 0.062009, 0.069674, -0.0017891, -0.017923, -0.017329, 0.10429, -0.075337, -0.019898, 0.066497, -0.04193, -0.017542, -0.049375, 0.047055, -0.11658, -0.050368, -0.087745, 0.10297, 0.0010435, -0.1119, -0.058552, -0.093602, -0.058917, 0.12428, 0.20422, -0.086927, -0.15846, -0.044231, 0.14028, 0.20301, 0.20997, 0.078368, 0.023616, 0.046474, -0.10919, 0.34228, 0.40922, 0.32978, 0.35276, 0.17348, 0.049654, 0.046853, 0.1854, 0.23487, 0.074066, 0.090895, -0.35637, -0.1789, 0.067024, -0.14509, -0.24145, -0.31352, -0.20854, -0.16942, -0.05073, 0.070839, 0.11262, -0.055654, -0.18253, -0.095111, -0.20811, -0.085216, -0.037808, 0.20963, -0.087519, -0.0083271, -0.18306, 0.012319, -0.16489, 0.074234, -0.11014, 0.00018777, 0.0033474, 0.10044, -0.2401, -0.055214, -0.098806, -0.014982, -0.12541, -0.035863, 0.046214, -0.11768, 0.075697, 0.25102, -0.15062, 0.10274, -0.14457, -0.0084316, 0.073822, 0.034203, 0.12998, 0.064947, 0.10038, -0.042683, 0.034386, 0.133, 0.084681, 0.1675, -0.14489, 0.097226, -0.17222],
[-0.032221, 0.0081917, -0.080282, -0.081381, -0.063842, -0.015615, 0.10709, 0.080651, 0.054345, 0.027074, 0.16813, 0.13415, 0.038631, -0.0055507, 0.042335, -0.028374, 0.0039599, -0.063597, 0.056588, -0.027555, -0.0017875, 0.0041026, 0.092719, 0.0086585, 0.10684, -0.074196, -0.063057, -0.021523, 0.0092341, -0.1461, 0.014751, -0.0052165, 0.0032642, 0.097807, 0.12927, 0.062698, 0.27475, 0.092446, -0.12769, -0.14806, -0.019825, -0.0086315, 0.014481, -0.0089874, 0.10471, -0.11054, 0.0075036, 0.060006, 0.3171, 0.32324, 0.1072, -0.058102, -0.031761, -0.11429, -0.031551, 0.0017247, -0.032141, -0.013131, -0.14824, -0.10766, 0.10594, 0.40021, 0.19725, 0.083748, -0.030751, -0.02833, -0.099874, -0.26039, -0.025979, -0.074314, -0.14254, -0.27784, -0.10552, -0.011203, 0.12856, -0.00039207, 0.071697, -0.060715, 0.079555, -0.04445, -0.036239, -0.05495, -0.075878, -0.13219, -0.11464, -0.014322, 0.054633, -0.0021866, 0.047599, 0.071591, -0.061807, -0.098703, -0.17721, -0.050445, -0.088158, 0.17306, -0.18012, -0.1379, 0.069655, 0.1066, 0.042995, 0.13247, 0.10692, 0.063925, 0.084949, -0.14825, -0.17982, 0.079887, 0.0099879, 0.091659, 0.0039476, -0.022988, -0.025004, 0.022313, 0.032106, 0.0060978, -0.0091098, 0.13842, 0.057218, 0.034249, 0.14166],
[0.077403, 0.0027903, 0.085849, 0.081622, 0.044687, -0.010721, 0.00076693, 0.10466, -0.015222, 0.00096215, 0.1025, 0.10103, -0.02864, -0.050144, 0.08803, -0.039184, 0.027942, -0.10922, -0.091551, 0.038578, -0.047089, 0.0082249, -0.016698, 0.14191, 0.023165, 0.072603, 0.11867, 0.014093, 0.0047639, -0.012687, -0.03666, -0.077417, 0.049268, -0.044394, -0.17872, 0.028784, -0.010362, 0.15181, 0.2186, 0.1163, -0.09258, -0.019701, -0.045861, 0.029997, 0.022719, 0.025102, -0.085651, -0.12411, -0.18246, 0.091966, 0.087081, 0.10736, 0.02811, 0.11508, 0.038288, -0.074858, 0.00036462, -0.075728, -0.25812, -0.60692, -0.57736, -0.12302, 0.10818, 0.016913, 0.13529, 0.090044, -0.017374, 0.016143, 0.0074706, 0.038153, 0.13808, 0.23128, 0.062212, -0.00078106, -0.0088352, 0.015948, -0.00050225, 0.11232, 0.010962, -0.063962, 0.042698, 0.075698, 0.18797, -0.034271, -0.07601, 0.040711, 0.0039277, -0.0081139, -0.015998, -0.060356, 0.025952, 0.042163, 0.082426, 0.1426, -0.042849, -0.063341, 0.0092863, 0.029864, 0.0060824, 0.059612, 0.030082, -0.027239, -0.0073659, -0.015225, 0.044419, -0.0053691, 0.022425, -0.0082636, -0.040837, -0.015422, 0.061348, -0.052846, 0.094366, 0.014526, 0.0037072, 0.044123, 0.045795, -0.030931, 0.017194, -0.019463, 0.0012436],
[0.084114, -0.025621, -0.023222, 0.053008, 0.17224, 0.012469, 0.075122, 0.040763, 0.098101, 0.041479, 0.12636, 0.070298, -0.050007, -0.0054841, 0.030405, -0.089755, -0.21541, 0.01723, -0.13557, 0.095618, -0.1106, 0.10125, -0.076498, -0.00028541, -0.026246, -0.01948, -0.39778, -0.062144, -0.024341, -0.012827, -0.014662, -0.11255, 0.16096, -0.11228, -0.068533, -0.16356, -0.19654, 0.031038, 0.13193, -0.083423, -0.040716, 0.01381, 0.039666, 0.0099888, -0.047953, 0.00061003, 0.10343, 0.24891, 0.35782, -0.20933, -0.039926, 0.1942, 0.032188, -0.040504, -0.0032348, 0.17053, 0.35048, 0.24646, -0.12389, 0.01723, -0.20275, 0.13927, -0.014868, -0.11606, 0.050407, 0.052285, 0.21799, -0.056957, -0.20647, -0.045779, -0.17472, 0.05274, 0.099134, 0.094364, -0.060202, -0.043716, 0.05637, -0.008589, -0.096057, 0.019767, 0.0089128, -0.043515, 0.071434, 0.036366, 0.013984, 0.073848, 0.06407, -0.12431, -0.077473, -0.003077, 0.012412, -0.077233, 0.052213, 0.098481, -0.044983, 0.0093175, -0.014436, -0.018575, -0.016642, -0.20214, 0.023, -0.056258, -0.017621, 0.01913, 0.020008, 0.034833, -0.066635, 0.019123, 0.10428, 0.026511, 0.16287, 0.027933, 0.049607, 0.050049, 0.10194, -0.02588, 0.058534, -0.061181, 0.17253, -0.1346, -0.090408],
[-0.027551, 0.20557, 0.082132, -0.04257, 0.015868, 0.0093698, -0.11463, 0.044712, -0.15996, 0.11866, 0.067392, -0.13863, -0.24992, -0.12742, -0.048942, -0.10909, -0.015852, 0.030011, -0.15749, -0.053421, -0.025663, -0.011093, 0.058389, 0.088245, -0.053728, -0.068366, 0.0026508, 0.097818, 0.016896, 0.0291, 0.15597, -0.017163, -0.047858, -0.066641, -0.04105, -0.029342, 0.18068, 0.23841, 0.1072, 0.0032504, -0.16876, -0.055652, 0.037864, 0.14497, 0.30165, 0.21781, 0.24781, 0.20611, -0.030505, -0.22355, -0.22058, 0.026161, -0.01449, -0.0013993, -0.032143, 0.069858, 0.12952, 0.062134, -0.09585, -0.15006, -0.04869, 0.027626, 0.087752, 0.059382, -0.15548, -0.008993, -0.21696, -0.20895, -0.17492, -0.10306, -0.08326, 0.10865, 0.060745, 0.050196, 0.059347, 0.08055, 0.096041, -0.17922, -0.08636, -0.19862, -0.085306, 0.073404, -0.00060916, 0.017865, 0.01523, -0.028739, -0.030631, 0.083547, -0.015199, 0.0079197, 0.10542, 0.04588, -0.016177, -0.064404, 0.05645, -0.0011676, 0.0019962, 0.067417, -0.0068873, 0.034856, 0.017611, -0.064975, 0.072135, -0.038534, -0.01402, 0.0002936, 0.12282, -0.084526, 0.072734, -0.026199, 0.26228, 0.056467, 0.026818, 0.093992, 0.035828, 0.18171, -0.015152, -0.017616, -0.0031862, -0.021179, -0.15214],
[-0.13775, 0.038746, -0.00070857, 0.049355, -0.088279, 0.3385, -0.064155, 0.013423, -0.019629, -0.074514, -0.090356, 0.096941, -0.11911, -0.15101, -0.013947, -0.28748, -0.37904, -0.20281, -0.11304, 0.025054, -0.081019, 0.092552, 0.00082246, 0.24246, 0.12844, 0.13562, 0.089595, 0.23077, 0.17282, 0.1512, 0.2108, 0.13274, -0.11297, -0.23426, -0.15389, 0.04755, 0.13676, 0.14971, -0.014599, 0.024524, 0.15008, 0.02197, -0.017209, -0.12567, 0.057462, -0.12423, 0.027718, 0.07647, 0.15084, 0.16363, 0.10314, 0.098604, -0.077889, -0.1661, -0.015524, 0.033968, -0.0064288, -0.077784, -0.13139, -0.16493, -0.13708, -0.24997, -0.099387, -0.041816, 0.063393, 0.084657, 0.073596, 0.0096743, -0.056184, -0.097826, -0.20167, -0.035743, -0.053854, -0.094089, -0.11121, -0.037672, 0.031541, 0.092726, -0.024057, 0.0060108, 0.026069, 0.052952, -0.00074539, -0.039415, 0.00012582, -0.074806, 0.010524, 0.062406, 0.015814, -0.064838, 0.031266, 0.027508, 0.000127, 0.050797, 0.07897, 0.098318, 0.054193, -0.013031, 0.049683, 0.083509, 0.011784, 0.091872, -0.0066227, -0.047956, -0.01709, -0.078741, -0.046731, 0.018514, 0.0715, 0.064737, -0.032651, 0.061364, -0.039888, 0.06941, 0.077977, 0.066134, 0.055982, 0.072595, -0.053845, 0.096086, -0.028806],
[0.044235, 0.034525, -0.13043, -0.035392, 0.017969, 0.035178, -0.010788, -0.0016502, 0.03915, 0.21473, -0.0948, -0.028715, 0.05486, -0.039324, -0.071941, -0.11931, 0.0078118, -0.13497, -0.22468, -0.041964, -0.1884, -0.12848, 0.032762, -0.0022056, 0.10278, 0.0012177, 0.077763, 0.014833, 0.25493, -0.14123, -0.028129, -0.090593, 0.078746, -0.013335, -0.013098, -0.085997, 0.0011501, -0.096292, 0.16218, -0.026281, 0.40592, 0.22426, 0.088915, 0.087381, 0.043236, 0.10435, -0.029683, -0.096107, -0.16573, -0.17367, -0.030961, 0.059506, 0.049326, 0.12757, 0.2398, 0.124, -0.27712, 0.1032, 0.071367, 0.066139, -0.017571, -0.21849, -0.096326, -0.013237, 0.141, 0.048656, 0.030847, 0.12063, 0.03194, 0.012664, 0.053035, 0.023359, 0.073601, -0.10515, -0.16524, -0.25669, -0.26897, 0.018566, 0.09359, 0.028128, 0.018697, -0.015875, -0.0079379, 0.03061, -0.015794, -0.095236, -0.029087, -0.13652, -0.073683, 0.054902, -0.060991, 0.09317, -0.0023871, -0.026191, -0.047989, 0.019892, 0.053632, 0.021996, -0.058485, -0.0082972, 0.085923, 0.007835, 0.0074973, 0.033528, 0.034259, 0.040069, 0.016642, 0.033377, 0.009459, 0.052065, -0.084929, -0.091861, -0.072335, 0.017511, 0.083823, 0.029829, 0.022676, 0.092824, 0.027105, 0.049933, 0.25204],
[0.045017, 0.049864, 0.082321, 0.11789, 0.11184, -0.12533, 0.073011, 0.077004, -0.037179, 0.1153, 0.0573, 0.097849, -0.030605, -0.0069899, -0.043815, -0.041086, -0.10157, -0.030984, 0.062242, -0.08566, -0.031199, 0.094664, 0.18696, -0.16613, -0.0090085, -0.12607, 0.061744, -0.10059, -0.32554, -0.093973, -0.0841, -0.19413, -0.073753, 0.093207, 0.053699, -0.03051, 0.035499, -0.088218, 0.14082, -0.015418, -0.14008, -0.021416, 0.073018, -0.17727, 0.049671, 0.034513, 0.10331, -0.039224, 0.032001, -0.3171, 0.36395, 0.15239, 0.12007, 0.012633, 0.13528, -0.043263, -0.041986, 0.069839, 0.0010106, -0.0011775, -0.011795, -0.14349, 0.022137, -0.039688, 0.26218, 0.19437, 0.11018, 0.022791, -0.097375, -0.016626, 0.15981, 0.079561, -0.075452, -0.028024, -0.12778, -0.070601, 0.075855, -0.061104, -0.034255, 0.047001, 0.085957, 0.042827, 0.035824, -0.0061232, -0.038509, 0.052491, -0.012429, 0.027802, -0.045634, 0.05733, -0.074158, 0.001283, 0.047032, 0.024833, 0.037205, -0.028766, 0.04836, -0.05327, -0.12254, 0.03712, -0.089284, 0.064955, 0.077539, -0.027112, 0.095663, -0.024484, -0.036212, -0.093916, -0.01732, -0.10222, -0.088399, 0.018021, 0.014346, -0.0045931, -0.041331, 0.037071, 0.032109, 0.13273, 0.07511, 0.025628, 0.14213],
[0.15729, -0.052979, -0.0026258, 0.078995, 0.082044, -0.13536, -0.013649, -0.013141, 0.011513, 0.051596, 0.02555, -0.039487, -0.034658, 0.072491, -0.11567, 0.067864, 0.068651, 0.073986, -0.16154, 0.040446, 0.071466, -0.11469, 0.054051, -0.041043, 0.14997, -0.25422, 0.19697, 0.11291, -0.020531, 0.1289, -0.10368, 0.096092, 0.15325, 0.05149, 0.03356, -0.2083, 0.022894, -0.2625, 0.019209, 0.23588, 0.012602, 0.20972, 0.092569, 0.10591, 0.074214, 0.028278, -0.034766, 0.025387, -0.21115, -0.18143, -0.036903, 0.074542, -0.073943, -0.12923, -0.10287, -0.0020479, 0.0070328, 0.041659, -0.030914, 0.20126, -0.36149, -0.59189, -0.34765, -0.29918, -0.043195, -0.30777, -0.054571, 0.035677, 0.033779, -0.11152, 0.11791, 0.50742, 0.23856, 0.10489, 0.074815, -0.010758, 0.098422, 0.068012, 0.040081, -0.17816, 0.015218, -0.043045, 0.069479, 0.26248, 0.13062, 0.15898, 0.098913, 0.16691, -0.045456, -0.051218, 0.088652, -0.024238, -0.12061, -0.13933, -0.098448, 0.084104, 0.036095, 0.064677, 0.019557, 0.054585, 0.011804, 0.049628, 0.03158, -0.042128, -0.037247, -0.00090228, 0.051276, 0.017591, 0.020608, 0.12021, 0.039022, 0.021712, 0.047172, 0.11458, 0.065529, 0.057133, -0.064146, -0.079154, -0.084204, -0.13318, -0.097193],
[0.016239, 0.0039663, -0.0045547, 0.013554, 0.042874, -0.15275, -0.027275, 0.0096628, 0.00030503, 0.032218, -0.036021, -0.042601, -0.041216, 0.070225, 0.088251, -0.11944, 0.016009, -0.025892, 0.043719, 0.04635, -0.04552, 0.057802, 0.032998, -0.074789, 0.085613, -0.082967, 0.12226, 0.056996, 0.22311, -0.12892, 0.028712, -0.082295, 0.074671, 0.024026, 0.070656, 0.052863, 0.13163, 0.08385, 0.019373, 0.068601, 0.16045, 0.14512, 0.090972, -0.11721, -0.1096, -0.2299, -0.040375, -0.2017, 0.21032, 0.028437, 0.064869, -0.18349, -0.17888, -0.24993, -0.12182, -0.032695, -0.0037869, -0.24886, -0.15602, -0.42476, -0.4236, -0.3608, -0.18904, -0.056628, 0.0019947, 0.0099847, 0.10753, 0.21965, 0.18511, 0.1994, 0.23706, 0.15855, 0.23756, 0.24027, 0.14806, 0.22744, 0.12507, -0.12208, 0.041225, 0.12974, 0.13877, 0.092819, 0.041457, 0.12811, 0.086282, 0.046482, 0.035985, -0.15, -0.061995, -0.12775, -0.055469, -0.072056, -0.0312, -0.021698, -0.02032, -0.011808, -0.10717, -0.082342, -0.019256, 0.066679, -0.041537, -0.040688, 0.044725, -0.068305, 0.035585, 0.026946, -0.011423, 0.061366, -0.049741, 0.054485, 0.14247, 0.03771, 0.014815, -0.12197, -0.040853, -0.0048073, -0.093844, -0.11067, -0.013085, 0.020004, 0.11572],
[0.02862, 0.054226, 0.017679, -0.054622, 0.00068166, -0.061011, 0.02545, 0.039249, -0.017614, 0.086689, 0.12902, -0.059156, -0.033658, -0.11303, -0.0094407, 0.0383, -0.024382, 0.13095, -0.17637, -0.042536, 0.024839, 0.025341, 0.073379, 0.1249, 0.052335, 0.019594, 0.01441, 0.069392, 0.10115, -0.017834, -0.0052539, -0.04945, -0.018515, 0.027327, 0.097636, 0.13398, 0.028129, 0.10346, 0.1456, -0.062226, -0.043205, -0.13615, 0.0094596, 0.077643, -0.018838, 0.040125, 0.046083, 0.11596, 0.041671, -0.035255, -0.2421, 0.13413, -0.12174, -0.002494, 0.019159, -0.28596, -0.064486, -0.31594, -0.32104, -0.52704, -0.52371, -0.22197, 0.078178, 0.037153, 0.079429, 0.054711, -0.030973, -0.17109, 0.096072, 0.023265, 0.1823, 0.50842, 0.36327, -0.17443, -0.075941, 0.084583, -0.082641, 0.24079, 0.12328, 3.0311e-05, 0.20734, 0.13349, 0.14204, -0.016683, 0.0026274, -0.0506, -0.093502, 0.049347, 0.02717, 0.0088067, 0.29974, -0.017371, 0.060473, -0.083275, -0.048734, -0.12259, 0.074538, 0.0016868, -0.046678, 0.10226, 0.096413, -0.085168, 0.011075, -0.058526, -0.032743, -0.17221, 0.10626, 0.045123, 0.063157, -0.023657, -0.086189, -0.097156, -0.11779, -0.0018161, -0.018375, -0.022155, 0.069073, 0.061843, 0.057417, 0.030372, 0.089788],
[-0.0016376, -0.015234, 0.033084, 0.01043, 0.026387, -0.055493, -0.089868, 0.031318, -0.060212, 0.060345, 0.033638, 0.074908, 0.067344, 0.045409, -0.016588, 0.11809, 0.10675, 0.014357, -0.00029905, 0.03249, -0.079691, 0.0021152, 0.12843, 0.027686, 0.051037, 0.0095028, -0.088577, 0.072415, 0.18759, -0.04626, 0.032834, 0.00027334, -0.0056259, 0.051335, -0.028998, 0.010804, 0.039279, 0.059935, -0.036673, 0.0020456, 0.084205, 0.078722, 0.072928, 0.0029102, -0.014711, 0.061979, -0.0058614, -0.0065096, 0.15462, 0.10999, 0.05512, 0.057246, 0.084674, 0.045416, -0.027011, -0.41691, -0.23816, -0.26803, -0.42974, -0.47129, -0.47538, -0.23333, -0.028661, -0.046786, -0.013911, 0.063557, 0.20817, 0.1268, 0.19585, 0.24121, 0.34248, 0.22, 0.036994, -0.24941, -0.12912, 0.0067608, -0.01638, 0.023976, 0.17281, 0.067747, 0.099348, 0.035398, -0.034632, 0.11009, 0.0053132, -0.18523, -0.015871, 0.008623, 0.038924, -0.014894, -0.015236, 0.0015905, -0.025942, -0.048033, 0.056968, -0.005355, 0.070041, -0.019904, 0.10013, -0.030663, 0.014936, -0.053377, -0.046191, -0.049737, -0.032035, -0.026289, -0.0073802, -0.0085777, -0.067451, 0.036965, 0.012119, -0.012732, -0.014068, 0.011209, -0.0034198, 0.12162, -0.090967, 0.062061, -0.023761, 0.11195, 0.10944],
[-0.061429, -0.024855, 0.037534, 0.053055, -0.02909, -0.076608, -0.05625, 0.038513, 0.0094111, 0.027628, -0.040484, 0.062572, 0.018534, 0.099954, -0.011584, -0.027052, -0.0059961, -0.021254, -0.031552, 0.13842, 0.0044655, 0.079159, 0.093307, 0.021057, -0.020072, 0.0078349, 0.10646, 0.11394, 0.095624, -0.00037973, -0.010567, -0.021229, 0.11951, 0.15659, 0.051157, -0.061499, 0.080078, -0.060313, 0.10862, 0.090833, 0.03775, 0.12669, 0.019289, 0.11166, -0.11612, -0.038271, -0.013962, 0.057456, 0.035911, 0.11685, 0.020811, 0.042275, -0.11787, -0.20632, -0.1034, -0.032371, -0.14327, -0.25192, -0.43351, -0.32253, -0.3976, -0.39288, -0.39114, -0.2467, -0.087921, -0.088613, -0.15981, 0.18786, 0.19151, 0.46364, 0.15919, 0.19353, 0.23198, 0.41944, 0.29117, 0.13265, -0.041281, 0.024461, -0.058649, -0.048431, 0.074459, 0.038048, -0.04011, 0.05987, 0.052512, -0.0090562, 0.023537, -0.068198, -0.058682, -0.031438, 0.05729, 0.096319, -0.010632, -0.072423, 0.026755, 0.018666, -0.035083, 0.0033659, -0.026, 0.051531, -0.095878, -0.072904, -0.067948, 0.0043261, -0.0040118, -0.0054864, -0.0070406, -0.023664, -0.021349, -0.055765, 0.076203, 0.057795, 0.0049914, -0.014554, -0.029744, -0.057165, -0.0010086, -0.035362, -0.0047531, -0.011301, 0.11501],
[0.15174, -0.014179, 0.016877, -0.077205, 0.078108, -0.13113, 0.0027535, 0.051911, 0.028948, 0.050209, -0.0045795, -0.10685, 0.011155, 0.065186, -0.13027, -0.080144, 0.10736, 0.04888, 0.015759, 0.12191, 0.096985, -0.0080833, 0.020705, -0.081938, 0.0046465, 0.056148, 0.16628, 0.046183, 0.077658, -0.019961, -0.096538, 0.079466, 0.25805, 0.0077622, 0.06952, 0.0095238, 0.26152, 0.086788, -0.037402, 0.069486, 0.071695, 0.13258, -0.021458, 0.056046, -0.00039375, 0.032222, 0.18458, -0.04254, -0.012964, 0.1701, -0.023562, 0.051153, -0.13166, 0.020665, -0.24023, 0.038647, -0.025858, -0.081456, -0.11687, 0.044401, -0.35731, -0.6458, -0.40588, -0.30571, -0.12682, -0.33498, 0.015693, -0.078712, -0.043104, -0.15482, -0.23546, 0.11117, 0.45545, 0.18491, 0.29247, 0.19673, 0.19711, 0.073292, 0.0082412, -0.11507, -0.0097699, -0.10086, 0.06842, -0.054338, 0.077438, 0.17116, 0.001288, 0.13426, 0.1106, -0.073247, 0.037258, -0.012267, 0.073659, 0.043783, -0.10715, 0.086654, -0.068763, -0.058722, 0.044547, -0.055318, 0.033045, 0.057546, 0.0013722, 0.024826, -0.12204, -0.1019, 0.054773, -0.079578, -0.038229, 0.036495, 0.13217, 0.057211, -0.025832, -0.054716, 0.013914, 0.12333, 0.0048703, 0.0051744, 0.02839, -0.021508, -0.034672],
[-0.0056384, -0.034135, -0.022985, -0.060425, 0.054919, 0.068881, -0.0070135, -0.0064886, -0.074997, -0.0025759, 0.023015, 0.0083653, -0.031176, 0.042573, -0.066109, 0.029356, -0.013292, 0.056362, 0.034219, -0.012595, -0.014012, -0.062381, -0.07114, 0.0024196, -0.035945, 0.045638, -0.0047184, 0.066745, 0.0453, -0.044479, 0.089641, -0.096496, -0.027741, -0.0057168, 0.015013, -0.024603, 0.0013274, -0.035627, 0.017129, -0.045973, 0.0070037, -0.043147, -0.029564, -0.020695, -0.079785, 0.026834, -0.0019309, 0.083258, 0.10733, 0.074877, 0.048498, 0.091698, 0.048185, 0.052096, 0.0076798, 0.10519, 0.02253, 0.12672, 0.059197, 0.073166, 0.11595, 0.056154, 0.12933, 0.088424, 0.030087, 0.069156, 0.12092, -0.089932, -0.019015, -0.044735, 0.11876, 0.0019622, 0.098963, -0.014936, -0.058157, -0.030281, 0.039004, -0.084991, -0.046013, -0.014914, 0.021156, 0.064216, -0.02398, 0.028088, -0.015711, 0.055355, -0.10472, -0.089683, -0.28534, -0.18319, -0.080774, 0.0051665, 0.057863, 0.064364, 0.089305, 0.033738, -0.12463, -0.15877, -0.35595, 0.095129, -0.14725, -0.20316, -0.084143, -0.2132, -0.18019, -0.21194, -0.10023, -0.021533, -0.037309, 0.12624, 0.22035, 0.1891, 0.15893, 0.012004, 0.054019, -0.028528, 0.0032336, -0.0066272, 0.084693, 0.11629, 0.19103],
[-0.08632, -0.042516, -0.0087762, 0.021241, 0.0047851, -0.035472, 0.0066937, -0.00018714, 0.0082764, 0.03874, -0.068078, -0.050242, 0.0053628, -0.046723, 0.094159, 0.025987, 0.028403, 0.12799, 0.052174, 0.031742, 0.043517, 0.1003, 0.009888, -0.035094, -0.0070136, 0.069061, 0.096711, 0.081381, 0.057645, 0.011067, -0.018381, -0.082602, -0.052684, -0.01996, 0.019919, 0.074764, 0.0037734, -0.0014401, -0.10891, -0.057902, 0.062403, 0.10607, 0.093356, 0.16322, -0.044312, -0.0066519, 0.024113, 0.064553, 0.15171, 0.30458, 0.087042, -0.13006, -0.11938, 0.02659, -0.061874, 0.099973, 0.06382, 0.11767, 0.10413, -0.064651, -0.64839, -0.57719, -0.036256, 0.17484, -0.082879, -0.052896, 0.093451, 0.13223, -0.0031159, -0.20504, -0.56713, -0.17042, 0.51278, 0.080572, -0.069035, -0.076494, -0.0087908, 0.063359, -0.019296, -0.26311, -0.26432, 0.00439, 0.41748, 0.23966, -0.073562, -0.09551, -0.23475, 0.028298, 0.061075, -0.16177, -0.0028367, 0.094222, 0.12827, 0.14707, 0.071302, -0.074737, -0.23885, -0.085022, -0.07147, 0.0091791, -0.00092606, 0.084224, 0.07315, -0.027624, -0.10044, -0.0028873, 0.084866, 0.01031, -0.00054869, 0.084218, 0.005403, 0.095305, 0.021416, 0.032093, 0.095158, -0.064421, 0.028975, -0.0069886, 0.15811, 0.077388, 0.22282],
[0.076468, 0.094525, 0.013417, -0.065411, 0.0022049, -0.19543, -0.010363, 0.0006824, -0.025036, 0.1071, 0.17509, 0.14614, 0.053718, 0.033399, 0.058514, 0.10089, 0.12393, 0.00030037, -0.072506, -0.053549, -0.068975, 0.068143, -0.0032047, -0.023764, -0.033057, -0.046769, -0.12086, 0.13198, 0.010909, 0.11806, 0.00055654, -0.0058049, 0.035993, -0.0082657, 0.068351, 0.0301, 0.113, 0.049423, -0.18769, -0.089816, 0.12209, 0.065398, -0.23088, 0.013401, -0.096887, 0.096593, 0.089715, -0.0038843, 0.12013, 0.37404, 0.21211, -0.011527, -0.049284, 0.018755, -0.082645, 0.10818, -0.058116, -0.049761, 0.038468, -0.27345, -0.84643, -0.29645, 0.088276, 0.11387, -0.043246, 0.0080367, -0.10745, -0.31047, -0.044148, -0.17805, 0.27176, 0.52375, -0.34603, -0.25553, 0.041699, 0.17631, 0.089, -0.034972, 0.015214, -0.16155, -0.0044616, -0.19608, 0.52391, 0.38353, -0.18308, -0.36866, -0.0516, 0.18508, -0.03906, -0.11294, -0.29448, -0.24258, -0.020336, 0.1646, 0.042029, -0.034579, -0.080621, 0.0023781, 0.09709, 0.25587, -0.25284, 0.061611, 0.09607, -0.053049, -0.016158, -0.051428, 0.15564, 0.18886, 0.0084349, -0.048989, 0.17712, 0.19164, 0.18133, 0.13612, 0.1653, -0.029342, -0.042788, -0.053546, 0.043048, 0.00043498, 0.043392],
[-0.067392, 0.15604, 0.33006, 0.17019, -0.0097699, -0.11247, -0.09464, -0.024494, -0.0039792, 0.10994, 0.034233, 0.17574, -0.058308, -0.086036, -0.089378, 0.13061, 0.083343, 0.045589, -0.0215, -0.039618, -0.040283, -0.054908, -0.029621, 0.033422, -0.18107, 0.062628, -0.15452, 0.16302, -0.19246, 0.025899, 0.13802, 0.042581, -0.10232, -0.047879, -0.084652, -0.10421, -0.11475, -0.077448, 0.17513, 0.31631, -0.21234, -0.13718, 0.032256, 0.16117, 0.12437, -0.19602, -0.10317, -0.17989, -0.030777, 0.36723, 0.26823, -0.14256, -0.34284, -0.16863, 0.20718, -0.04361, -0.21591, -0.35645, -0.35914, -0.35654, -0.22838, -0.25415, -0.027038, 0.1043, 0.070313, 0.19633, 0.011469, 0.056101, 0.20979, 0.31383, 0.36266, 0.15633, 0.043118, 0.15942, 0.138, 0.082457, -0.097363, 0.017536, 0.18875, 0.1323, 0.09316, 0.10016, 0.041772, -0.16461, -0.01027, -0.016122, -0.10278, -0.093043, -0.049187, 0.011398, -0.00027008, 0.0074397, -0.20028, -0.11833, 0.015078, -0.018453, -0.036365, -0.020538, 0.067467, 0.098981, -0.0055674, -0.092027, -0.011441, 0.040493, 0.072107, 0.047545, -0.010628, 0.010379, -0.037361, 0.049441, 0.23173, 0.066224, 0.053604, 0.070224, 0.00044744, -0.024041, 0.017027, 0.082502, 0.044118, 0.094446, 0.02607],
[-0.014874, 0.0064653, 0.18058, 0.1064, 0.14624, -0.18549, -0.11947, 0.13337, 0.14316, 0.21268, 0.074573, -0.023663, 0.00030163, 0.034924, 0.00049764, -0.27861, 0.019649, 0.22429, 0.10635, -0.055747, -0.17203, 0.14652, 0.083678, 0.08006, 0.12677, -0.2096, -0.11993, 0.079651, -7.05e-05, -0.1316, -0.12186, -0.12212, -0.063472, 0.11592, -0.00031212, -0.16159, -0.2051, -0.015211, 0.33419, -0.021198, 0.051574, -0.081191, -0.024248, 0.031953, 0.08989, -0.055348, -0.19027, -0.20571, -0.00342, 0.42337, 0.27261, -0.084998, -0.27009, -0.26985, -0.17357, 0.049621, -0.003575, 0.036593, 0.0086359, -0.27033, -0.39995, -0.17184, -0.24084, -0.20002, -0.25264, 0.04389, -0.06426, 0.074044, -0.01414, 0.12916, 0.13074, 0.027929, 0.018943, 0.12691, 0.28765, 0.28887, 0.29998, -0.037028, 0.049534, -0.018197, 0.19754, -0.0048382, -0.067002, 0.095329, -0.077329, 0.097922, 0.11727, 0.051206, 0.014744, 0.074516, 0.076595, -0.10213, -0.010104, 0.053405, 0.025968, 0.042843, -0.03165, -0.10112, -0.062004, 0.080997, -0.096227, 0.0027223, 0.0032193, 0.028018, -0.080393, -0.068244, -0.0065763, -0.10139, 0.005777, -0.0019333, -0.028478, 0.078148, 0.0046718, 0.086526, 0.07515, 0.080912, 0.14299, 0.058255, 0.060032, 0.069309, 0.13734],
[-0.026403, -0.020918, -0.035102, -0.014307, -0.0042972, -0.058078, 0.038179, -0.0028112, -0.0038941, 0.0018813, -0.10079, 0.021583, 0.073512, 0.054528, 0.18988, 0.13986, 0.072941, 0.059257, 0.031091, -0.015845, -0.023618, -0.064937, 0.075643, -0.079466, -0.020769, -0.10404, -0.033013, 0.072788, 0.10548, 0.0019405, -0.0070426, -0.028399, 0.045186, -0.019186, 0.10715, 0.11823, 0.038571, -0.027458, -0.098265, 0.056391, 0.040157, 0.12887, -0.031556, -0.02314, 0.069122, 0.025102, 0.029789, -0.070653, 0.016315, 0.28689, 0.17026, 0.012541, 0.070851, 0.0048605, 0.033198, -0.091329, -0.15097, -0.024121, -0.02457, -0.41481, -0.77687, -0.27461, 0.13786, 0.13545, 0.13314, 0.082653, 0.089238, -0.044081, -0.076883, 0.126, 0.40959, 0.087069, -0.46621, -0.43761, -0.10812, 0.017686, 0.1273, -0.064747, -0.10763, -0.085248, -0.2315, 0.15315, 0.5562, 0.23775, -0.16669, -0.17716, -0.16977, 0.025009, 0.060378, -0.20713, -0.18646, -0.080662, -0.0061085, 0.13479, 0.056632, 0.17463, 0.017491, -0.015088, -0.051792, 0.086679, -0.043885, 0.048343, -0.11503, 0.1406, -0.062258, -0.11335, -0.064954, 0.027741, 0.11898, 0.030261, 0.17154, 0.057333, 0.16205, 0.098609, 0.073912, -0.090816, -0.010371, 0.092276, 0.1103, -0.0058808, 0.03315],
[0.2655, -0.0011966, -0.022917, 0.04243, -0.13812, -0.037431, -0.04056, -0.023934, 0.079259, -0.034522, 0.1745, 0.041791, -0.022741, -0.001354, -0.10139, -0.053306, 0.058909, 0.093373, 0.05014, 0.0084539, 0.021167, 0.10388, 0.0076348, 0.013139, -0.075217, 0.015069, 0.24056, 0.064464, -0.061521, -0.084694, -0.068058, -0.010292, -0.035799, -0.047138, -0.030265, 0.025114, 0.16953, -0.081754, -0.16484, -0.090216, 0.19964, 0.18826, 0.045615, 0.10861, -0.028329, -0.10352, 0.075322, -0.034013, -0.058696, 0.44091, 0.084019, -0.01285, -0.042461, 0.13376, -0.12951, 0.0026411, 0.044978, -0.090312, 0.055734, 0.060061, -0.71528, -0.28235, 0.031272, 0.11881, -0.0042768, -0.011348, 0.0023675, 0.00043486, 0.18959, -0.08576, -0.45258, 0.15962, 0.31737, -0.062412, -0.33746, -0.24412, -0.061413, 0.13079, 0.20848, -0.20955, -0.28813, 0.14444, 0.46815, 0.085139, -0.22659, -0.027717, -0.16856, -0.13754, 0.1506, 0.00078477, -0.17891, -0.067289, 0.11814, 0.1094, 0.10648, -0.07785, -0.24214, -0.15597, 0.018452, -0.0653, 0.042694, 0.11064, 0.1346, 0.030738, -0.01497, 0.039307, 0.041005, -0.028334, 0.015742, 0.11427, 0.021003, 0.0077222, -0.00084806, 0.056397, -0.1125, -0.064031, 0.026888, 0.12622, 0.25062, 0.11068, 0.26257],
[0.072041, -0.022942, 0.20655, 0.0021518, -0.14297, 0.00060653, -0.058092, 0.13818, 0.17792, 0.12334, 0.0044529, -0.04606, -0.071586, -0.10074, -0.07374, -0.018046, -0.11863, 0.17618, 0.14978, -0.060747, -0.0027956, 0.16786, -0.10698, 0.083, 0.12903, 0.047203, -0.030334, 0.099121, -0.051747, -0.20798, -0.0060523, -0.2464, 0.002543, 0.056676, 0.13754, -0.079126, -0.17639, 0.055182, 0.29993, -0.12375, -0.15473, -0.015286, -0.0054135, -0.08584, 0.22138, -0.1313, -0.33147, -0.21124, 0.24712, 0.46372, 0.0027062, -0.24161, -0.10142, -0.18323, 0.11158, 0.1676, 0.029994, 0.025682, -0.11959, -0.33142, -0.15445, -0.16382, -0.18307, -0.40205, -0.26594, -0.15682, -0.0002612, -0.028756, 0.27425, 0.21593, 0.25487, 0.097667, 0.20034, 0.19879, 0.30686, 0.17247, 0.018739, -0.031064, 0.026366, -0.18777, -0.15481, -0.037429, -0.11875, 0.10726, 0.17942, 0.11733, 0.0052779, 0.23972, 0.0079701, -0.051503, 0.05532, -0.040008, -0.092708, -0.031471, -0.098759, -0.09293, 0.055518, -0.037796, -0.0063426, 0.024883, 0.034983, 0.071931, -0.031592, -0.08635, -0.0090017, 0.071457, -0.060722, -0.14319, -0.048321, 0.081485, -0.028272, 0.063684, 0.005548, 0.11811, 0.14065, 0.00406, -0.013719, 0.12724, 0.099627, 0.13232, 0.13873],
[-0.027796, 0.19015, 0.097864, 0.12603, -0.033269, -0.089501, 0.04756, 0.073741, 0.10899, 0.010866, -0.057266, 0.17803, -0.063867, 0.018021, 0.025919, 0.052576, -0.021274, -0.13049, 0.029636, 0.021721, 0.074926, 0.05983, -0.076901, -0.026485, -0.15053, -0.13725, 0.087833, 0.066023, -0.091947, -0.2149, -0.020022, 0.061471, 0.041399, 0.031512, -0.0153, 0.026068, -0.033971, -0.056572, 0.18971, 0.088995, -0.15964, -0.16587, -0.11188, 0.12235, -0.052308, -0.37845, -0.096614, -0.069048, 0.066169, 0.45011, 0.11905, -0.089093, -0.12905, -0.036526, 0.054822, 0.02481, -0.29747, -0.29999, -0.30525, 0.020997, -0.24089, -0.24201, -0.089791, 0.040398, 0.02526, 0.027389, 0.27071, 0.36232, 0.17799, 0.14461, 0.039188, -0.12174, 0.06238, 0.053787, 0.077565, 0.089143, -0.082913, 0.047936, 0.032228, 0.13504, 0.01206, -0.0045403, 0.048158, 0.081652, 0.042006, 0.0009472, 0.013452, 0.046158, -0.08677, -0.01951, -0.011155, 0.027566, 0.061728, 0.012115, -0.023208, -0.031607, 0.059643, -0.036766, -0.015929, 0.0064081, -0.081899, -0.02977, -0.088821, -0.028071, -0.023692, -0.019599, 0.057438, -0.038196, -0.011284, 0.039955, 0.099448, 0.06855, 0.073048, 0.062483, 0.026346, 0.051335, 0.055075, 0.054677, 0.024906, 0.045384, 0.032908]
],
"sobel": [
[0.021622, -0.039044, -0.037054, -0.070222, -0.14277, 0.010719, 0.23521, 0.042586, -0.066839, -0.035786, -0.040592, -0.04765, 0.015366, -0.0089413, -0.018094, -0.041156, 0.059194, 0.03497, 0.0085535, -0.012133, 0.037119, 0.011104, 0.013667, 0.057116, -0.039502, 0.0017173, -0.10081, 0.037478, 0.16095, -0.067174, -0.034198, 0.04378, -0.02895, -0.075339, -0.037953, 0.015621, -0.0062937, -0.11864, 0.049183, 0.1707, -0.019043, -0.042438, -0.017632, -0.075732, 0.0095324, 0.03293, -0.014258, -0.0098967, -0.080728, 0.076951, 0.1301, -0.11441, 0.020647, 0.0074901, 0.029524, -0.012759, -0.0093581, -0.0058362, 0.064104, -0.1647, 0.094418, 0.13507, -0.044142, -0.052786, -0.010841, -0.006663, -0.023002, 0.028816, 0.041661, -0.032028, -0.061565, 0.13252, 0.13007, -0.12915, 0.0036202, 0.036105, -0.012106, 0.0040582, -0.061908, 0.0076004, 0.03672, -0.14106, 0.20292, 0.060389, -0.09659, 0.054589, -0.10019, 0.041123, -0.036635, 0.116, -0.072959, 0.0058381, -0.080459, 0.15241, 0.064258, -0.09976, -0.038509, 0.0044402, -0.027742, -0.034369, -0.015116, 0.0058884, 0.046096, -0.057577, 0.10123, 0.074735, -0.08287, 0.016464, -0.035808, -0.034751, -0.0037474, -0.026826, 0.0056597, -0.06777, 0.056803, 0.22043, 0.017122, -0.14459, -0.079001, -0.0448, -0.099982],
[-0.039422, -0.057937, 0.074729, -0.048045, -0.037188, 0.052703, 0.26143, -0.061949, -0.10675, 0.031812, -0.051385, -0.006001, -0.00075896, -0.0050347, -0.041065, -0.017209, -0.0095906, 0.13126, -0.051458, -8.2457e-05, -0.063001, 0.0066233, 0.0045051, -0.0083206, 0.034913, 0.012367, -0.059277, 0.052288, 0.1547, -0.051592, -0.045779, -0.007896, -0.018757, -0.094971, 0.065529, -0.029159, 0.046869, -0.070025, 0.062731, 0.12066, -0.068658, -0.019059, 0.0074337, -0.067123, 0.02053, 0.013044, 0.0035088, -0.01203, -0.097183, 0.028502, 0.15192, -0.07064, -0.075749, 0.031913, -0.031982, -0.023049, -0.030048, -0.0032721, 0.060009, -0.10611, 0.0716, 0.029747, -0.055757, 0.010541, -0.038579, -0.013056, -0.046604, 0.045825, -0.011912, -0.011527, -0.095327, 0.05184, 0.069492, -0.078788, -0.022076, 0.055685, -0.02869, -0.01075, -0.034159, -0.03803, 0.057879, -0.13134, 0.085608, 0.12614, -0.044827, -0.049757, -0.024712, -0.071507, -0.024192, 0.01363, 0.048434, 0.024359, -0.0051155, -0.10514, 0.14444, -0.0088548, -0.068772, 0.041549, -0.034167, -0.021582, 0.030183, -0.0040015, -0.0083662, 0.026868, -0.022178, 0.083314, 0.01001, -0.030072, 0.037843, -0.070384, -0.083549, -0.036392, -0.016616, 0.062408, -0.091602, -0.006843, 0.095086, 0.048339, -0.027514, -0.13109, -0.096684],
[0.026522, -0.045758, -0.0065412, -0.085061, 0.14723, 0.047881, -0.019734, -0.051042, -0.066675, -0.018868, -0.041408, -0.11352, 0.064944, 0.026472, -0.00090233, 0.012634, 0.016737, 0.006623, -0.027195, -0.013684, -0.053134, -0.037127, -0.022633, -0.0018942, 0.033462, -0.11825, 0.020164, 0.11023, -0.034399, -0.0040491, 0.015541, -0.018763, 0.031383, -0.034906, 0.0084091, -0.044335, -0.0185, -0.036774, 0.11925, -0.066557, -0.015722, 0.008805, -0.073061, 0.02431, -0.0022227, -0.027085, 0.11301, -0.089658, -0.069331, 0.15228, -0.11814, 0.041523, -0.055859, 0.035897, -0.02284, -0.062359, 0.017954, -0.0023517, 0.024292, -0.020141, 0.16616, -0.060547, -0.095994, -0.035172, 0.00017003, -0.054487, 0.0051047, -0.024971, -0.026949, 0.13212, -0.015913, 0.14877, 0.079641, -0.1123, -0.0092442, 0.058819, -0.07792, -0.090482, 0.11103, 0.042626, -0.0021955, -0.036122, 0.047147, 0.18616, -0.063269, -0.063506, -0.029535, -0.029987, -0.016003, -0.030794, 0.0070419, -0.030444, -0.12719, 0.041134, 0.20405, -0.029811, -0.087053, -0.016364, -0.037892, -0.026402, -0.013779, -0.013032, -0.053538, -0.05678, -0.079377, 0.18237, 0.04188, -0.046827, -0.01942, -0.032796, -0.17044, -0.054026, -0.012647, -0.067306, -0.10224, -0.34972, 0.21799, 0.33122, -0.020319, -0.12057, -0.11657],
[-0.034746, 0.011922, -0.098449, 0.18031, 0.17477, -0.046518, -0.10946, -0.075727, -0.0042795, -0.017697, -0.093984, -0.0108, -0.0045569, -0.031379, -0.11851, 0.2367, -0.014786, -0.063302, 0.022537, -0.025072, -0.0027915, -0.020335, -0.026008, 0.010703, -0.04303, -0.047196, 0.12322, 0.071786, -0.065282, -0.067638, -0.030062, 0.0027285, -0.030746, 0.0343, -0.015485, 0.00061797, -0.12212, 0.050023, 0.1468, -0.084455, -0.010416, 0.017746, -0.037889, -0.0042453, -0.074445, -0.011522, 0.0065318, -0.093068, 0.00025768, 0.23352, -0.004984, -0.070961, -0.040406, 0.0038935, -0.063088, 0.0028549, -0.011365, -0.0051872, -0.011323, -0.15258, 0.10053, 0.12368, -0.077847, -0.059471, 0.028026, 0.048886, -0.019665, -0.017241, -0.041027, 0.001151, -0.082242, 0.078605, 0.16229, -0.010524, -0.030966, -0.041504, -0.039719, -0.038749, 0.05147, 0.030039, -0.051469, -0.060313, -0.081418, 0.17732, 0.02522, -0.012728, -0.064523, -0.013167, -0.013895, -0.049376, 0.01418, 0.00062313, 0.0072845, -0.10894, 0.027785, 0.19202, -0.085036, 0.023989, -0.022828, -0.014372, -0.026342, -0.0055468, -0.019471, -0.033932, -0.0091537, -0.036739, 0.10446, 0.02097, 0.024776, -0.07883, -0.053245, -0.010433, -0.010211, -0.051308, 0.037884, -0.099324, -0.12671, 0.083829, 0.12485, -0.019875, 0.021159],
[-0.073813, 0.045554, 0.21318, 0.054486, -0.10982, -0.10268, -0.046501, -0.055664, -0.020863, -0.001624, -0.0026296, 0.0099974, -0.10344, -0.0080814, 0.20537, 0.061264, -0.059836, -0.03879, -0.053678, 0.019924, 0.00067537, -0.035726, -0.035441, -0.024734, -0.1508, 0.10616, 0.18685, -0.06407, -0.067087, -0.0055311, -0.086093, 0.061426, -0.035219, -0.039575, 0.049802, -0.033981, -0.11534, 0.1808, 0.1276, -0.083274, 0.0040506, -0.0099809, -0.067759, 0.0026836, -0.0080343, 0.023532, 0.043117, -0.14059, -0.0016268, 0.15585, 0.069627, -0.12437, -0.02648, 0.020383, -0.028769, -0.0062858, -0.028321, -0.011687, -0.029153, -0.094922, 0.052872, 0.11088, 0.054252, -0.053297, -0.027559, -0.038545, 0.011349, -0.026962, -0.005885, 0.0020657, -0.062056, 0.027107, 0.07672, 0.0095546, 0.062121, -0.03263, -0.021507, -0.052784, 0.0030423, -0.0080316, -0.063925, -0.00021021, -0.10025, 0.10155, 0.064158, -0.069916, 0.082103, -0.046503, -0.0048848, -0.027586, -0.014081, 0.019043, -0.033131, -0.0089136, -0.054256, 0.11973, -0.018269, -0.023884, 0.049232, -0.014578, 0.046128, -0.07511, 0.046627, -0.041747, -0.032515, -0.054339, 0.017222, 0.11677, -0.026438, -0.032103, -0.055241, 0.056236, 0.0099623, -0.032474, -0.019767, -0.029422, -0.050974, -0.086443, 0.012599, 0.066122, 0.012114],
[0.00046674, 0.0005485, -0.00013619, -0.00013253, -0.00080157, -2.6911e-05, -0.00065764, -3.658e-05, -5.466e-05, 0.00014605, -0.00016962, -0.00015906, 0.00011235, 0.00050518, 0.00015356, -0.00031324, -0.00044301, 0.000532, 2.3645e-05, -8.4832e-05, -0.000272, 0.00022416, -7.1195e-05, -0.00019212, 0.00057396, 0.00035815, 0.00031159, -4.6937e-05, -0.00065506, -0.00011996, -4.2348e-05, 0.00010587, -7.9323e-05, -2.3722e-05, -0.0001704, -0.00057593, 0.00065222, 0.00026654, 0.00035667, -7.7692e-05, -3.8173e-05, 0.00010049, -0.00012168, -4.0491e-05, -4.816e-05, -0.00023287, -5.0225e-05, -0.00080183, 0.0010439, 6.197e-05, 0.00028902, 0.00010579, -0.00027248, -0.00018248, -9.7894e-05, 5.6122e-05, -2.4109e-05, -8.2564e-05, 1.2276e-05, -0.0011837, 0.0010388, -0.00030106, -8.2943e-05, 0.00046305, -3.4942e-05, 0.00026048, 8.0063e-05, -0.00023204, 0.00028043, -0.00017993, 0.00024111, -0.00077707, 0.00087259, -0.00047311, -4.8904e-05, 0.00030165, 0.00015237, -0.00032147, 0.000145, -0.00014869, -8.4069e-05, -1.1489e-05, -7.3104e-05, -0.00027258, 0.0010046, -0.00060634, -0.00030284, 0.00023946, 4.0874e-05, 0.00020669, 4.6264e-05, 0.0002212, -0.00025433, -6.9621e-05, -0.00011541, -0.00025522, 0.00090808, -0.00014796, -0.00027357, -0.00019226, 0.00015027, -0.00010411, -0.00012272, 0.00033767, -0.00040885, 1.4065e-05, -6.0894e-05, -1.227e-05, 0.00046367, 0.00018272, -3.3562e-05, -0.00018615, 0.00024748, -0.0002204, -0.00026552, -4.8267e-05, -0.00013654, -0.00016522, -9.9852e-05, -7.3085e-05, 7.6497e-05],
[0.00014192, -1.085e-05, 0.00016776, -0.00011605, 6.6756e-05, -0.00015563, 6.4164e-05, -0.00016144, -1.1567e-05, -2.939e-05, -0.00018546, -0.00014193, 0.00015689, -0.00022987, 0.00050602, 1.1479e-05, -3.5358e-05, 5.4151e-05, 0.00011627, 3.7186e-05, 5.9554e-05, 3.1315e-05, 1.2057e-05, -9.6696e-05, 0.00010448, -0.00015507, 0.00022023, 8.3867e-05, -0.00012962, -6.7578e-05, -1.3556e-05, -3.5738e-05, -4.5809e-05, -6.3549e-06, -0.00015612, 7.0085e-05, 0.00029764, -0.00010577, 0.0001273, 1.2399e-05, 1.8646e-05, 0.00024213, -0.00015873, 8.3707e-05, -0.00032598, 0.00041133, -8.8688e-05, -0.00049296, 0.00020605, 9.3561e-05, 0.00024763, 0.00036524, -0.00023689, 0.00033172, 1.2629e-05, 0.0002408, -0.00040064, -5.9563e-05, 0.00028034, -0.00028346, 0.00013392, 3.0494e-06, -0.00034838, 0.00059746, -9.9846e-05, 0.00041454, -0.00023074, 0.00034209, -0.00016581, 3.9766e-05, -0.0002783, 0.00012538, 1.4736e-05, 0.00027567, -0.00048884, 8.7213e-06, -2.0493e-05, 0.000205, -0.00032258, 0.00032033, -0.00024322, 2.9087e-05, -0.00028867, 3.0825e-05, -3.6798e-05, 0.00029228, 0.00052891, -0.00024059, -0.00029899, 0.0002319, -0.00024299, 0.00012632, 6.8366e-05, 0.0001055, -7.3226e-05, -0.00010182, -7.6342e-05, -0.00040021, 0.00051869, 0.00045282, -0.00025642, -5.3312e-05, -0.00015072, 0.00026346, 1.5723e-05, -0.00010612, 0.00010031, -0.00022901, 0.00029515, -0.0003781, -0.00048427, 0.00022179, -6.5522e-05, 0.00033674, -0.00046179, 0.00010507, -8.1386e-05, -8.5409e-05, -8.8996e-05, -7.5853e-05, 2.6564e-05],
[-0.010683, -0.026204, -0.035349, -0.0089039, -0.078265, 0.014533, -0.039735, 0.0028868, 0.0082563, -0.036876, 0.0019618, 0.052924, 0.035479, 0.021452, -0.012058, 0.032416, 0.0081487, -0.0082878, -0.011302, 0.045192, 0.044327, 0.019364, 0.11357, -0.032979, 0.075698, 0.019097, 0.0083418, -0.0060608, -0.024521, -0.0062564, -0.019425, 0.042618, 0.11771, 0.14807, 0.072421, 0.058253, 0.036447, 0.06185, 0.049705, 0.055431, 0.070267, 0.10792, 0.053117, 0.12943, -0.037521, 0.09371, 0.067577, 0.068725, 0.076127, 0.12312, 0.083411, 0.039387, 0.056425, 0.014238, 0.056634, -0.0075863, -0.083041, -0.03313, -0.027636, -0.047769, -0.063296, -0.062579, -0.046277, -0.0014999, 0.035908, -0.15153, -0.06746, 0.052979, -0.025619, 0.037942, 0.064911, 0.022302, 0.055271, 0.092705, 0.018963, -0.053973, 0.0083301, -0.021218, -0.030571, -0.0021454, -0.026876, -0.049043, 0.0051261, -0.0069455, -0.055541, -0.024578, 0.015168, -0.068003, -0.00048112, -0.05652, 0.04967, 0.016316, -0.034086, 0.063067, -0.0080033, 0.033386, -0.044576, -0.023441, -0.044509, -0.037162, 0.007319, -0.073158, -0.011373, 0.072031, -0.018016, -0.00013859, 0.028374, -0.025567, -0.013903, 0.052808, -0.038318, -0.022987, 0.0062782, 0.029734, -0.090237, 0.0094684, -0.067607, -0.012207, 0.0039499, 0.0017681, -0.13205],
[-0.00048966, -9.6134e-05, 9.5024e-05, -9.4831e-06, -0.00027318, -1.286e-05, -0.00018753, 0.0002536, 0.00013593, 0.00010672, 0.00025208, 0.00030575, -1.8677e-05, -0.00013599, -1.8597e-07, 0.00018716, -2.9456e-05, 1.7404e-05, 0.00029171, -1.6893e-05, 0.00029143, 9.82e-06, -0.00012202, -0.00018215, 5.8728e-06, -2.3871e-05, -0.00016916, -7.7176e-05, 0.00053888, -7.5954e-05, 0.00047546, -0.00048533, 0.00025243, -5.289e-05, 0.00026631, -5.7069e-06, 9.4805e-06, 0.00012584, 0.00045285, -3.7921e-05, 0.00010519, -0.00021575, 0.00013059, -0.00055512, 0.00014299, -1.537e-06, 8.0654e-05, 0.00040678, 0.00038999, 3.6877e-05, -2.6107e-05, -8.5584e-05, -0.00015584, -0.00011966, -3.6535e-05, 0.00054094, 0.00037631, 0.0005227, 0.00013112, -0.0004006, -0.00026994, -4.3073e-05, -4.6583e-05, 0.00011704, -0.00025562, -9.7989e-06, 0.00028045, -0.00016084, -0.00025724, -0.00046505, 0.00040393, 0.00034091, -0.00019371, -0.00012426, 0.0001461, 4.8875e-05, -0.00016903, -0.00037192, -0.0002158, 0.00039962, 0.00079813, 6.5351e-05, -0.00066373, 1.4202e-05, -3.0669e-05, -0.00013015, 1.1834e-06, -6.0453e-05, 0.00046003, 0.00029649, -9.7422e-05, -0.00054615, -0.00054555, 0.00030505, -0.00012282, 3.1042e-05, 0.00012688, -1.1536e-05, -0.00017687, 0.00011095, -0.00059224, 0.00021684, -0.00045799, 0.00057995, -0.00013937, -0.00021221, -5.4137e-05, 3.6609e-05, 4.5939e-05, 0.00021479, -0.000327, 0.0001269, -0.0003423, 0.00034768, -0.00067549, -4.1513e-05, 0.00018063, -0.00018814, 2.8973e-06, 1.3507e-05, -0.00041261],
[-0.00013437, 0.00012211, -8.2414e-05, -5.7302e-05, -0.00030739, -2.2492e-05, -0.00017176, -7.7102e-05, 4.7108e-05, 0.00017636, 0.00032836, 4.1088e-05, 4.9949e-05, -0.00011876, -0.00023944, 6.1006e-05, -5.4786e-05, -0.00036632, 0.0001673, 0.00025493, 2.2227e-05, -4.4608e-05, 4.8917e-05, 4.1964e-05, -6.1314e-05, 0.00022686, -8.9248e-05, -0.00019302, 0.00023805, 5.5691e-05, 0.000167, 0.00017966, -0.0003835, 3.1919e-05, -0.00021914, 0.00033657, -0.00015381, -0.0001264, 7.8444e-05, -2.5921e-05, 0.00038528, -1.4539e-05, -0.00049288, 0.00010287, -6.4383e-05, 0.0002381, -0.00031386, 0.00014008, -5.8913e-05, 0.00032747, 0.00039023, -7.4475e-05, -0.00041729, -5.226e-06, 0.00012736, 3.6629e-05, 6.5629e-05, 0.00021839, -0.00011813, 0.00021698, 9.6288e-05, -0.0002608, -0.00039654, 0.00011671, -4.0163e-05, -9.6609e-05, 0.00019201, 3.5895e-05, -0.00013216, -2.2031e-05, -9.3108e-05, 0.00025392, -4.0757e-06, -0.00012808, -0.00015139, 0.00022617, -0.00010183, -2.1483e-05, 0.00028357, -0.00028491, -4.2892e-05, 0.00041456, -0.00012604, -0.00039707, 7.6033e-05, 0.00029654, -0.00021374, 2.3271e-06, 9.5164e-05, -0.00068015, 0.00037026, 0.00019251, 0.00013551, -0.00031121, 9.685e-05, -0.00011268, -0.00023013, 0.00015402, 6.4205e-05, -0.00034974, 0.00064853, -4.473e-05, 0.00021225, -0.00034308, -3.7734e-05, -3.8868e-05, 8.6499e-05, 0.00014457, -0.00014733, -2.7613e-05, 0.00026354, -9.6315e-05, -8.0324e-05, -0.00018999, -5.9127e-05, 0.00014091, -0.00012997, -5.0352e-06, -0.00015232, 0.000231, -0.00021588],
[-0.011114, -0.032645, 0.032393, -0.053019, -0.05229, -0.14091, -0.10663, 0.076743, 0.19184, 0.090513, -0.098345, -0.011357, 0.036593, -0.053861, 0.021336, -0.047044, -0.079543, 0.069135, 0.16071, 0.0038457, -0.086696, -0.030081, 0.022665, -0.023073, -0.018331, 0.0011058, -0.10917, -0.046906, 0.1088, 0.17215, -0.16345, 0.047387, -0.050131, -0.029615, -0.038382, 0.0016627, -0.03478, -0.070943, 0.07791, 0.2302, -0.14284, -0.033306, -0.012579, 0.0084163, -0.032994, -0.048339, -0.019525, -0.069845, 0.014727, 0.14997, 0.078032, -0.15724, -0.0040331, 0.020646, -0.010654, -0.068656, 0.024298, -0.0024877, -0.030228, 0.090227, 0.080843, -0.086655, 0.01296, 0.018917, -0.045623, -0.032739, -0.036379, -0.052935, 0.0072628, 0.025316, 0.065355, 0.05083, -0.051373, 0.012063, -0.053921, 0.0041695, -0.0082265, -0.01122, -0.0075849, 0.059, -0.039921, 0.11126, -0.021519, -0.057332, 0.005526, -0.0042105, 0.0091544, -0.029534, -0.0046619, 0.086827, -0.087906, 0.060049, 0.08224, -0.067951, -0.052837, -0.081788, 0.043806, -0.035919, 0.030943, 0.048874, -0.078419, 0.036039, 0.15302, -0.0020635, -0.062144, -0.0042183, 0.018343, -0.0063008, -0.011523, -0.047258, -0.028718, 0.078802, 0.069202, -0.08006, -0.14107, -0.025482, -0.020509, -0.015509, -0.0094705, 0.014878, -0.0034915],
[-0.049718, -0.035759, -0.022243, -0.035623, -0.068946, -0.14441, 0.23465, 0.15847, -0.065972, -0.018536, -0.024797, -0.0076368, 0.0066228, -0.017527, -0.010789, -0.040286, -0.0056962, 0.13973, -0.042841, -0.030913, -0.050613, -0.014451, -0.033321, -0.053283, 0.0084957, -0.033399, -0.10205, 0.030196, 0.21111, -0.085712, -0.030767, 0.0065006, -0.032108, 0.010381, 0.037671, -0.056206, -0.032604, -0.1561, 0.15115, 0.087468, -0.079714, 0.018202, -0.0045105, 0.026833, -0.043426, -0.026067, -0.02529, -0.042097, -0.070926, 0.2353, 0.011521, -0.095817, -0.018725, -0.037049, -0.026822, -0.019582, 0.044677, 0.02881, -0.058262, 0.024777, 0.1255, -0.035929, -0.087119, -0.0026901, 0.0046237, -0.01805, 0.016779, -0.012651, -0.089945, -0.061953, 0.10991, 0.15038, -0.090164, -0.035134, 0.019258, -0.02301, -0.026283, -0.066215, 0.0036082, -0.019206, -0.020172, 0.19898, -0.024159, -0.048082, -0.027408, -0.075525, 0.064454, -0.058575, -0.0086368, -0.0086036, -0.060077, 0.045972, 0.12618, 0.022411, -0.1105, 0.0069619, -0.0094113, 0.015503, -0.048438, -0.046829, -0.00022239, 0.0014118, 0.089525, 0.079141, -0.092462, -0.018049, 0.0014867, 0.0047595, -0.0017288, -0.027305, -0.032111, -0.017611, 0.073416, 0.11602, -0.044348, -0.098407, -0.0088183, -0.04299, -0.039403, 0.014837, -0.050635],
[-0.068701, -0.032924, -0.028685, -0.027347, -0.012438, 0.045308, 0.14147, -0.024737, 0.021872, -0.029614, 0.0014704, 0.00061449, -0.065002, 0.036644, -0.03221, -0.01372, 0.0042619, 0.043979, -0.046108, -0.020623, 0.092668, -0.085227, -0.047327, 0.056896, -0.038868, -0.091733, -0.0024676, 0.054788, 0.092325, -0.083977, -0.022272, -0.015279, -0.037661, 0.007948, 0.03556, -0.051925, 0.0048635, -0.051612, 0.069927, 0.019604, -0.05813, 0.03412, -0.022789, 0.0056804, -0.011191, -0.04521, 0.042702, -0.027746, -0.083076, 0.15661, -0.028534, -0.064019, 0.0071637, 0.010947, -0.026172, -0.039177, -0.052625, -0.032611, -0.024151, -0.029592, 0.14367, -0.017566, -0.05466, 0.057155, 0.029811, -0.06134, 0.040778, 0.011699, -0.0088244, -0.13868, 0.0070548, 0.1384, 0.034596, 0.011188, 0.048424, 0.010038, -0.0018498, -0.037856, -0.043326, 0.0080412, -0.1369, 0.15427, 0.053186, -0.062849, 0.098908, 0.024336, 0.0012518, -0.020851, -0.010459, -0.013998, -0.062995, -0.12718, 0.18117, 0.12558, -0.13692, -0.022944, -0.023608, -0.0059309, -0.029009, -0.11053, 0.016766, -0.029906, -0.010995, 0.17826, 0.052695, -0.15857, 0.018373, -0.062619, 0.025193, -0.0018929, -0.067841, -0.050794, -0.10117, 0.13362, 0.34075, -0.12172, -0.2107, -0.083359, -0.078476, -0.029252, -0.22249],
[-0.065571, 0.057388, -0.13425, -0.095897, 0.24651, 0.14475, -0.10963, 0.025485, -0.006675, 0.018031, -0.072827, 0.030726, -0.044557, -0.015541, -0.056845, 0.085633, 0.10033, -0.037429, -0.062462, -0.033927, 0.014833, -0.031364, -0.023246, -0.032758, 0.029612, -0.098209, 0.077944, 0.095671, -0.083246, 0.020906, 0.050811, -0.039132, 0.038704, -0.040633, 0.00067528, 0.013989, -0.13054, 0.045164, 0.11112, -0.063736, 0.037782, 0.017424, 0.061583, -0.063674, -0.085358, 0.034715, -0.0030215, -0.074515, 0.12039, 0.11915, -0.066498, -0.05749, 0.021248, -0.043396, 0.056092, -0.050906, 0.030755, -0.017042, -0.086373, 0.043707, 0.071729, -0.046172, -0.12569, 0.062778, -0.054878, 0.0098493, 0.042535, -0.025427, 0.0048504, -0.034534, 0.057141, 0.071824, -0.078857, 0.046187, 0.014022, -0.0059724, -0.059074, -0.052311, -0.018659, 0.016795, -0.048576, 0.0056966, 0.17001, -0.14025, -0.01492, -0.024501, 0.06768, -0.052642, -0.077081, 0.042505, -0.035988, -0.048451, 0.047675, 0.055033, -0.064761, 0.020293, 0.0052681, -0.0087241, -0.060607, -0.069111, 0.024796, -0.027098, -0.0012387, 0.015077, 0.055874, -0.027944, 0.0052288, -0.048321, 0.085962, -0.0020463, -0.11994, -0.049601, -0.092974, -0.03198, 0.15102, 0.082755, -0.058126, 0.041661, -0.037047, 0.00087627, -0.080283],
[-0.034049, -0.013918, -0.065488, -0.04731, 0.23782, 0.10577, -0.16564, -0.010855, -0.078836, -0.05002, -0.082312, 0.0046222, 0.02797, 0.0058953, -0.040404, 0.085254, 0.028249, -0.056799, -0.03836, 0.064562, -0.0049545, -0.0026872, 0.015598, -0.018252, -0.05971, -0.057151, 0.13138, 0.056842, -0.023477, -0.047153, 0.0008577, 0.011009, 0.0056124, -0.055915, -0.028097, 0.048625, -0.096117, 0.13044, 0.12721, -0.12259, -0.022446, 0.0076033, -0.0078139, -0.040903, -0.00098022, 0.010152, -0.055309, -0.092262, 0.07871, 0.14964, -0.059601, -0.07591, 0.069756, -0.012391, 0.016172, -0.01017, -0.0099409, 0.057863, -0.0535, 0.0023151, 0.24268, -0.16271, 0.003039, -0.0019135, -0.031935, 0.031241, -0.013448, 0.018763, -0.027194, -0.063835, -0.019315, 0.17296, 0.004778, -0.046724, 0.0006375, 0.012018, -0.049906, 0.063102, -0.059113, -0.0019439, -0.014409, -0.015148, 0.15803, -0.0095471, -0.14208, 0.10783, -0.029316, 0.0049959, -0.02723, -0.027548, 0.011938, -0.05422, -0.092135, 0.23666, 0.043819, -0.041978, -0.0056029, -0.027255, 0.0096145, -0.04155, -0.034068, -0.012401, -0.041538, -0.049314, 0.16482, 0.042083, -0.10972, 0.066034, -0.007725, 0.0029249, -0.080851, -0.05769, -0.037836, -0.09375, -0.14353, 0.17091, 0.14407, -0.019807, -0.03718, -0.013199, -0.047378],
[-0.089356, -0.043599, -0.040685, -0.056315, -0.064317, -0.036306, 0.087125, -0.025232, 0.060763, -0.016932, -0.040975, 0.0011693, -0.02347, 0.03936, -0.0044332, -0.014202, -0.070464, 0.013142, 0.003362, -0.010206, 0.03951, 0.020167, 0.056938, 0.034174, -0.062667, 0.0839, -0.0039051, -0.12024, -0.019127, 0.068195, 0.0042397, -0.024727, 0.013195, 0.10092, 0.083733, 0.093601, -0.028064, 0.15309, 0.019081, -0.13459, -0.041819, 0.023908, -0.0036808, 0.0078939, 0.064007, -0.027475, -0.014962, 0.019431, -0.10422, 0.18788, 0.0038647, -0.021851, -0.07162, -0.0073304, 0.023479, -0.032992, 0.074772, 0.11997, 0.16653, -0.043451, -0.19633, -0.01512, 0.015596, -0.041436, 0.075827, -0.0062698, -0.13523, -0.13543, -0.0794, 0.013399, 0.29846, 0.12613, -0.082085, 0.034499, -0.060887, 0.028444, -0.036122, 0.0051284, -0.046056, -0.18431, -0.20981, -0.12018, 0.095624, 0.012102, -0.022525, -0.045282, -0.012822, 0.043771, 0.080442, 0.053685, 0.040662, -0.010274, -0.10557, -0.073596, 0.038444, -0.019075, 0.012246, -0.0015394, -0.021037, 0.055182, 0.044094, 0.02839, 0.0097436, -0.041473, -0.055378, -0.016991, -0.0081618, 0.0076016, -0.0066457, 0.040565, 0.081751, 0.05078, 0.11557, 0.055483, -0.057897, -0.11059, -0.071829, 0.061971, -0.030281, 0.019305, 0.054297],
[-0.24374, -0.072314, -0.041972, -0.143, 0.061523, -0.030205, -0.020865, -0.047648, -0.0041297, 0.040277, 0.0059092, -0.061426, -0.049228, -0.070004, -0.064273, -0.026634, -0.065741, -0.05105, 0.0043411, -0.016116, -0.031515, 0.037031, -0.12281, -0.030326, -0.047122, 0.0069455, -0.1202, 0.03392, -0.036501, -0.023249, -0.1156, 0.038387, -0.0026533, 0.061601, 0.10392, 0.10819, 0.068685, 0.11776, 0.017679, -0.058902, -0.020291, 0.00014691, -0.12261, -0.010208, 0.25552, 0.13824, 0.14468, 0.13523, 0.19144, 0.31527, 0.11572, 0.11682, 0.032566, -0.050278, -0.13474, 0.0088966, -0.066686, -0.10871, -0.18659, -0.34157, -0.34638, -0.011264, 0.029142, 0.12461, 0.10801, -0.02281, -0.047432, -0.016066, -0.012088, 0.13024, 0.16586, 0.082232, -0.18073, -0.23906, -0.0034761, -0.0025529, -0.0080703, 0.035855, 0.06089, 0.052805, -0.003316, 0.12385, 0.18824, 0.2921, 0.11943, -0.074494, -0.037462, -0.023738, 0.072599, -0.00045486, 0.00074298, -0.0015929, -0.17247, -0.15444, -0.13465, 0.032777, 0.07086, -0.00047705, -0.032344, -0.039986, -0.074752, -0.069852, -0.082819, 0.032778, -0.0042938, -0.015013, 0.018193, -5.6098e-05, 0.01986, 0.033074, 0.016572, 0.091964, 0.073377, 0.098478, 0.036105, 0.05087, 0.010385, 0.040242, -0.070135, 0.0028041, -0.10929],
[-0.076119, -0.019269, -0.031755, -0.046456, -0.040704, -0.050843, -0.021974, -0.025543, -0.074161, -0.013171, -0.11347, -0.057228, -0.029591, -0.034244, 0.0061905, -0.0094645, -0.044626, -0.10437, -0.028686, -0.04109, -0.046152, 0.0098326, -0.067696, -0.028013, -0.071397, -0.075353, -0.10566, -0.075523, -0.026284, -0.031035, 0.045982, -0.029752, 0.011393, -0.10394, -0.034764, -0.037846, 0.00012124, 0.091279, 0.14577, 0.11042, 0.1887, 0.10738, 0.13269, 0.010378, -0.052734, 0.07628, 0.13003, 0.24686, 0.21184, 0.24704, 0.22868, 0.036921, -0.028737, -0.070385, 0.0055155, 0.11568, 0.1066, 0.19512, 0.045422, -0.075768, -0.18362, -0.31804, -0.19549, -0.077995, -0.031296, -0.077328, 0.12871, 0.041487, -0.13922, -0.20396, -0.15728, -0.072167, 0.086564, 0.10758, 0.081809, 0.066724, 0.047445, 0.017639, -0.10582, -0.056754, 0.048224, 0.14307, 0.12359, 0.071727, -0.018593, 0.069247, 0.0029738, -0.0012684, 0.0058617, -0.039955, 0.069868, 0.014017, -0.046601, -0.047068, -0.046682, -0.024441, -0.037553, -0.059138, 0.03927, -0.033803, -0.016677, -0.036287, -0.033653, -0.081055, 0.022449, -0.051865, -0.0022565, 0.0065501, 0.019614, 0.035675, -0.088138, -0.049861, -0.046523, 0.015603, 0.070303, 0.025612, 0.068457, 0.035739, 0.0148, 0.028994, 0.026774],
[-0.05879, -0.039923, -0.010605, -0.018499, -0.0048651, -0.060301, 0.00031834, -0.12557, -0.080004, -0.13698, -0.22799, -0.025563, 0.031597, 0.034181, -0.05038, -0.036901, -0.020123, -0.11426, -0.08245, -0.12939, -0.015453, 0.16526, 0.0054734, -0.021933, -0.058345, 0.022962, -0.037437, -0.12779, -0.028891, -0.0028919, 0.26949, 0.17558, 0.34734, -0.099006, -0.032826, -0.065174, -0.028457, -0.062602, 0.032022, 0.15695, 0.34154, 0.2028, 0.12458, -0.093376, -0.072239, 0.0090947, -0.044389, -0.052575, 0.02948, 0.26925, 0.22827, -0.0022877, -0.11146, -0.13529, -0.15036, -0.085843, -0.024537, 0.0086891, 0.021944, 0.16653, 0.08152, -0.14405, -0.1499, -0.11121, 0.001073, 0.098095, -0.034221, 0.0040176, -0.018013, 0.07321, -0.0072272, -0.015973, -0.061004, 0.054833, 0.067576, 0.074127, -0.042424, -0.037337, 0.022891, -0.0034269, 0.043776, -0.005555, -0.060685, -0.045928, -0.0088831, -0.077575, -0.073069, -0.0075845, -0.058704, 0.03243, 0.1114, -0.061069, -0.022957, -0.081457, 0.013486, -0.10699, 0.026815, -0.046958, -0.0095644, -0.0078126, 0.021326, 0.027801, 0.056729, -0.07589, 0.0018496, 0.022934, 0.013436, -0.03088, -0.0049469, 0.0040992, -0.0091408, 0.10872, 0.020712, -0.030869, -0.0019258, -0.011927, -0.081406, 0.063922, -0.010456, 0.037077, 0.088835],
[-0.036641, -0.022319, 0.024522, 0.03344, 0.088325, -0.078447, -0.047208, -0.047259, -0.025216, -0.015415, -0.092115, 0.044024, -0.0091154, 0.0048974, 0.030834, -0.020765, -0.020724, -0.012244, -0.04629, 0.018593, 0.0051453, 0.034378, -0.060076, 0.057462, -0.029605, -0.032985, 0.019794, -0.091802, -0.039565, 0.14253, -0.018064, 0.012289, 0.04912, 0.057131, -0.0053969, -0.027773, -0.0045553, -0.016294, -0.10181, 0.21508, -0.039234, -0.013888, 0.045507, 0.12177, -0.0049585, 0.012483, 0.00022151, -0.0047489, -0.05636, 0.1752, -0.055694, -0.082197, 0.064538, 0.047484, -0.0028928, -0.015339, 0.0027033, 0.0067498, -0.040248, 0.078968, -0.10963, -0.17063, 0.2286, 0.07852, 0.008033, -0.011424, -0.015146, -0.023533, 0.009966, -0.026743, -0.042415, -0.049676, 0.29646, 0.025691, -0.048511, -0.10024, -0.16647, 0.026747, 0.034919, -0.012381, 0.031329, -0.038088, 0.13554, -0.038601, -0.15955, -0.1865, -0.057062, -0.01277, 0.014754, -0.034539, 0.0060587, -0.0098109, 0.069117, -0.071244, -0.13193, -0.031816, 0.027198, 0.044916, 0.13642, 0.051541, -0.023023, -0.0075025, 0.0075302, -0.059348, -0.044235, -0.011581, 0.0014665, 0.047136, 0.015656, 0.066013, 0.0582, -0.015587, 0.0052092, 0.014817, 0.018388, -0.086676, -0.067044, -0.0035215, 0.064161, 0.065318, 0.067259],
[0.004506, 0.045655, -0.0064831, -0.0032628, -0.01041, -0.037024, -0.036963, -0.091094, -0.11865, -0.06429, -0.19248, -0.0017368, -0.0097469, 0.0016448, -0.040873, -0.014221, -0.035843, 0.016147, -0.039843, -0.09313, -0.0023747, -0.1383, 0.028428, -0.013697, -0.11157, -0.0089864, -0.080753, 0.012804, -0.062406, -0.010726, -0.03342, -0.013381, -0.12601, -0.0011651, -0.096303, -0.033961, -0.072716, 0.035903, -0.050367, 0.039466, 0.089595, 0.080324, 0.15694, 0.13047, -0.10542, -0.05508, -0.0081043, 0.049795, 0.08505, 0.33221, 0.25591, 0.1717, 0.11686, 0.11406, 0.22947, -0.012136, 0.083665, 0.13744, 0.2076, 0.02481, -0.25485, -0.37635, -0.27149, -0.10308, -0.073758, 0.006322, -0.0071614, 0.024395, -0.030595, -0.22377, -0.21688, -0.060604, 0.18641, 0.14118, 0.071716, 0.013664, -0.059638, -0.079133, 0.051501, -0.10958, 0.040358, 0.24552, 0.1985, 0.13276, -0.0033278, 0.095717, 0.0060755, 0.070214, -0.060296, 0.023306, 0.036242, 0.094785, -0.051031, -0.048582, -0.1362, -0.042785, -0.055491, 0.0010026, 0.011273, -0.0070417, -0.026903, 0.012495, -0.0049653, 0.014208, -0.058316, 0.020101, -0.055566, -0.058258, -0.12155, 0.036277, -0.11927, 0.11091, -0.087205, -0.0029129, -0.025028, 0.012107, 0.068614, 0.071374, 0.098125, 0.14037, -0.002956],
[-0.086667, -0.065565, -0.023817, -0.020441, -0.07197, 0.00028669, -0.048728, -0.02516, -0.071502, 0.009494, -0.072387, -0.025154, 0.02346, -0.059503, -0.045615, -0.08352, -0.085543, 0.01373, -0.021149, -0.0073163, -0.037713, -0.074774, 0.034622, -0.025474, 0.030186, -0.019963, -0.049692, -0.11327, -0.074519, -0.12604, -0.037064, -0.024954, -0.083736, 0.02475, 0.05933, 0.062205, 0.17133, 0.16122, 0.16387, 0.058308, 0.025831, -0.04348, -0.041636, -0.12914, -0.040109, 0.020146, -0.0014665, 0.091342, 0.11972, 0.2388, 0.30998, 0.24622, 0.18587, 0.12053, -0.0034211, -0.03053, -0.032291, -0.076194, -0.19607, -0.20015, -0.19677, -0.18309, -0.00055713, 0.13744, 0.12949, 0.2056, 0.023511, 0.016947, 0.073624, 0.065649, 0.062699, -0.050179, -0.092252, -0.22545, -0.14499, 0.019198, 0.082962, -0.019486, 0.011993, 0.04133, 0.076363, 0.031762, 0.15907, 0.10336, 0.039866, 0.021912, -0.15923, -0.013829, 0.076214, -0.018094, -0.022784, -0.075767, -0.0047947, -0.12287, 0.031159, -0.051655, 0.096187, 0.0095671, -0.031624, -0.052568, -0.003142, 0.023309, -0.0023387, -0.0094488, -0.045824, -0.005481, -0.081258, -0.053087, -0.0010084, -0.103, 0.050103, 0.039084, 0.0007826, 0.066585, 0.019513, 0.07854, 0.012933, 0.061861, -0.037749, -0.044014, -0.058653],
[-0.23766, -0.10644, -0.14205, -0.03341, -0.051747, -0.049029, -0.010143, -0.0458, 0.034452, -0.037463, -0.052618, 0.10955, -0.1361, -0.0095472, -0.12706, -0.092229, 0.021264, -0.080028, -0.010055, -0.021203, 0.016576, -0.02837, 0.33291, 0.2809, 0.12848, 0.033793, -0.023904, -0.16851, -0.0060729, -0.023245, -0.056641, -0.012011, -0.098774, -0.064504, 0.10266, 0.25554, 0.24277, 0.21967, 0.11091, -0.10184, -0.08746, -0.0029721, -0.00012925, -0.02508, -0.086435, -0.18088, -0.11352, 0.03289, 0.15787, 0.23051, 0.1488, 0.032438, -0.057059, -0.069308, -0.082356, 0.042285, 0.043413, -0.072265, -0.16689, -0.16026, 0.028475, 0.18131, 0.041853, 0.0049307, -0.0008325, -0.047832, 0.0010252, 0.017498, 0.074032, 0.054063, -0.0048789, -0.10176, 0.018693, 0.007621, 0.0085935, 0.02913, -0.076722, -0.044435, -0.041904, -0.042182, -0.027448, 0.043453, -0.014281, -0.11364, 0.021624, 0.059888, 0.04825, -0.025918, 0.028058, -0.035965, 0.010591, -0.061233, -0.057899, -0.088443, 0.0012601, 0.015192, 0.014316, 0.039038, -0.01107, 0.0044676, 0.0051525, -0.076856, 0.024632, -0.046934, -0.0043118, -0.041969, -0.015695, 0.013526, 0.048797, 0.00035467, 0.071901, 0.016275, 0.070923, -0.0088248, 0.043458, -0.014639, -0.013192, -0.037524, 0.024709, 0.057087, 0.0058576],
[-0.024542, 0.032672, 0.11773, -0.034174, -0.071743, -0.16175, 0.014165, 0.019531, -0.054978, -0.0038957, -0.090196, 0.064812, -0.047234, -0.019134, -0.080948, -0.11018, 0.10727, 0.11986, -0.13898, 0.02947, -0.069941, 0.10165, 0.0042591, -0.049348, -0.083661, -0.087656, 0.020522, 0.080192, -0.15728, -0.028886, 0.073544, 0.20706, 0.066144, -0.069632, -0.055387, -0.0099159, -0.039718, 0.14583, -0.022727, 0.017713, 0.28062, 0.075763, -0.1576, 0.12669, -0.0065958, -0.023039, -0.016204, 0.011444, 0.031045, 0.09939, -0.050473, -0.030751, -0.15956, 0.012868, -0.16705, -0.047964, -0.077403, 0.025311, 0.040895, 0.090109, -0.31175, 0.059979, 0.17392, 0.068215, 0.22655, -0.11278, 0.015118, -0.0629, -0.069945, -0.04491, 0.14433, 0.29233, 0.19559, -0.057851, -0.014726, 0.088841, 0.26941, -0.054034, 0.011159, 0.024544, -0.0050103, 0.1229, -0.042268, -0.045072, -0.023986, -0.018777, -0.064872, 0.17923, 0.017718, 0.012677, -0.084142, 0.092705, -0.14742, -0.077405, -0.041954, -0.018945, 0.060652, -0.044563, -0.046249, 0.033354, -0.0018617, -0.067678, -0.023334, 0.013622, -0.012602, 0.056142, -0.019617, -0.093416, 0.025936, -0.21076, 0.040245, -0.077189, 0.014213, -0.11507, -0.08021, -0.12404, -0.034792, -0.051307, -0.044479, -0.042402, -0.074817],
[0.01158, 0.076463, 0.00079803, 0.048838, 0.12248, 0.013744, 0.018861, 0.011586, 0.04539, 0.031693, 0.07499, -0.0098663, -0.1034, -0.071572, 0.0043787, -0.077789, -0.019559, 0.01204, 0.0018615, 0.017977, -0.047083, -0.0071368, -0.17556, -0.080029, -0.0318, -0.057597, -0.022591, -0.024016, 0.020306, 0.0070647, -0.049746, 0.010918, -0.007976, -0.057844, 0.040415, 0.050513, -0.02868, -0.088878, -0.11596, -0.14727, -0.12186, -0.013719, 0.0032338, -0.10004, -0.017784, -0.043427, 0.0025162, 0.03118, 0.092565, 0.021359, 0.17682, 0.066269, -0.056798, 0.020215, -0.08873, -0.019043, 0.12149, 0.039671, 0.12659, 0.25102, 0.31362, 0.22184, 0.13597, 0.10116, -0.24302, 0.0097296, 0.18357, -0.026127, 0.034417, -0.0047517, -0.19722, -0.30262, -0.31482, -0.1434, 0.093247, 0.26018, -0.15232, -0.11886, -7.9502e-05, 0.14995, -0.077373, -0.015999, 0.25216, 0.22726, 0.051762, -0.070376, 0.039304, 0.046344, -0.018432, 0.22509, 0.059918, 0.046243, 0.1184, -0.19507, -0.14026, 0.057466, 0.11019, -0.013542, 0.047028, 0.024668, -0.0058191, -0.087337, 0.089096, 0.06501, -0.043338, -0.019093, 0.14833, 0.078021, 0.070724, -0.031358, -0.072959, -0.13113, -0.086264, -0.072841, 0.077043, 0.077563, 0.10315, -0.053458, -0.045827, -0.029004, -0.22848],
[-0.069051, -0.13696, -0.0056563, 0.017174, 0.054751, -0.059932, -0.015331, -0.0068192, 0.0012622, -0.01923, -0.059761, 0.078693, 0.10894, -0.075681, -0.20953, -0.0053129, 0.10045, -0.1164, 0.024356, -0.0012586, 0.050691, 6.7084e-05, 0.20191, -0.045181, 0.10144, 0.11705, -0.22633, 0.018469, -0.0013542, -0.12018, 0.016842, 0.052652, 0.083146, 0.05733, -0.040375, -0.11575, 0.11708, 0.069673, -0.13864, -0.079608, -0.022217, 0.033594, -0.11363, 0.1027, -0.24155, 0.018757, 0.27956, 0.039218, 0.073588, -0.044889, 0.13769, 0.0032477, 0.022429, -0.038466, 0.031155, -0.16442, 0.23625, -0.081428, -0.011107, -0.062666, -0.17075, 0.27269, 0.031157, -0.05547, -0.0069529, -0.053436, 0.42537, 0.018283, 0.13284, -0.015069, 0.10328, 0.44999, -0.0011929, -0.16087, -0.12774, -0.042099, -0.0018649, 0.24606, 0.074298, 6.9784e-05, -0.052136, -0.086745, -0.22499, -0.045345, 0.033108, 0.032026, -0.0537, 0.033624, -0.12434, -0.13435, -0.10102, -0.10334, -0.072744, 0.030026, -0.027686, 0.0035345, -0.059592, 0.031353, -0.031956, -0.18986, -0.066674, -0.030282, 0.015288, 0.01068, 0.044317, -0.0092002, 0.044711, 0.032936, -0.028902, -0.019832, -0.10833, 0.017001, -0.016581, -0.047452, 0.019644, -0.043525, 0.022794, -0.031968, -0.11913, -0.012952, -0.077946],
[-0.004218, -0.17785, 0.10345, 0.14692, 0.032856, 0.069906, -0.0063945, 0.012859, -0.031362, 0.048788, -0.21008, -0.14262, 0.27351, 0.13676, -0.29667, 0.13073, 0.052879, 0.20819, 0.054692, -0.070712, -0.0072303, -0.037876, 0.016205, 0.032611, -0.21237, 0.19488, -0.050184, -0.10106, -0.19452, -0.09757, 0.14803, -0.11936, 0.090357, 0.0059923, 0.025456, -0.019228, 0.084192, -0.10884, -0.1971, -0.084654, -0.086888, 0.36809, 0.10964, -0.064538, 0.015796, 0.037226, 0.043018, 0.11953, 0.10395, 0.045531, 0.054413, 0.24913, 0.0022231, -0.10581, 0.090088, 0.16662, -0.15731, -0.091249, -0.053758, 0.022179, 0.27116, 0.33867, 0.1404, -0.051937, 0.013903, -0.065676, -0.12826, 0.19223, 0.066177, 0.073804, 0.1457, 0.07116, -0.0095457, -0.1049, -0.081458, -0.078985, -0.11642, 0.022713, -0.040784, -0.0056623, 0.0036836, -0.06678, -0.12713, -0.15866, -0.063329, -0.05576, -0.037458, -0.022461, -0.022029, -0.011882, -0.046973, -0.14701, -0.037218, -0.082831, -0.0016296, -0.021759, 0.059907, -0.013177, 0.064519, -0.040907, -0.027245, -0.014615, 0.11053, 0.027445, 0.022162, 0.0024547, -0.016091, -0.058967, 0.021584, 0.032765, -0.17163, 0.038526, -0.1009, -0.082755, -0.12651, -0.031347, -0.051126, -0.088046, -0.0031872, -0.02711, -0.11431],
[-0.066924, 0.041699, -0.10386, 0.055675, -0.07426, -0.09119, -0.04579, -0.053409, 0.0016411, -0.010002, 0.021792, -0.051951, -0.070201, 0.09728, -0.15049, 0.1215, 0.015843, 0.01783, 0.028679, -0.13093, -0.0032724, -0.076393, 0.023828, -0.10049, 0.057648, 0.1477, -0.058573, 0.036566, -0.038113, -0.03595, 0.13215, -0.11751, -0.02731, -0.15554, 0.18384, 0.10898, -0.055055, 0.23295, 0.16692, 0.34351, -0.061819, -0.024812, 0.079963, -0.18727, 0.077134, 0.20555, -0.025109, -0.016911, 0.027522, -0.18467, -0.1287, 0.27051, -0.2357, 0.16007, 0.060773, -0.040057, 0.0061977, -0.21241, 0.22776, -0.2446, -0.1111, -0.32901, -0.065957, 0.38918, -0.037062, -0.013214, 0.11362, -0.13116, 0.26149, 0.1311, -0.025593, -0.1077, -0.029542, 0.21031, 0.20084, -0.15455, 0.098486, 0.053759, 0.082713, -0.24255, 0.025734, 0.17681, 0.23331, 0.27753, 0.17726, -0.16259, -0.17145, 0.083644, 0.016995, -0.071477, 0.074912, -0.075655, 0.021347, 0.12285, 0.031741, -0.079712, -0.010976, 0.020719, -0.14947, -0.059126, 0.025068, -0.076954, 0.0107, -0.035726, 0.010453, -0.020801, -0.10029, -0.053471, -0.048791, -0.043407, -0.10411, -0.0096116, -0.040122, -0.046812, -0.064058, -0.14541, -0.07568, -0.032467, 0.0079791, -0.075814, 0.020303],
[-7.0957e-06, -0.095051, -0.087882, 0.0047062, -0.098027, -0.0027617, -0.097227, -0.063001, 0.11834, 0.054457, -0.0099414, -0.070139, 0.058249, 0.032891, -0.077909, 0.12061, 0.041917, -0.12019, 0.024991, -0.15611, 0.027447, 0.0061692, 0.22278, 0.077772, 0.15814, -0.017009, -0.14312, 0.17959, 0.051526, -0.11409, 0.0087348, -0.11632, 0.014926, 0.035969, -0.053626, -0.023997, 0.19965, 0.036097, -0.049211, 0.12246, 0.060611, -0.095797, -0.069519, -0.05025, -0.0058375, -0.012563, -0.1478, 0.031772, 0.13403, -0.15157, 0.12631, -0.005289, -0.0019668, 0.05403, -0.063631, -0.3492, 0.086316, 0.14981, -0.019588, 0.12206, -0.19934, -0.048029, 0.052601, 0.038693, -0.093007, -0.025563, 0.17735, 0.22164, 0.094681, 0.037985, 0.0088876, 0.33249, 0.16505, -0.0078676, -0.0040894, -0.073882, -0.023509, 0.3813, -0.019292, -0.086843, -0.040173, -0.046443, -0.10186, 0.16439, 0.0026682, 0.076749, -0.067948, -0.0010387, -0.10714, -0.030577, 0.032786, -0.0055511, 0.020069, -0.01711, -0.14366, -0.016712, -0.069886, 0.01136, 0.0048981, -0.071131, -0.065545, -0.079795, -0.069728, 0.057019, -0.021993, 0.015178, -0.00020471, -0.025514, -0.026883, -0.045298, -0.15833, -0.031429, -0.0062888, -0.0057808, -0.087719, -0.014851, -0.09857, -0.11786, -0.058162, 0.025496, -0.027501],
[0.033386, 0.029449, 0.050373, 0.03376, 0.043978, 0.08318, 0.071687, 0.026806, -0.040213, 0.074456, -0.015557, -0.005235, -0.019242, 0.055812, -0.061556, 0.022157, -0.0375, -0.091842, 0.0021346, -0.077528, -0.07034, -0.021844, -0.028323, 0.00011165, -0.063044, 0.031228, -0.027815, -0.023586, 0.014275, -0.0099113, -0.039422, -0.036125, -0.14335, -0.030906, 0.026457, -0.055732, -0.099791, -0.113, -0.096702, -0.14135, -0.095762, 0.012997, 0.061453, -0.10846, -0.095955, -0.026482, -0.093422, 0.025975, 0.048412, 0.13855, 0.0089878, 0.14129, 0.018874, 0.0068619, 0.066029, -0.069577, -0.13631, 0.053261, 0.17933, 0.20451, 0.25418, 0.42794, 0.080448, 0.060808, 0.050979, 0.068725, -0.079585, 0.16947, 0.07175, -0.17603, -0.2061, -0.27585, -0.45996, 0.041977, 0.14013, -0.10129, 0.042032, 0.0010701, 0.03327, 0.045261, 0.18493, 0.11251, 0.079146, 0.27604, -0.29337, -0.032405, 0.24483, -0.1173, -0.00039308, -0.082855, 0.14722, -0.050887, -0.11314, -0.045972, -0.12976, 0.36521, -0.091822, 0.085864, 0.076513, 0.10292, 0.0027326, 0.070587, 0.10534, 0.11196, -0.072148, 0.049586, -0.031051, 0.14407, -0.085588, 0.087229, -0.17191, -0.11561, -0.092875, 0.029309, 0.039975, 0.12186, 0.10737, -0.039137, -0.080754, -0.053377, -0.1975],
[-0.078857, 0.02861, 0.028066, -0.021834, -0.071732, 0.041944, 0.0034421, 0.099852, -0.072054, -0.14404, -0.099453, 0.030831, 0.029895, 0.0015406, 0.050637, -0.061536, 0.022595, 0.058299, -0.21505, -0.10742, 0.13531, 0.12926, -0.023229, 0.081512, 0.00055799, -0.098024, -0.066934, 0.030281, -0.19701, -0.074522, 0.29428, -0.019357, 0.097886, 0.08682, -0.043231, -0.018464, 0.062745, 0.0092971, -0.24864, 0.010777, 0.23163, -0.08533, -0.11445, 0.083801, 0.075831, -0.014033, 0.049485, -0.021591, 0.015442, 0.086162, -0.044103, 0.12334, 0.073164, 0.10887, -0.15317, -0.078737, -0.017285, -0.039704, -0.056906, 0.1866, -0.023527, 0.0097119, -0.11069, -0.0033322, 0.22171, -0.14381, -0.044159, 0.056899, -0.062536, -0.096716, -0.042463, 0.33605, 0.12772, 0.029306, 0.052961, 0.018388, 0.58364, 0.07837, -0.14774, 0.079311, -0.13568, 0.033726, -0.19372, -0.048923, -0.079048, -0.093458, 0.0084688, 0.024467, 0.024073, 0.045654, -0.049521, 0.11131, -0.082672, -0.012817, -0.058436, -0.090027, -0.061292, -0.12267, -0.10084, -0.038686, -0.034858, -0.00069532, -0.05712, 0.065895, 0.076844, -0.0099222, 0.038383, -0.0018487, -0.035019, -0.16441, -0.082791, -0.066047, -0.081933, -0.010547, -0.051038, -0.025579, 0.0095973, 0.0049533, -0.061063, 0.033454, -0.12571],
[-0.079439, -0.097075, 0.069014, -0.074506, 0.075012, 0.15666, -0.081194, 0.092119, 0.16895, -0.064301, -0.1065, -0.20662, 0.14032, -0.1386, 0.15068, 0.081866, -0.014125, 0.15934, -0.056123, -0.14962, 0.26418, 0.00014355, -0.0073547, 0.079307, 0.020929, -0.10994, -0.17371, -0.023791, -0.086918, -0.004335, -0.085955, -0.029421, -0.00905, 0.041531, -0.069424, 0.24688, 0.20546, -0.17599, -0.24389, -0.19015, 0.22071, 0.077211, 0.014425, 0.0067033, 0.14558, -0.10028, -0.046264, 0.17807, 0.23207, 0.068919, 0.13997, 0.088433, -0.06619, 0.039955, 0.044429, -0.081011, 0.068411, -0.048059, -0.0052523, 0.19319, 0.2292, 0.086101, 0.031256, -0.01777, -0.081515, 0.052572, 0.0065147, -0.17665, -0.019857, 0.081102, 0.043278, 0.11772, 0.11137, -0.00073262, 0.091978, 0.082389, 0.034023, -0.053098, 0.099288, -0.10855, -0.17742, -0.17887, -0.14115, -0.064005, -0.053085, -0.0016597, -0.070677, -0.098804, -0.055945, -0.0052752, 0.032008, 0.05763, -0.01971, -0.057824, -0.068257, 0.027891, -0.076656, -0.023632, 0.019706, 0.06278, 0.0043081, -0.0068539, -0.069585, 0.056699, 0.042173, -0.025984, -0.033098, 0.0095922, 0.041801, -0.050819, -0.1069, -0.015848, -0.060765, -0.0062175, -0.085347, -0.097475, -0.059282, -0.035577, -0.075014, -0.060536, -0.11818],
[-0.024906, -0.002084, 0.036006, 0.040388, 0.0046368, -0.050097, -0.019439, -0.099398, -0.039682, -0.0028158, 0.0035982, -0.054099, 0.098752, -0.13208, -0.18035, -0.0043732, 0.052329, -0.043358, 0.17087, -0.087789, -0.04498, -0.031635, 0.070377, -0.22835, -0.053229, 0.20062, -0.010254, 0.015916, 0.11152, -0.12243, 0.20444, -0.11371, -0.079914, -0.15288, 0.01301, 0.24934, -0.15784, 0.14724, 0.12654, 0.087845, 0.15842, 0.04809, 0.30801, -0.11761, -0.098389, 0.21454, -0.14234, -0.0057875, 0.14715, 0.037047, -0.050841, 0.14409, -0.20385, 0.12419, 0.16468, 0.012861, -0.06026, 0.07515, 0.32707, -0.4003, -0.26936, -0.27608, -0.11368, 0.18759, -0.1163, 0.01136, 0.091042, -0.02393, 0.027146, 0.26868, -0.040944, -0.051185, -0.062555, 0.14722, 0.17279, -0.045587, 0.040778, 0.077307, -0.045918, -0.14679, 0.058857, 0.30473, 0.26833, 0.20924, 0.21225, -0.22492, -0.10536, 0.1013, -0.0587, -0.056962, -0.053785, -0.064199, -0.023276, 0.14635, 0.17298, -0.1728, -0.028271, 0.054369, -0.10107, -0.14024, 0.018314, -0.037984, -0.065302, -0.01295, -0.094604, -0.11534, 0.0076675, 0.066322, -0.050401, 0.007422, 0.02887, -0.01598, 0.0047547, -0.023242, -0.10363, -0.080832, -0.038314, -0.08684, -0.01954, 0.031333, -0.15194],
[0.2663, 0.030128, -0.11791, -0.11737, -0.062861, -0.096766, -0.082199, -0.08602, -0.075247, -0.029807, 0.24281, 0.067042, -0.0073446, 0.019074, 0.024028, -0.022037, -0.041361, -0.021552, -0.020935, 0.0016784, 0.044654, 0.04733, 0.070321, 0.0049339, 0.068284, 0.0027796, -0.04669, -0.055778, -0.053408, -0.00010746, 0.053647, 0.01417, 0.029054, 0.023032, 0.00066727, -0.00051463, 0.0056491, -0.0020259, -0.016498, -0.022443, -0.035029, 0.063846, 0.044687, 0.058668, -0.045157, 0.060419, 0.040369, 0.099232, 0.048066, -0.046325, -0.00080888, 0.11409, -0.00033137, 0.037356, -0.0079674, -0.049741, 0.13611, 0.023766, 0.053498, 0.015733, -0.063825, 0.033331, 0.027844, 0.081692, 0.097146, -0.064828, 0.014374, -0.047331, 0.044197, 0.1063, 0.073543, -0.044426, 0.049684, 0.068365, 0.081523, -0.015087, -0.0019638, 0.039052, -0.017851, 0.023708, 0.062011, 0.073784, -0.091845, 0.010697, 0.086037, 0.094596, -0.074055, 0.027916, -0.037642, -0.040193, 0.0024469, 0.1275, 0.0093404, -0.040375, -0.090115, 0.10326, 0.029177, -0.0077046, -0.030227, -0.026938, 0.032996, 0.037655, 0.060384, -0.011607, -0.088459, -0.0089621, 0.041335, 0.025265, 0.032067, 0.02383, -0.079346, -0.11618, 0.035621, 0.10014, -0.048809, -0.11447, -0.095813, 0.016306, 0.11708, -0.0632, -0.16223],
[0.056794, 0.10168, -0.016504, 0.0046764, -0.015979, -0.04792, -0.055022, -0.10379, -0.049718, 0.10568, -0.031174, 0.083705, -0.091368, 0.057269, 0.018685, -0.032113, -0.001737, -0.07208, -0.099356, -0.024667, 0.086176, 0.04004, -0.15099, -0.00067872, -0.015247, -0.052524, 0.042551, -0.14444, -0.0065487, -0.071843, -0.01285, 0.014123, -0.0033943, -0.03964, -0.0031248, -0.045858, 0.0019021, -0.12416, 0.073896, -0.045016, -0.042377, -0.018876, 0.0662, -0.038229, -0.081068, -0.039458, -0.021574, -0.087538, 0.033366, 0.13641, -0.063205, -0.0012659, 0.0057983, -0.011527, -0.0079257, -0.14126, -0.034965, -0.054177, 0.098663, 0.31744, 0.039452, -0.12302, 0.090308, -0.018427, 0.007607, -0.063786, -0.13635, 0.021706, 0.088489, 0.24007, -0.038574, -0.20904, -0.028548, 0.088543, -0.021391, 0.044285, -0.026993, -0.064466, 0.12945, 0.19089, -0.03048, -0.11057, -0.030936, 0.11335, -0.035129, -0.086018, -0.0072169, -0.10753, 0.043123, 0.16933, 0.040455, -0.23665, 0.11812, 0.07594, -0.10352, -0.030301, 0.086878, 0.020132, -0.023337, 0.19293, 0.022201, -0.099101, 0.1551, 0.063728, -0.25368, -0.11399, -0.060714, 0.014445, -0.078061, 0.019868, 0.0081798, -0.058442, -0.12525, -0.04273, -0.10579, 0.082762, 0.22611, 0.19472, 0.13771, 0.25213, 0.073498],
[-0.091381, -0.05808, -0.076531, -0.019935, -0.11699, -0.049621, -0.077133, 0.15067, -0.050781, -0.020686, -0.077499, -0.096759, 0.0077572, -0.0095979, -0.099566, 0.00516, -0.052062, 0.21008, 0.065151, -0.071318, 0.018812, -0.00086442, -0.046564, 0.013464, -0.04976, -0.07512, -0.016206, 0.20371, 0.21632, -0.2164, -0.010174, -0.080744, 0.00065763, -0.10941, 0.005192, -0.061527, -0.018847, 0.21787, 0.22243, -0.15575, -0.10816, 0.0051882, 0.031786, -0.1182, -0.091955, -0.065886, 0.045741, 0.16229, 0.1837, -0.081324, -0.096899, 0.11221, -0.12652, -0.056954, 0.0037198, -0.040599, 0.0393, 0.11791, 0.0326, -0.021777, -0.040529, 0.018542, -0.085733, -0.0042515, 0.031088, 0.10947, -0.03052, 0.024589, 0.031028, -0.026059, -0.03474, 0.042016, -0.15814, 0.098811, 0.17665, 0.1206, 0.28366, -0.0098819, 0.02072, 0.041373, -0.021038, -0.095203, 0.14911, -0.025722, -0.1282, -0.023631, -0.031597, 0.10824, -0.091173, 0.063567, 0.021728, -0.10569, -0.031654, -0.0087472, 0.14636, 0.13717, 0.040902, -0.017771, 0.03856, 0.039245, 0.056815, -0.11184, 0.064818, -0.081432, -0.034074, -0.11203, 0.15241, 0.13534, 0.068634, -0.036633, -0.046693, -0.033281, 0.0071095, -0.024377, -0.086464, -0.048462, -0.085872, -0.17119, -0.12548, -0.10026, -0.067724],
[-0.11049, 0.1773, 0.16552, 0.034404, -0.089589, -0.0098957, -0.09267, -0.062034, -0.13028, -0.027741, -0.033783, 0.068486, 0.07599, -0.036571, -0.027073, 0.051359, -0.12487, -0.11938, 0.0002767, 0.039243, -0.065342, -0.032591, 0.0094874, 0.077229, -0.11979, 0.065176, -0.0045331, -0.093211, 0.2083, 0.034408, 0.20901, 0.1806, 0.080546, 0.011692, -0.10363, 0.08944, -0.1829, -0.17449, 0.20464, 0.16205, 0.12484, -0.033921, 0.0050539, 0.011335, -0.0018538, -0.13334, 0.13244, 0.13163, -0.09595, -0.14906, -0.13717, 0.078007, 0.22398, 0.060077, 0.080459, -0.044227, -0.026417, -0.021047, -0.022108, 0.27081, 0.20244, 0.052508, -0.081687, -0.028, -0.069004, -0.019947, -0.065109, 0.087305, -0.077077, -0.18137, -0.11404, 0.13449, 0.23245, 0.055125, -0.066464, -0.091452, 0.018849, -0.024654, -0.024966, -0.091425, 0.072528, -0.065216, -0.11922, -0.17338, -0.057219, 0.0067423, 0.011249, 0.068048, 0.049615, -0.097276, 0.0082359, -0.015023, -0.053933, 0.022182, -0.078603, -0.09699, 0.053342, 0.038593, 0.073274, -0.0027339, 0.0087236, -0.056655, 0.0089929, -0.047992, -0.07247, 0.013557, -0.0027079, -0.020809, -0.023686, -0.082885, -0.024582, 0.011676, 0.010269, 0.00027727, -0.10403, -0.031329, -0.048763, 0.01387, 0.0097769, -0.0016097, -0.11085],
[-0.30333, -0.098154, 0.0015411, 0.045929, -0.065356, -0.13987, -0.083089, 0.082669, 0.061905, -0.11069, -0.2829, 0.22673, 0.18594, 0.071854, -0.030529, 0.028577, 0.031061, -0.043862, -0.044105, 0.02216, 0.21655, 0.30278, 0.012214, 0.086127, 0.18984, 0.17497, -0.084862, -0.081457, 0.018326, 0.13673, 0.27284, 0.094612, -0.07614, 0.062933, -0.097444, -0.068404, 0.0096656, 0.095041, 0.15937, 0.072995, 0.031253, -0.16547, -0.16678, 0.1267, 0.22205, 0.18736, -0.037622, -0.15711, -0.17299, -0.082555, -0.14455, -0.22415, 0.042542, 0.10381, 0.20625, -0.15881, -0.075659, -0.021486, 0.10892, 0.091093, -0.010417, 0.069544, 0.16543, 0.065217, -0.014818, -0.20522, -0.14265, 0.019756, 0.0058041, 0.039643, 0.15659, 0.22865, 0.14255, 0.057073, -0.053152, -0.034477, -0.077598, -0.066726, -0.06423, -0.089991, 0.02829, -0.066129, -0.11896, -0.082558, 0.012811, -0.024384, 0.015088, -0.13601, -0.075237, 0.039014, 0.028154, -0.055014, -0.0082541, 0.0026559, -0.021125, -0.023747, -0.042683, -0.059496, -0.019043, -0.12936, -0.026222, -0.025813, -0.041704, -0.066191, -0.097506, -0.058396, -0.089961, -0.0037007, 0.001118, -0.1009, 0.06414, 0.010238, 0.064404, 0.076685, 0.039151, -0.025803, -0.00019836, 0.071841, 0.13125, 0.046057, 0.053499],
[-0.12966, -0.03758, -0.06761, -0.10397, -0.050147, -0.11662, -0.013409, -0.0038121, 0.14552, 0.20961, -0.11573, 0.0382, 0.053737, -0.03378, -0.013778, -0.12296, -0.19078, 0.063623, 0.07272, -0.18712, 0.13565, 0.10042, 0.066387, 0.075875, 0.10518, 0.14542, 0.12359, -0.033751, -0.11681, 0.047363, -0.078115, -0.0068073, 0.022331, 0.043345, 0.0061773, 0.10019, 0.12543, 0.29106, 0.15951, -0.041017, -0.24665, 0.10244, -0.022249, -0.039981, -0.054513, 0.10149, 0.12491, 0.024443, -0.17156, 0.0098209, -0.099464, 0.10893, 0.10795, -0.030383, -0.052094, 0.081082, -0.096274, -0.036267, 0.075185, 0.096808, 0.020286, 0.33291, 0.017339, -0.16522, -0.0040897, -0.051775, 0.06567, -0.032773, -0.085059, -0.1193, 0.092456, 0.25655, -0.13119, -0.099868, -0.033239, -0.014474, 0.022015, -0.0068706, 0.030439, 0.038215, -9.8671e-06, -0.13107, -0.1103, -0.056513, -0.035091, -0.021025, -0.037797, 0.0024114, 0.066873, 0.062798, 0.01586, -0.066418, -0.044395, -0.056739, -0.074491, -0.0017445, -0.0018562, -0.031297, -0.080379, -0.032933, -0.039466, 0.026869, 0.05272, 0.017821, -0.081279, -0.0098243, -0.035827, -0.018665, -0.030415, -0.025398, -0.127, -0.05127, -0.059493, -0.012978, -0.040201, -0.0063003, -0.059572, -0.060873, 0.025501, 0.056765, 0.012716],
[-0.053343, 0.0052457, -0.047375, 0.094781, -0.040977, -0.096553, -0.074882, -0.046658, -0.091331, -0.040718, -0.093077, 0.0037318, 0.001298, -0.072971, 0.057699, 0.21678, 0.062692, -0.04409, -0.02313, -0.021606, -0.016754, -0.089115, -0.018012, -0.048665, -0.038883, -0.16008, 0.12324, 0.16214, 0.081891, -0.026691, -0.078939, -0.035178, -0.070559, -0.08145, 0.041254, -0.0082409, -0.064104, -0.19223, 0.19699, 0.075458, 0.10168, -0.011408, -0.027454, -0.096909, -0.027763, -0.099432, -0.065805, 0.0079576, -0.031079, -0.025255, 0.13286, 0.10025, 0.065637, -0.003144, -0.044384, 0.055436, 0.059891, -0.0098526, -0.15355, 0.17006, -0.18443, 0.068014, 0.029876, 0.108, 0.085618, -0.10414, 0.24465, 0.10562, 0.15464, 0.11487, -0.16275, -0.101, 0.095139, -0.10761, 0.017873, 0.11424, -0.0018412, 0.086874, 0.16367, 0.044733, -0.094762, -0.14398, 0.21757, -0.034529, -0.12834, 0.039442, 0.052147, -0.0027754, 0.092487, -0.10001, 0.021968, 0.076096, 0.26484, -0.068779, -0.13151, 0.0011599, -0.068093, -0.027604, 0.0055121, -0.074849, 0.031134, 0.10058, 0.16474, -0.021659, -0.084825, -0.016801, 0.022993, 0.017167, -0.056374, -0.032324, -0.018054, -0.050024, -0.1409, -0.13965, -0.1187, -0.062036, -0.041018, -0.050867, -0.058573, 0.021581, -0.042699],
[0.019903, 0.15562, -0.028017, -0.17651, -0.039198, -0.060229, 0.040414, 0.0039325, 0.035475, 0.086187, 0.066211, -0.011483, 0.021711, 0.011538, -0.031843, -0.084914, -0.023265, -0.11448, 0.039181, -0.056999, -0.064777, 0.063734, -0.043075, 0.056384, 0.025731, -0.10729, -0.043118, -0.053658, 0.015845, 0.013291, 0.0102, -0.0031794, -0.11412, 0.030884, 0.021462, 0.03497, -0.079456, -0.085032, 0.11503, -0.10994, -0.089573, -0.0039431, -0.045788, -0.029069, -0.029313, -0.0022282, -0.015461, 0.080169, -0.096417, 0.06817, 0.14489, -0.02062, -0.12128, 0.0035403, -0.1086, -0.025759, -0.015908, -0.019318, 0.027712, -0.010692, -0.11262, 0.22919, 0.19547, 0.062577, -0.032438, -0.17049, -0.054888, -0.0086607, -0.03247, 0.050118, 0.03841, -0.15182, -0.17239, 0.178, 0.15775, 0.11239, -0.1155, -0.10514, 0.029627, 0.010047, -0.035952, 0.015687, 0.10711, -0.041276, -0.23138, 0.10814, 0.20399, -0.014741, -0.062683, -0.049411, -0.035968, 0.041871, -0.072185, -0.083864, 0.098734, 0.11032, -0.22003, 0.1278, 0.14219, -0.0011896, 0.079367, 0.043589, -0.035425, -0.054609, -0.16493, -0.17557, 0.15889, 0.0041503, -0.10135, 0.19024, 0.08466, 0.1151, 0.16224, 0.17764, 0.22134, 0.14596, 0.028871, -0.10379, -0.067206, -0.088716, -0.041102],
[0.1592, 0.060407, 0.058122, 0.0047701, 0.019787, 0.087204, 0.030264, 0.017305, 0.085575, 0.023959, 0.12885, 0.0686, -0.045567, 0.06496, -0.057218, -0.025448, 0.090949, -0.079769, 0.036731, -0.03848, 0.0060765, 0.062316, 0.002068, 0.006558, -0.0043518, 0.009629, 0.029116, 0.014264, 0.02969, -0.081627, 0.046851, 0.0062149, 0.018397, -0.012562, -0.040552, 0.028504, -0.011487, -0.059191, 0.022429, 0.078039, -0.015416, 0.019965, -0.066504, -0.0013193, -0.10842, -0.036973, -0.020534, 0.040748, 0.053337, -0.0011671, -0.0095602, 0.016299, 0.0077278, 0.00037444, -0.19228, -0.13238, -0.030125, -0.015888, 0.025014, 0.027519, 0.024199, -0.047761, 0.12256, -0.055852, 0.065026, -0.12853, -0.059058, -0.032314, -0.050141, 0.080141, 0.035776, -0.052897, 0.0028742, 0.082628, -0.021869, -0.069854, -0.068576, -0.064585, -0.0069314, -0.063836, 0.065184, 0.08558, -0.089783, 0.024132, 0.12237, -0.0081031, -0.10893, -0.041048, -0.040486, -0.018772, 0.024153, 0.10036, 0.06874, -0.10245, -0.016349, 0.007038, 0.12266, -0.043113, 0.01337, 0.016729, -0.039289, 0.057728, 0.041013, -0.049979, -0.032348, -0.088175, 0.09987, 0.0656, -0.01536, -0.028529, -0.037199, 0.15245, 0.18336, 0.054288, -0.046369, -0.11191, -0.11519, -0.022732, 0.11225, 0.2856, -0.067985],
[0.058959, -0.021876, 0.037612, -0.099005, -0.11655, 0.021079, 0.015957, 0.059648, -0.065506, -0.083395, -0.18214, 0.084305, -0.025711, -0.0014531, 0.062922, 0.010829, 0.077505, -0.066208, -0.055003, -0.061511, 0.0689, -0.055539, -0.020785, 0.089398, 0.12883, -0.12817, -0.0096792, -0.11505, 0.073196, 0.013391, 0.063157, -0.11664, -0.087677, 0.064069, 0.089552, -0.012366, -0.084842, -0.30993, -0.31591, -0.19715, 0.020969, 0.14194, 0.061843, 0.073936, -0.013043, -0.074977, -0.20604, -0.070946, 0.28309, 0.57742, 0.31262, -0.083662, -0.0039167, -0.0070082, 0.040088, -0.049395, -0.029191, -0.081164, 0.19269, 0.21145, -0.29773, 0.12406, 0.36605, 0.093082, -0.024581, 0.10111, -0.062911, -0.0034613, 0.029116, 0.0020626, 0.10964, 0.064159, -0.21854, -0.12925, -0.079675, -0.018112, 0.035958, -0.046726, -0.06093, 0.011191, 0.023534, 0.072568, 0.23271, 0.3317, -0.057956, -0.12546, -0.039267, -0.056155, -0.046609, 0.060499, -0.043017, 0.024842, -0.099368, -0.16432, -0.15146, -0.0017544, 0.17032, 0.064868, 0.15234, -0.032911, -0.0071732, -0.0081381, -0.050724, 0.011173, -0.062102, -0.052309, 0.00051655, -0.0075192, 0.039092, 0.071466, 0.006336, -0.09563, -0.025392, -0.10042, -0.097928, -0.027282, -0.038112, 0.012061, -0.035597, -0.052822, -0.11313],
[-0.15324, -0.061966, -0.020865, -0.00042811, 0.073055, -0.061348, -0.031466, -0.10328, 0.057558, 0.011198, 0.045234, -0.064711, -0.067011, -0.0057205, -0.028643, -0.037131, 0.053749, -0.054199, 0.021887, 0.01619, -0.019017, 0.1138, -0.11165, -0.0087496, -0.014474, -0.026252, -0.0027102, -0.03099, -0.041275, -0.11453, 0.047907, 0.038422, 0.015083, 0.02877, 0.016845, 0.094727, 0.20594, -0.1516, -0.24555, -0.27708, -0.18049, -0.011308, 0.11441, -0.014636, 0.079198, 0.012007, 0.0072429, -0.1864, 0.16781, 0.56826, 0.34086, 0.15391, -0.22202, -0.093194, -0.0050051, 0.080167, -0.0010856, 0.033973, 0.29561, 0.36483, -0.31466, 0.062497, 0.21969, -0.026684, -0.054686, -0.15194, 0.054278, 0.074098, 0.0050038, -0.11139, -0.29694, -0.0028084, 0.085921, 0.054283, 0.04116, -0.040069, 0.020584, -0.032968, -0.124, -0.1269, -0.087864, 0.25943, 0.25469, 0.11149, 0.016197, -0.035512, 0.062529, -0.061876, 0.042654, 0.14569, 0.10027, 0.049106, -0.16921, -0.15021, -0.036438, -0.094175, 0.052143, -0.024438, -0.043904, 0.097322, 0.025963, 0.044958, 0.015316, 0.028567, -0.099805, -0.056575, -0.0025488, -0.066924, 0.010194, -0.0061766, -0.10526, -0.064591, -0.0082274, -0.028938, -0.0021874, 0.0064021, -0.082474, -0.10584, -0.016047, -0.065096, -0.076611],
[-0.039511, -0.0080173, -0.016552, 0.075617, -0.029722, -0.025035, -0.072171, -0.092474, -0.075212, -0.04436, -0.069349, -0.022491, -0.0057147, 0.052051, -0.054608, -0.058373, -0.060777, -0.077337, -0.045477, 0.030773, -0.11621, 0.10798, -0.027779, 0.042776, -0.029085, 0.070665, -0.1067, -0.12973, -0.061185, 0.022941, -0.011978, 0.16487, -0.048341, -0.026936, -0.048056, 0.032474, -0.13513, -0.11295, 0.028315, 0.10779, 0.13719, 0.094828, -0.029662, 0.13211, -0.11093, 0.029167, -0.065793, -0.082565, 0.024708, 0.22294, 0.23882, 0.084903, 0.040208, 0.076546, -0.061238, 0.0063284, -0.051374, 0.062827, -0.036988, 0.22359, 0.048437, -0.25353, -0.19261, -0.019422, -0.062848, -0.036853, -0.12965, 0.044459, -0.12227, -0.075999, -0.066285, 0.28526, 0.39167, 0.21584, -0.00059672, 0.028282, 0.1415, 0.029358, -0.0073653, -0.018182, 0.0045057, -0.11281, -0.12216, -0.045822, 0.027683, 0.044114, 0.01296, -0.01033, 0.017525, -0.026815, -0.038434, -0.023176, 0.018238, -0.10609, -0.0078365, -0.16927, 0.05523, -0.038599, -0.030083, 0.033499, 0.064549, -0.054456, -0.00056162, -0.12306, -0.052312, -0.006256, 0.066659, -0.083661, -0.0050757, -0.053946, -0.00027041, -0.029193, 0.060243, -0.018407, -0.03151, -0.023054, -0.14523, -0.083398, 0.0083801, -0.054527, 0.0051809],
[-0.065849, -0.053261, 0.035474, -0.043773, -0.042949, -0.03584, -0.03671, -0.03589, 0.0084303, 0.07096, -0.039991, 0.0006292, 0.023016, -0.012094, 0.023508, -0.0043853, -0.017755, -0.098393, -0.025599, -0.093254, -0.060085, -0.0067733, 0.0047322, 0.0098855, -0.0079343, -0.048435, -0.01181, -0.044468, 0.029162, -0.052373, -0.012794, -0.074, -0.11229, 0.00053719, 0.054814, -0.058612, 0.031705, -0.0076502, -0.10569, -0.19589, -0.12316, -0.011443, 0.11926, 0.0010364, -0.099823, -0.010169, -0.077188, -0.066005, -0.28363, -0.0933, 0.035262, 0.13156, 0.091981, -0.0081161, 0.12425, -0.04316, -0.010051, -0.025512, -0.0548, 0.020004, 0.31672, 0.27826, 0.1379, 0.048834, -0.033553, -0.043105, -0.046987, -0.0079366, 0.048609, 0.09188, 0.23511, 0.016599, -0.12372, -0.063235, -0.08997, 0.010187, 0.072231, 0.013954, 0.061917, -0.043803, 0.043711, 0.034238, -0.14965, -0.021063, -0.0065215, 0.10037, 0.025703, -0.023339, 0.039961, -0.062023, 0.019839, 0.12567, -0.12436, 0.051042, 0.053957, -0.016946, 0.043321, 0.038185, 0.067065, -0.092508, 0.13191, 0.078819, -0.087287, 0.13682, 0.022366, -0.0032544, 0.11493, -0.070293, -0.0097662, 0.07912, -0.13763, -0.026908, -0.12733, 0.086009, 0.01195, -0.0089316, -0.049144, -0.044693, 0.017728, 0.012377, -0.085355],
[-0.15926, 0.084897, 0.010353, 0.024131, -0.0099025, 0.016913, 0.073092, 0.08237, 0.0043022, 0.083855, 0.032979, -0.034178, -0.029839, -0.10512, -0.0089746, 0.036814, -0.020708, -0.010091, -0.072879, -0.0016778, -0.076743, 0.036399, -0.022292, -0.079821, -0.03117, -0.02395, -0.090007, 0.049464, -0.011624, -0.01219, -0.038313, -0.013831, -0.049168, -0.08738, 0.036253, -0.13555, 0.023838, 0.050095, -0.053272, -0.085012, 0.0061676, 0.0016709, -0.013993, -0.062743, -0.056305, -0.080727, -0.04239, -0.14777, -0.097021, -0.070734, -0.015527, -0.22588, -0.12301, -0.11675, -0.16926, -0.11924, -0.012361, -0.053243, 0.030546, 0.11824, 0.18358, 0.16423, 0.1323, -0.066627, 0.034499, 0.23003, -0.10642, 0.095721, 0.18784, 0.11359, 0.025588, -0.06744, -0.047658, 0.10205, 0.3059, 0.12074, -0.019907, 0.079053, 0.091497, 0.053535, -0.0018597, -0.036332, -0.067753, -0.038232, 0.0085334, -0.16437, -0.041481, -0.024498, 0.10684, 0.011813, -0.11759, -0.012837, 0.0010457, 0.072147, 0.12615, -0.055282, -0.0069995, 0.060201, 0.019191, -0.00068959, -0.015095, 0.082565, 0.029353, 0.020528, -0.031246, -0.059333, 0.096753, 0.03723, 0.025529, 0.056861, -0.023451, -0.023607, 0.019542, 0.019438, 0.044548, 0.038281, 0.061662, -0.088155, 0.079304, -0.051664, 0.077758],
[-0.061708, 0.04717, 0.012297, 0.0048086, 0.089273, 0.0323, 0.0099211, 0.077315, 0.007219, -0.0057896, -0.027111, -0.13989, -0.056493, 0.043741, -0.0011463, -0.087114, -0.049879, -0.044601, 0.037027, -0.019658, 0.0018227, -0.13718, -0.023654, 0.023929, -0.06122, -0.029673, 0.020848, 0.078336, -0.040876, -0.039874, -0.055584, 0.080912, -0.15786, -0.10649, -0.1323, -0.04331, -0.10794, -0.087527, -0.10889, -0.0942, -0.068306, -0.044226, -0.13935, -0.17046, -0.21417, 0.055183, 0.11437, 0.20663, -0.10572, -0.17195, -0.070754, 0.056465, 0.14099, 0.19461, -0.08266, 0.18248, 0.11507, -0.012084, 0.071742, 0.19215, 0.19213, 0.17145, 0.15448, -0.010182, -0.075106, 0.17627, 0.07293, -0.085363, -0.10189, -0.093911, 0.0033217, -0.0056859, 0.010933, -0.12951, -0.046961, 0.0032455, -0.0090718, 0.0068371, 0.052015, 0.018357, 0.01267, -0.074411, -0.063974, -0.029665, 0.058059, -0.018533, 0.010602, 0.081067, 0.020393, -0.022919, 0.12127, 0.0071001, 0.12313, 0.13042, 0.046877, 0.042704, 0.068078, 0.046054, -0.0067836, 0.045065, 0.032495, -0.043798, 0.039504, -0.050502, -0.029414, -0.072356, 0.010415, -0.037595, -0.024336, 0.025902, -0.0063118, 0.028123, 0.027432, 0.008822, 0.01083, 0.021828, 0.043521, 0.0035936, 0.056884, 0.040877, 0.015957],
[-0.0083507, 0.061639, 0.063043, -0.015296, 0.10245, 0.0039986, 0.077652, 0.030021, -0.021836, 0.056397, -0.15007, 0.010033, 0.0050164, -0.018546, 0.015951, -0.0011365, 0.011707, -0.058604, 0.0015384, -0.092476, -0.06129, -0.064372, -0.036227, -0.027816, -0.024541, -0.036651, 0.017808, -0.13331, 0.093825, -0.063647, -0.050293, 0.040498, -0.093307, -0.051282, -0.013633, 0.0051773, 0.028088, -0.069494, 0.02917, -0.065715, -0.00958, -0.0075632, -0.046689, -0.036037, -0.16326, -0.06809, -0.090402, -0.18958, -0.10039, -0.08141, -0.053688, -0.1623, -0.053231, -0.075002, -0.12647, 0.18341, 0.016324, -0.095199, 0.046462, 0.13805, 0.26953, 0.10024, 0.053013, 0.043485, -0.012146, -0.056649, 0.022123, 0.14925, 0.20113, 0.15088, 0.08159, -0.0944, -0.001998, 0.10065, 0.14323, 0.13389, -0.013346, -0.027656, -0.098837, -0.015846, -0.029293, -0.12585, -0.076534, -0.025134, -0.078349, -0.025744, 0.038564, 0.084352, 0.034972, 0.021598, -0.0096451, -0.024148, 0.035439, 0.094839, 0.013834, 0.047416, -0.052763, 0.099287, -0.042716, 0.065424, 0.012165, 0.048081, 0.046868, 0.043736, 0.033547, -0.046382, 0.062765, 0.024133, -0.097569, 0.13229, 0.04396, 0.0069924, 0.029835, -0.028421, -0.042759, 0.05049, 0.050638, 0.044202, 0.015928, 0.050284, -0.094579],
[-0.0093002, 0.066421, -0.057988, 0.030468, -0.088943, -0.014873, -0.06903, -0.059773, -0.02475, 0.076981, -0.11219, -0.00026099, -0.10643, 0.046966, -0.10537, -0.073429, -0.017259, -0.0097549, 0.028937, 0.05832, -0.10852, 0.0093034, 0.0032395, -0.11758, -0.030717, -0.012968, -0.072433, -0.029515, -0.030307, -0.010562, 0.00059348, 0.045902, 0.0099592, -0.14727, 0.10666, -0.058289, -0.081332, -0.10523, -0.092706, -0.080449, -0.054722, 0.035004, 0.018234, -0.064682, 0.082552, 0.043969, 0.10735, 0.17551, 0.028146, -0.093032, -0.080992, -0.17305, -0.083976, -0.082187, 0.026086, -0.024523, 0.061837, -0.0031533, 0.013887, 0.22791, 0.17839, 0.16803, -0.022424, -0.070479, 0.075631, -0.13497, 0.061914, -0.013965, -0.040287, 0.0049442, -0.14235, 0.13423, 0.0044641, 0.17884, 0.033152, -0.084186, 0.022682, 0.069503, -0.10838, 0.025867, 0.062726, 0.051958, -0.15685, 0.13621, -0.077636, 0.027664, 0.099426, -0.024066, 0.018369, 0.11491, 0.017998, -0.024584, -0.072971, 0.070923, -0.084294, 0.14549, -0.081489, -0.046883, 0.065571, 0.082578, -0.036743, 0.05491, -0.024501, 0.196, -0.047414, 0.0027762, 0.030268, 0.14718, 0.043112, -0.045243, -0.056667, 0.011024, -0.03747, 0.034539, -0.09347, -0.030232, 0.092526, 0.0033731, -0.074955, -0.05631, -0.12735],
[-0.074008, 0.059418, -0.16186, -0.095114, -0.054157, -0.095247, -0.0277, 0.13096, -0.082898, 0.043236, -0.073266, -0.010407, -0.17908, 0.11214, 0.011254, -0.072132, 0.011243, -0.12961, 0.017388, 0.052082, -0.016141, -0.0031876, 0.060476, 0.12063, -0.11552, 0.053113, -0.11176, -0.085345, -0.10342, -0.077512, 0.022696, -0.061166, -0.026801, -0.013513, 0.072872, 0.21356, -0.061052, 0.23221, -0.0060496, -0.11934, -0.048735, -0.0037697, 0.0015807, -0.059016, 0.16916, -0.10636, 0.013868, 0.13029, 0.17375, 0.36097, 0.072557, -0.050622, -0.061397, 0.012028, -0.059739, -0.1592, 0.073526, 0.010664, -0.12349, -0.20863, -0.24386, 0.2227, 0.046982, -0.10969, 0.046794, -0.067828, 0.15296, -0.074195, 0.042911, -0.014765, 0.3796, 0.41758, 0.021898, -0.11238, -0.043153, -0.0018388, -0.065449, -0.010369, 0.043815, -0.0090643, 0.10572, -0.04497, -0.060017, -0.12352, 0.072888, -0.073016, 0.024489, -0.046995, 0.0061026, 0.032989, -0.055861, 0.033549, -0.1025, -0.08537, -0.091447, -0.071753, 0.0060016, 0.004878, 0.091778, -0.063911, -0.10839, 0.1405, -0.16291, 0.049227, -0.053957, -0.025757, -0.059499, 0.029022, 0.037106, -0.043182, 0.0044686, 0.037891, -0.12462, -0.015316, -0.099422, -0.057912, -0.070463, -0.069349, 0.036225, -0.0096669, 0.0072113],
[0.00054, 0.019228, -0.0041211, 0.010352, 0.0060644, 0.030583, 0.018243, -0.011485, -0.012454, -0.013983, -0.073495, 0.00061004, -0.035457, 0.0091981, -0.0079306, -0.031347, 0.056361, 0.022269, 0.020976, 0.021593, 0.022292, -0.036376, -0.0048934, 0.018804, 0.021642, 0.022979, 0.057279, -0.062847, 0.0080146, 0.0017411, 0.023316, -0.0019692, -0.0097664, 0.026553, 0.019312, -0.040479, 0.042963, -0.0055572, 0.040029, 0.039092, -0.014761, 0.039287, -0.028686, -0.013543, 0.042797, 0.0093265, 0.071105, -0.012855, 0.0048121, -0.019345, -0.0068647, 0.060027, -0.05171, -0.0088038, 0.0085937, 0.011217, 0.004366, -0.052365, 0.018586, -0.043301, 0.017257, 0.033163, -0.063372, 0.022236, -0.010283, -0.029097, -0.072929, -0.0065264, 0.021708, -0.01287, -0.036092, 0.049588, 0.0037686, -0.035449, -0.0175, 0.0017065, 0.027703, 0.010552, -0.01511, 0.010755, -0.042385, 0.055156, -0.046342, -0.025334, -0.031804, 0.0074468, 0.014823, -0.041502, 0.05566, -0.015163, -0.033479, -0.038074, 0.018025, -0.042188, -0.068459, 0.032543, -0.043, -0.017042, 0.031344, -0.079988, 0.016716, 0.032905, 0.07075, -0.026522, 0.0097949, -0.0083591, -0.022132, -0.010267, 0.027387, -0.019457, 0.047471, 0.0064639, -0.036821, -0.014924, -0.048381, -0.035401, -0.0011684, -0.054013, 0.079191, -0.046041, 0.010261],
[-0.00015691, -0.00010973, 8.6821e-05, 0.00028959, 0.00013337, -0.00020448, 0.00046365, -0.00019524, 0.00033248, 0.0002625, -9.9023e-05, 0.00023043, 0.0003325, 0.00015431, -0.00017518, 0.00017581, -2.7858e-05, 0.00010573, -0.00016548, -0.00010017, -9.3139e-05, 7.6297e-05, 8.4225e-05, -9.3287e-05, -0.0002872, 0.0002135, -0.00031506, 0.00045189, -0.00054957, 0.00054579, 4.2927e-05, 0.00052308, -0.00068598, 0.00018155, -0.00019968, 0.00023652, 8.502e-06, 0.00049096, -0.00041196, 0.00037236, -0.00014793, -0.00020788, -0.00031632, 0.00035097, -0.00053025, 0.00019205, -0.00035924, -0.0001448, -8.2206e-05, -0.00026762, -0.00032866, -0.00013873, 0.00019338, -2.8931e-05, -0.00021531, 0.00050076, 1.287e-05, 0.00028779, 2.1517e-05, -0.00038504, 0.00026924, 0.0002012, 7.127e-05, 0.00025511, -0.00054975, 7.0801e-05, -0.00031443, 7.2728e-05, -6.7647e-05, -0.00010597, 0.00020425, -2.266e-05, -0.00046406, 0.00029312, -0.00057911, 0.00046348, -0.00018921, -6.8311e-05, -0.00011583, 0.00024261, -0.00013789, 0.00046582, -0.00037782, 0.00087162, -0.00063643, 0.00019146, -0.00030214, 0.00015481, 0.00035948, 0.00034065, -0.00013397, 0.0006282, -0.00026282, 0.000629, -0.00083565, 0.00055501, -0.00039222, 3.0416e-05, -0.00021896, -0.00025051, 7.5792e-05, 0.00032481, -0.0002841, 5.0197e-05, -7.605e-05, 0.00029723, -0.00059771, 4.8138e-05, -0.00014383, 0.00046738, -0.00043149, -2.2305e-05, -0.00053506, -0.00011828, -0.00021778, -0.0001084, -0.0008066, 0.00028972, -0.00013991, 0.00043598, -0.00043607],
[0.00079929, -3.012e-05, -9.6683e-07, 0.00086495, 0.00050305, -3.4862e-05, 0.00042196, 0.00065682, 0.00012928, -0.00026826, 0.00070486, -0.00045054, 0.00062842, 0.00021811, -0.00022767, -0.00057437, 0.0001667, -0.00045505, -0.00051896, 0.00016279, 0.00078468, -0.00020117, 0.00081332, -0.00054661, -4.6455e-05, 0.00039251, 0.00089045, 0.00044803, 0.00067252, 0.00034324, 2.9706e-05, -0.00033408, 0.00020838, -0.0014686, 0.0013211, 0.0003623, -0.00042101, -0.0010662, -0.00047869, -0.0011025, -0.00011142, 0.00036055, 0.00080537, -0.0010504, 0.001246, -0.0012889, -0.0001035, -0.00032599, 0.0008196, -0.0003287, 0.00078428, -0.00031028, -0.000132, -0.0012038, 0.00056967, -0.0015831, 0.0012384, -0.00020329, 0.00054442, -0.00047971, 0.00036398, 3.0136e-06, 0.0003463, -0.00016208, 0.00076531, -0.00043743, 0.00035576, -0.0002401, 0.00021525, -0.00065505, 0.00036035, -0.00028137, -0.0001437, -0.00019791, -0.00050362, 0.00056145, -0.00023162, -0.00041906, -4.5824e-05, -7.5822e-05, 0.00080031, 0.0005584, 2.2266e-05, 0.00089773, -9.8581e-05, 0.001173, -0.0005277, -0.00056096, 0.0001046, 0.00047498, 0.00073709, -5.6914e-05, -0.00031024, 0.00087524, -0.00044804, 0.00049556, -0.00070265, 0.00085456, 0.00012342, -0.00093547, 0.00037822, -0.00032902, 0.00056647, 0.00025216, -0.00037243, 0.00061577, -0.00048528, 0.00051398, -0.00076369, -0.00027176, -0.00036518, -0.0012782, -0.00037035, -0.0012045, -0.00051116, -0.00047597, -0.00072161, -0.00037669, -0.00075399, 0.00013433, -0.00059059],
[-0.0002515, 0.00020005, 0.00019417, -5.7923e-05, 0.00055864, -0.00029405, 0.00046419, 0.0001692, -0.00013657, 0.00014341, -2.7246e-05, -0.00017463, 0.00043209, -0.00024872, 0.0003385, -0.00042825, 0.00045275, -0.00033818, -0.00015837, 0.00037188, 4.0013e-05, 0.00029638, -1.1758e-06, -0.00017447, 0.00012685, -0.00025761, 0.00047736, -0.00015834, 0.00011916, 0.00015943, 9.365e-05, 0.0001324, 2.5813e-05, 7.7539e-06, -0.00041105, 0.00045452, -4.0405e-05, -0.00042519, 2.9496e-05, 0.00022369, -0.00022326, -5.9697e-05, 9.59e-05, -0.000218, -6.6286e-05, 0.00063835, -0.00035776, -0.00043585, 0.0005552, -0.00046868, -0.00036668, 0.00044105, -0.00016743, -0.00015286, -0.00042268, 0.00017696, -0.00087955, 0.00041466, 0.0003045, 6.8465e-06, 0.00021324, 5.5444e-05, -0.00045539, 0.00036257, 5.8126e-05, 0.00048701, -0.0010395, 0.0011089, -0.00047447, -0.0002164, -0.00030265, -0.00031877, 0.00018257, 0.00022085, -0.00045708, -0.00016765, -0.00038681, 0.00023465, -0.00089059, 2.7029e-05, -0.00019392, 0.0004316, 0.00014665, 0.00020277, -0.00016624, 3.3773e-05, -6.9001e-06, 0.00031733, 0.00013184, -0.00026275, 0.00030497, -0.00022988, -0.00034411, 0.00033974, -9.437e-05, 0.0001593, 0.00022083, 0.00023299, 0.00026685, -0.00042236, 0.0010172, -0.00066561, 0.00023103, -5.1105e-05, -0.00025247, 0.00027604, -0.00017761, -0.00010325, 8.8215e-05, -0.00022473, -9.1083e-05, -0.00032299, 0.00049768, 8.6189e-05, -0.00027279, -0.00012651, -0.00052227, -5.2141e-05, -0.00031611, 0.00017884, -0.00037941],
[-0.17867, -0.010046, -0.04259, -0.065935, 0.052273, 0.033122, 0.02795, 0.034597, 0.040653, -0.0060289, 0.0121, -0.0058231, -0.075829, 0.11467, 0.020114, 0.068302, 0.053668, -0.0019151, 0.0032162, -0.022868, -0.036064, 0.0030444, 0.0050268, -0.016159, 0.013434, 0.046278, -0.019864, 0.033082, -0.011511, -0.023361, 0.048031, 0.072163, -0.034707, 0.015743, -0.043658, 0.05299, -0.00057783, 0.053685, 0.05641, 0.031927, 0.076208, 0.035085, 0.016017, 0.097829, -0.010933, -0.057605, -0.046117, 0.11587, 0.01663, -0.072381, -0.027211, 0.104, -0.049864, 0.013157, 0.068758, -0.086093, 0.10551, -0.051926, -0.084577, -0.023869, 0.11535, -0.029928, -0.098805, 0.081749, -0.10609, 0.031317, -0.028082, 0.079442, -0.093214, -0.069858, 0.10703, -0.071548, 0.064465, -0.099165, -0.01347, 0.034352, -0.10594, -0.035787, -0.011064, 0.018378, -0.039254, -0.14017, -0.037213, 0.011543, 0.0046565, -0.076081, 0.021617, 0.0056964, -0.054225, 0.039976, -0.014192, -0.056039, -0.085955, 0.022657, -0.0022048, 0.002352, -0.0086408, -0.064881, -0.0055523, 0.079596, -0.01119, 0.019694, -0.0090802, 0.0030333, -0.11173, -0.037769, 0.14408, 0.0085418, 0.051063, -0.013809, -0.018804, -0.074726, 0.062213, -0.031173, 0.023266, -0.01323, -0.088087, -0.16851, 0.014989, -0.04579, 0.038302],
[-0.12472, 0.016332, 0.010132, 0.0072417, -0.059929, 0.014889, -0.052419, 0.022431, -0.043702, 0.021372, -0.066552, -0.076752, 0.031454, 0.00050699, 0.048209, -0.043606, -0.026402, 0.11495, -0.00084488, 0.041763, 0.016621, 0.095744, 0.016932, -0.031217, 0.021554, -0.061228, 0.081696, -0.0551, -0.095302, -0.031352, -0.035125, -0.028837, -0.047885, 0.060702, 0.080685, -0.039628, 0.06471, 0.013113, 0.16301, 0.12825, 0.074636, -0.016897, 0.010567, 0.0033568, -0.041216, 0.083781, 0.10219, -0.048555, 0.095493, -0.12105, -0.14934, -0.038947, 0.053671, 0.10886, 0.062398, -0.064005, -0.0011642, -0.017989, 0.10376, -0.021666, 0.20636, 0.067516, 0.022595, -0.10875, -0.15368, -0.10156, -0.056219, 0.0048936, 0.080509, -0.048987, -0.054674, 0.034417, 0.13789, 0.17934, 0.22694, 0.16715, 0.28888, -0.0045505, 0.12854, -0.14688, 0.039804, 0.0011617, -0.19134, -0.11486, -0.040556, -0.077014, -0.064919, -0.17402, -0.069452, -0.1707, 0.097553, -0.012417, 0.00878, 0.033808, -0.040324, -0.12351, -0.071104, -0.032842, -0.025257, -0.13558, 0.13027, -0.098979, 0.01654, -0.055394, -0.017478, 0.082533, -0.0052693, 0.023715, -0.025128, -0.054494, -0.0065251, -0.19552, 0.00051533, -0.1247, -0.010402, -0.040854, -0.050091, 0.0061714, -0.022234, 0.025005, 0.053772],
[-0.069531, -0.027855, 0.018198, 0.015264, -0.021355, -0.060615, 0.007426, 0.044909, -0.02229, -0.045038, -0.055531, 0.090244, -0.0038081, 0.001819, -0.023995, 0.022637, 0.034386, -0.0041323, -0.01524, 0.059723, 0.0035447, 0.10857, 0.015828, 0.0089879, 0.021417, -0.026, -0.072054, 0.0067502, -0.043797, -0.086222, 0.0012469, 0.013968, -0.0188, 0.091106, 0.071483, 0.053141, 0.0091481, 0.0032189, 0.10532, 0.013069, 0.11322, 0.024085, 0.10571, 0.097249, -0.040357, -0.052072, 0.0094838, 0.023225, 0.048982, -0.077047, -0.016369, -0.048399, -0.017519, -0.048725, -0.090696, 0.14585, 0.020202, 0.052473, -0.005921, 0.0022813, 0.011431, 0.098602, 0.035391, 0.11802, 0.014488, 0.14986, -0.083365, 0.026042, 0.057536, 0.1029, 0.13376, 0.098599, 0.11296, 0.066812, -0.030392, 0.037677, -0.080465, -0.013433, -0.07905, -0.086928, -0.13723, -0.16181, -0.15594, -0.15634, -0.15766, -0.019054, -0.066428, -0.040315, -0.1553, 0.12102, 0.0073739, -0.039042, 0.044864, -0.031074, -0.037869, 0.026936, -0.025703, 0.030655, -0.0083295, 0.030464, -0.016822, 0.010026, 0.023942, 0.0037369, -0.0062061, 0.040478, 0.0152, 0.035362, 0.035114, -0.10029, -0.1061, -0.0521, -0.0037985, 0.02929, 0.020763, 0.037574, 0.050568, 0.0025948, -0.034033, -0.031897, -0.072553],
[-0.074151, -0.00066986, -0.038515, -0.023181, -0.032101, -0.016814, -0.043281, -0.034097, 0.010157, 0.030027, -0.1357, 0.05532, 0.041423, 0.054238, 0.075158, -0.0045612, 0.0049337, -0.027804, 0.037859, -0.010636, 0.043039, -0.031109, -0.026843, -0.03367, 0.0053082, -0.03972, -0.011433, 0.0018727, -0.030625, -0.0029381, -0.0095989, -0.013588, -0.0090228, 0.013981, -0.027132, -0.066722, 0.029996, 0.10811, 0.073933, 0.094597, 0.021327, 0.0051895, 0.090626, -0.0014968, 0.095692, 0.071033, 0.093121, 0.08641, -0.082912, -0.063317, 0.058041, 0.094123, 0.048289, 0.0065601, -0.017979, -0.10529, -0.099505, -0.11641, -0.16337, -0.030663, 0.037327, 0.021716, -0.036984, 0.10584, -0.038901, 0.042389, 0.15761, 0.14948, 0.15123, 0.26083, 0.2455, 0.20845, 0.014092, -0.081544, -0.12046, 0.19947, -0.12279, 0.043147, -0.0039359, 0.041945, -0.14663, -0.16842, -0.21746, -0.14594, 0.12454, -0.018239, -0.096476, 0.096745, -0.16116, -0.10959, -0.18407, 0.028717, 0.01794, 0.067713, 0.070427, -0.11003, 0.093084, 0.01548, -0.15557, -0.014144, 0.032512, 0.055568, -0.017473, -0.029534, -0.038828, -0.030212, 0.045497, -0.15438, 0.1342, -0.20134, 0.062249, 0.024284, -0.036965, 0.0046654, 0.019888, -0.083468, -0.016567, -0.08316, 0.0045192, -0.15566, -0.091842],
[-0.066489, -0.047719, -0.094104, -0.0136, -0.045531, -0.085062, -0.063094, -0.053821, -0.12222, 0.047518, -0.10544, -0.12135, 0.020629, 0.038231, -0.043392, 0.0044225, -0.038085, -0.07983, -0.028986, -0.065506, -0.088403, 0.0075686, 0.0146, -0.0022052, 0.018239, 0.066199, 0.014133, -0.018585, 0.0097275, -0.013373, -0.13952, -0.099454, 0.0024537, 0.023326, 0.052273, -0.0078434, -0.019449, -0.037936, 0.0060267, 0.04031, 0.061324, 0.12961, -0.052464, -0.092317, 0.12501, -0.023511, 0.0687, 0.081178, 0.081636, 0.13285, 0.11443, 0.031137, 0.039574, 0.064207, -0.026586, -0.069602, -0.0068827, -0.086642, -0.12201, -0.087603, -0.097081, -0.14353, -0.032404, 0.016665, -0.028878, 0.046661, 0.16769, 0.081857, 0.13298, 0.15797, 0.15421, 0.23508, 0.10845, -0.026636, 0.10226, 0.074816, -0.067484, 0.014559, -0.031797, -0.060628, -0.091575, -0.021837, -0.18286, 0.094502, 0.013465, 0.017063, 0.047282, 0.10222, 0.0032627, 0.014577, 0.0537, 0.048468, 0.0033061, 0.10215, -0.077242, 0.018935, 0.00098413, 0.047212, -0.042524, -0.059479, -0.043645, 0.007226, -0.045364, 0.0015258, 0.033942, -0.062869, -0.011162, -0.026182, 0.11833, -0.11894, 0.0030267, -0.019807, -0.020185, -0.0019915, -0.028349, -0.051936, -0.11455, 0.016935, -0.037825, -0.013759, -0.14177],
[-0.12379, -0.022793, -0.056572, -0.039201, -0.014506, -0.14164, -0.066773, -0.016892, 0.018395, -0.060257, -0.11708, -0.16992, 0.022682, -0.037432, 0.027836, -0.10392, -0.024896, -0.10241, 0.027892, 0.03703, 0.025269, -0.18055, -0.13784, 0.032154, 0.10446, 0.042116, 0.0035951, 0.065347, 0.022453, -0.0013755, -0.030524, 0.030664, -0.098775, 0.21125, 0.031923, -0.034705, 0.036622, -0.010853, -0.007389, 0.0056783, 0.029567, 0.096434, 0.029158, 0.29857, -0.079196, 0.00025704, 0.030976, -0.077561, 0.10471, 0.14285, 0.099402, -0.040837, -0.11174, -0.067308, -0.18342, 0.1398, -0.041935, -0.092866, 0.019653, -0.09039, -0.20734, -0.072878, 0.0027433, 0.0061246, 0.094598, 0.15506, 0.041295, 0.0060989, 0.20247, 0.18773, 0.14967, 0.2906, 0.18823, 0.15999, 0.11916, 0.056018, -0.027929, 0.056676, 0.014382, -0.043592, -0.1069, -0.062248, -0.17877, -0.092288, -0.18023, -0.061399, 0.066683, 0.095797, -0.07561, 0.033484, 0.009071, 0.0023841, 0.01285, 0.0037372, 0.056508, 0.071821, 0.074187, -0.027905, -0.084135, 0.10542, 0.028027, 0.065445, 0.064162, 0.032941, 0.0054021, 0.035715, 0.007712, -0.035146, 0.095731, 0.068293, -0.17431, -0.053416, -0.043073, -0.075042, -0.0026001, -0.026745, -0.014015, -0.037147, -0.029554, -0.052553, -0.20455],
[-0.080337, 0.031543, -0.080333, -0.1658, -0.012897, -0.10179, -0.017891, -0.047932, -0.069573, -0.013085, -0.06403, -0.047389, -0.048253, 0.010624, -0.088304, -0.0248, -0.017016, -0.073112, 0.017958, 0.020032, 0.026271, -0.10027, -0.055354, -0.019203, -0.17887, -0.047929, -0.015477, -0.036581, -0.0013978, -0.02438, -0.013239, -0.016219, 0.033456, 0.031282, -0.11781, 0.08676, 0.096838, 0.007578, 0.040208, 0.039797, -0.0079643, 0.057675, 0.065973, 0.076369, -0.094338, 0.027582, 0.17673, 0.0080282, 0.079734, 0.14711, 0.066918, 0.050334, 0.0011558, 0.013615, 0.0030149, -0.001561, 0.13349, -0.080527, 0.050307, -0.13744, -0.073796, -0.03188, -0.057867, -0.065217, -0.066794, -0.088251, 0.0096845, -0.042764, 0.094638, -0.066202, 0.13555, 0.15163, 0.11508, 0.091266, 0.14084, 0.12799, 0.20636, 0.028581, 0.14482, -0.064493, 0.14635, -0.039325, -0.049278, -0.080228, 0.016308, -0.064651, -0.077927, -0.029574, -0.024416, -0.13305, 0.13699, -0.022414, -0.0058687, 0.0049992, 0.07054, -0.00037991, -0.011859, 0.094751, 0.032189, -0.084875, 0.14236, -0.035525, -0.025841, -0.078953, 0.048318, -0.082027, 0.043364, 0.0027046, -0.027921, -0.071951, -0.09968, -0.12072, 0.027686, -0.065397, 0.041932, -0.06347, 0.015318, -0.088955, -0.0024259, -0.055982, 0.025023],
[-0.16063, -0.05068, -0.017603, -0.002472, 0.025627, 0.0064475, 0.040905, -0.019412, 0.010908, -0.057, -0.16989, -0.047848, 0.045771, 0.036605, -0.0347, -0.038814, 0.059925, -0.045042, 0.0044791, 0.010086, 0.017233, -0.014699, -0.031159, 0.054786, -0.045019, 0.027938, -0.050948, -0.058028, -0.018143, -0.073467, 0.029761, 0.020105, -0.03083, 0.0089385, 0.0094918, 0.031257, -0.074325, 0.047502, -0.087203, 0.019497, 0.018802, -0.020783, 0.037407, 0.012029, -0.08564, -0.012501, -0.027084, 0.012926, -0.020812, -0.14056, -0.11375, 0.017925, -0.028517, 0.045859, -0.13118, -0.17389, 0.053714, 0.0323, 0.05752, 0.059047, -0.11509, 0.043566, 0.059537, 0.076599, 0.014207, -0.11994, 0.003483, 0.083083, 0.068673, 0.066345, 0.084013, 0.10863, 0.036022, 0.1238, 0.043237, 0.0594, 0.042445, 0.12789, 0.014244, 0.067136, 0.086699, 0.059557, 0.018099, 0.010713, -0.0005958, 0.061343, -0.00013986, 0.22413, 0.088014, -0.058215, -0.0012261, 0.042306, 0.052067, 0.075415, 0.077471, 0.045711, 0.017695, -0.0030659, -0.029624, 0.12897, 0.042184, -0.039395, -0.041007, -0.1339, -0.0425, -0.058195, -0.0952, -0.049991, -0.035359, 0.1586, -0.11702, 0.02205, 0.048193, -0.0056565, 0.055322, 0.0039771, 0.0088791, 0.030973, 0.036137, 0.077637, -0.11747],
[0.0032106, 0.088885, 0.10096, 0.022293, -0.071525, 0.0057431, 0.065381, 0.0082641, -0.052298, 0.055063, 0.042136, -0.0027337, 0.061071, -0.10701, -0.055828, -0.065033, -0.011795, -0.16487, 0.021281, 0.011339, 0.015608, -0.08575, 0.0043087, -0.0028334, -0.075705, -0.095024, -0.024443, -0.0048743, 0.053736, -0.046164, -0.093394, -0.089492, -0.070094, -0.034765, -0.11037, -0.041699, 0.048555, 0.037317, -0.0091258, -0.024838, -0.10812, -0.011196, 0.062001, -0.030909, -0.20817, 0.028408, -0.034229, 0.015547, 0.042038, 0.149, -0.077828, 0.33344, 0.36268, 0.18381, 0.18802, -0.02676, 0.001051, 0.040988, 0.14355, 0.1472, -0.22199, 0.31512, -0.097934, -0.34109, -0.17922, -0.075038, -0.0606, -0.019191, 0.16686, -0.012989, -0.34657, 0.14668, -0.053558, -0.24973, 0.24117, 0.067441, 0.11114, -0.17424, 0.12201, -0.092747, -0.065791, 0.35856, 0.22608, -0.1116, 0.30572, -0.10906, -0.15714, 0.068396, -0.040922, 0.0013632, 0.10794, 0.11371, 0.05701, -0.082634, 0.046328, 0.056397, 0.020212, -0.029754, 0.054467, -0.014207, 0.093989, 0.044572, -0.073566, -0.15318, -0.061212, 0.026711, 0.036455, 0.1388, 0.2398, 0.111, -0.12734, -0.070921, -0.084031, -0.052911, 0.008027, -0.048337, -0.040315, -0.089109, -0.1026, -0.0918, -0.21141],
[-0.070542, 0.055085, 0.10153, 0.023622, 0.029956, -0.02606, 0.11064, 0.024489, 0.02197, 0.020457, -0.041117, -0.024812, 0.0095704, -0.048146, -0.041543, -0.0045487, -0.022901, -0.10096, -0.032652, 0.037091, 0.014636, -0.01092, -0.026208, -0.14215, -0.13289, -0.033251, 0.0054752, 0.091854, 0.036012, -0.080267, -0.02962, 0.026873, 0.024976, -0.10102, 0.10924, 0.070655, -0.10936, -0.32088, -0.20437, 0.050939, 0.046306, -0.052625, -0.10829, 0.090883, 0.19174, 0.12934, 0.1186, 0.26211, 0.4376, -0.07386, -0.076584, 0.10681, -0.089974, -0.061555, -0.092351, 0.02414, 0.029438, -0.015638, -0.14953, -0.10876, 0.19098, -0.049896, -0.16239, 0.04671, -0.033452, 0.0046311, 0.0064217, -0.12477, -0.031314, 0.0042103, -0.025366, 0.063684, 0.13395, -0.065578, 0.057464, 0.17257, -0.11824, 0.060334, 0.0037599, -0.0382, 0.066276, 0.25634, -0.093935, 0.1365, 0.0034795, -0.072762, 0.029458, -0.015678, 0.19132, -0.12071, -0.049397, 0.077176, -0.030486, 0.049783, -0.057533, 0.14083, 0.17409, 0.0093446, -0.12819, 0.097922, 0.14847, 0.2172, 0.044316, 0.11562, 0.079277, -0.12049, -0.049673, -0.032827, 0.0090016, -0.13279, -0.20143, -0.012865, -0.052263, -0.059203, -0.11793, -0.18199, -0.00074838, -0.13714, -0.061325, 0.01995, -0.062147],
[0.051025, -0.019224, -0.0091745, -0.022468, 0.021118, -0.017504, -0.22285, 0.022525, -0.0024245, -0.096691, -0.025361, 0.073435, 0.15109, 0.11522, 0.1297, -0.078929, 0.097198, 0.21131, -0.24961, -0.011818, 0.064528, -0.085348, 0.049274, -0.061577, 0.063001, -0.043023, 0.069051, -0.096092, -0.061694, 0.18034, -0.16664, -0.051094, 0.069176, -0.11904, -0.08579, -0.20469, -0.037006, 0.034799, 0.063283, 0.1479, -0.066933, 0.13701, 0.0071805, -0.062055, 0.22476, -0.073222, -0.080358, -0.11456, 0.20483, 0.10476, 0.10684, -0.10692, 0.018058, 0.12869, -0.071027, 0.04413, 0.12003, 0.14237, 0.21905, 0.069723, -0.082454, -0.10618, 0.079817, 0.17122, 0.11078, -0.1575, -0.026069, 0.17501, 0.19358, 0.15583, 0.13145, 0.10803, -0.015809, -0.066108, -0.14853, -0.054745, -0.065217, -0.026932, 0.017929, -0.025775, -0.12464, -0.13002, -0.23174, -0.0669, -0.037099, -0.030813, 0.11265, -0.03528, -0.066288, -0.094886, -0.13366, -0.07721, -0.094369, 0.053336, 0.041074, -0.044715, 0.14383, -0.054988, -0.0022013, 0.021969, 0.032944, -0.0067769, 0.055703, 0.051114, -0.0071487, -0.050493, 0.11606, -0.10774, -0.017707, -0.029669, -0.16641, -0.048752, -0.07477, -0.066227, -0.10651, -0.00092592, -0.0045899, -0.041813, -0.029842, 0.04003, -0.11835],
[-0.14161, -0.061297, 0.0081528, 0.095805, -0.12141, -0.15258, 0.14459, 0.10275, -0.076911, 0.010478, -0.064039, -0.084813, 0.025051, 0.087181, -0.20873, 0.0040299, 0.39083, -0.018288, -0.19371, 0.21355, 0.19219, 0.051337, -0.099999, 0.065604, -0.033197, 0.077857, 0.22273, -0.096602, -0.13245, 0.22635, -0.02376, -0.16636, 0.024376, 0.011185, 0.0090203, 0.017388, -0.04308, -0.064752, -0.15373, 0.10303, -0.086296, -0.18748, -0.083188, -0.037066, -0.091363, 0.043056, -0.0076223, -0.0723, 0.18949, 0.091583, 0.09321, 0.078433, -0.086071, -0.16936, 0.21392, -0.07688, 0.14025, 0.18839, 0.11529, -0.16631, -0.13317, -0.019452, 0.013015, 0.28544, 0.23882, 0.23929, -0.025478, 0.011733, -0.03133, 0.026406, 0.17735, 0.15387, 0.022878, 0.15423, 0.10953, 0.19865, -0.10958, 0.0040964, -0.0032427, -0.06496, 0.002359, -0.082444, -0.087193, 0.0056234, -0.024094, -0.12474, -0.14739, -0.13843, -0.094737, 0.043476, -0.022122, -0.058009, 0.074104, 0.027468, -0.068146, -0.086381, -0.072755, 0.01616, -0.095064, -0.055944, 0.02497, -0.092156, 0.020486, -0.049538, 0.062127, 0.010981, 0.028107, -0.023413, -0.011846, -0.04146, -0.12376, -0.0075478, -0.035061, -0.054382, -0.12788, -0.063113, -0.07867, -0.0052472, -0.027462, -0.048145, -0.097095],
[0.035456, 0.01281, 0.01818, -0.0038058, -0.047339, 0.0086152, -0.046294, 0.016896, 0.073403, 0.057854, 0.046801, 0.017573, -0.023834, -0.028005, -0.061704, 0.0041493, -0.099934, -0.074151, -0.097134, -0.05064, -0.051916, 0.04634, -0.10129, -0.010697, -0.13071, 0.065224, 0.035157, 0.078444, 0.02087, -0.083009, -0.041877, -0.032514, -0.065939, -0.081372, -0.042073, 0.11944, -0.19373, -0.14791, -0.091871, -0.02184, 0.047336, 0.060397, -0.079535, -0.046692, 0.19615, 0.15002, 0.22469, 0.4337, 0.17627, 0.085003, 0.17628, -0.089798, -0.10576, -0.0049048, -0.064592, -0.076504, -0.048693, -0.19598, -0.27569, 0.26255, -0.056874, -0.10876, 0.27052, 0.20636, -0.0015736, -0.17759, -0.0015426, 0.050842, 0.092668, 0.030409, -0.43179, 0.36702, -0.059156, -0.34465, 0.10849, 0.10613, -0.049251, 0.16014, -0.12372, -0.15509, 0.1045, 0.1609, -0.14487, 0.43189, 0.11981, -0.13833, 0.011269, -0.081012, 0.17513, -0.046057, 0.033711, -0.015269, 0.18262, -0.10025, -0.097021, 0.066111, 0.15775, 0.10256, -0.065278, 0.019465, 0.18821, 0.076081, 0.20711, -0.0097133, -0.067601, -0.045104, -0.047138, -0.04305, 0.029932, 0.0056791, -0.17631, -0.030884, -0.020628, -0.10197, -0.11425, -0.020674, -0.024768, -0.074425, -0.055049, -0.037227, -0.16216],
[-0.070049, 0.085301, 0.0028141, 0.010033, 0.089868, 0.052913, -0.050136, -0.022286, 0.045302, -0.030119, 0.021823, -0.0060856, 0.023126, 0.014529, -0.0015684, -0.027996, -0.16608, 0.07873, 0.036994, -0.016142, 0.068801, -0.043417, 0.038981, -0.06654, 0.0031039, -0.013009, -0.092595, 0.12644, 0.040773, -0.085448, -0.13739, -0.13311, -0.11021, 0.070763, 0.080261, -0.16878, -0.05206, 0.13425, -0.10535, -0.33738, -0.070808, 0.057004, 0.09228, -0.011615, -0.050913, -0.16069, -0.048848, 0.071389, -0.043639, -0.13394, 0.30516, 0.23788, 0.20977, 0.12056, 0.25283, -0.0023562, -0.035137, 0.049605, -0.10416, -0.14206, 0.25292, -0.038235, -0.053227, -0.16541, -0.014617, 0.028801, -0.10097, 0.10738, 0.12267, -0.05807, 0.073527, 0.01054, -0.051688, -0.072825, 0.11389, -0.099763, -0.099681, -0.0083155, 0.028782, -0.016644, -0.10306, 0.17422, -0.012649, 0.26026, 0.13061, -0.13681, -0.055878, 0.09867, -0.1397, 0.029745, 0.073907, 0.16843, 0.089063, -0.081254, 0.0080562, 0.15433, 0.061775, -0.050386, 0.19951, -0.095579, -0.078848, 0.066657, -0.07773, -0.059688, -0.0023501, -0.0046282, 0.075461, 0.11777, 0.24713, -0.021968, -0.093774, -0.011643, -0.055253, -0.067446, -0.09786, -0.067747, -0.11419, -0.15448, -0.053914, -0.072083, -0.10186],
[-0.014135, -0.083516, 0.025062, 0.075977, -0.15437, -0.042405, -0.034524, 0.13187, -0.018957, -0.0026675, 0.10306, 0.04033, -0.10561, 0.017365, -0.15937, 0.032279, 0.1053, 0.075028, -0.11928, 0.10401, 0.14421, 0.0071286, -0.079992, 0.014275, -0.03873, -0.13695, 0.18645, -0.065111, -0.14101, 0.22619, -0.0019016, -0.049331, 0.014048, -0.033852, -0.028526, 0.08623, 0.10756, -0.040378, 0.040168, 0.25442, -0.34992, -0.11829, -0.11322, -0.03604, 0.0091419, 0.015128, 0.048542, -0.11506, 0.081696, 0.17251, 0.15416, 0.10511, -0.21705, -0.14597, 0.19709, -0.12399, 0.10066, 0.12172, 0.12481, -0.055988, -0.21829, 0.080538, 0.23046, 0.31883, 0.20522, 0.0081843, -0.054335, -0.11191, -0.0056947, -0.043056, -0.04046, 0.10031, -0.060037, 0.14527, 0.25791, 0.16199, 0.049309, 0.0040739, 0.11099, -0.020691, -0.11144, -0.081095, -0.11639, -0.038956, -0.12985, -0.22365, -0.0058588, -0.036087, -0.077144, -0.047407, 0.027429, 0.099597, 0.040004, -0.073007, -0.017636, -0.072072, -0.0031646, -0.065567, -0.10478, 0.0094405, 0.025832, -0.03882, 0.027512, 0.036751, 0.040562, -0.0038665, 0.012356, -0.053858, -0.00065956, -0.0026598, -0.11896, 0.022143, -0.046808, -0.07491, 0.018173, -0.066413, -0.033129, -0.12809, 0.0050881, -0.088215, -0.1122],
[-0.036364, 0.056084, -0.054615, 0.12841, 0.034695, -0.099269, 0.035218, 0.001705, -0.053721, -0.1047, -0.057794, -0.0079505, 0.079079, 0.17476, -0.073746, 0.14079, 0.17945, -0.028798, -0.053414, 0.088642, 0.0067588, -0.13125, 0.03217, -0.075938, -0.045683, 0.098321, -0.11055, -0.085252, 0.1988, 0.020722, 0.022471, 0.082376, -0.11576, 0.032843, -0.083484, -0.077332, -0.11177, 0.024984, -0.030403, -0.029025, -0.10372, 0.011701, 0.0093278, 0.0024312, 0.15007, -0.21395, -0.11854, -0.0019534, 0.18178, 0.054955, 0.15511, 0.030061, -0.019865, 0.070851, -0.00048596, 0.17946, 0.30639, 0.14694, 0.10068, -0.073081, -0.083394, -0.13131, 0.026088, 0.1539, 0.14966, -0.12432, -0.055198, 0.23539, 0.23071, 0.17815, 0.032433, 0.08525, 0.10099, 0.076039, -0.013732, 0.01869, -0.032925, -0.22859, -0.12676, -0.11187, -0.12231, -0.022443, 0.014664, -0.049709, -0.031971, -0.03212, 0.044761, -0.048497, -0.0359, -0.059853, -0.046859, -0.054269, -0.025597, -0.05982, -0.029519, 0.0036297, -0.020509, -0.001523, -0.090003, -0.026576, -0.010829, -0.0095883, -0.0089047, 0.0029522, 0.0038042, 0.061866, 0.03369, -0.066066, -0.024372, -0.034185, -0.10894, 0.0071168, -0.094013, -0.018408, -0.057182, -0.026056, -0.08889, -0.10212, -0.04305, -0.085051, -0.026051]
], "lbp": [
[-0.0279, -0.0060442, -0.029118, -0.012328, 0.061854, 0.095671, 0.045972, 0.015531, -0.012023, -0.040293, -0.033222, -0.0035958, -0.013857, -0.034504, 0.017543, 0.036808, 0.08477, 0.060825, -0.0093584, -0.048193, -0.0065947, -0.030168, -0.0073362, -0.049812, -0.028526, -0.0089851, 0.037543, 0.07585, 0.040464, -0.020222, -0.010643, -0.025973, -0.029295, -0.049586, -0.016454, -0.013482, -0.034207, 0.069169, 0.043415, 0.066515, -0.028014, -0.0028085, 0.012846, -0.020229, 0.026364, -0.024003, -0.071419, 0.019799, 0.047962, 0.090396, 0.05487, -0.015562, -0.0052397, -0.013383, -0.0017451, 0.00097397, -0.034245, -0.029304, -0.015763, 0.012324, 0.11024, 0.0052691, -0.0082711, 0.029191, 0.010482, 0.0048675, -0.0043579, -0.02572, -0.065308, 0.016283, 0.042681, 0.074985, 0.016473, 0.013771, 0.0024093, 0.024024, 0.033111, -0.056875, -0.027797, -0.033811, 0.015079, 0.04821, 0.11415, -0.0050453, -0.024537, -0.0046878, 0.030699, 0.036164, -0.01766, -0.02759, -0.023776, -0.0031654, 0.043854, 0.093522, -0.0015599, -0.019099, 0.041501, -0.0029953, 0.020048, -0.025806, -0.014023, -0.052045, -0.0089677, 0.059688, 0.082792, 0.021693, -0.0122, -0.0040159, 0.048254, 0.0050565, -0.02978, -0.045802, -0.022217, -0.026806, 0.080558, 0.11125, 0.024835, 0.013031, 0.026214, 0.0092541, 0.054743],
[-8.7334e-05, 3.7445e-05, -1.6719e-05, 2.645e-05, 0.00026446, 0.00018012, 0.00013079, -8.9234e-05, 8.7778e-05, -2.863e-05, 0.00019466, 4.0175e-05, -2.447e-05, -5.5303e-05, -9.4642e-05, 0.00013992, 0.00025974, 0.00010837, -2.8508e-05, 2.0612e-06, -5.4547e-05, 0.00011548, -0.0001789, 1.0106e-06, -1.6477e-05, -5.4462e-05, 4.6057e-05, 0.00020887, -5.986e-06, 3.9147e-05, -0.00015654, -5.0893e-05, 8.3829e-05, -3.926e-05, 2.9023e-06, -5.5656e-05, -3.9745e-05, 8.2728e-05, 0.00021615, 0.00016965, -0.00015047, -3.9212e-05, -4.1804e-05, 9.8943e-05, -3.77e-05, -2.1777e-05, -0.00010842, -0.0001125, -2.8089e-05, 0.000245, 0.00011698, 0.000137, -0.00011632, 3.8759e-05, -5.0384e-05, -5.6491e-05, 4.1859e-05, 0.0001051, -9.5909e-05, -8.2666e-05, 0.00014673, 0.00017377, -6.6786e-05, 7.6118e-05, -0.00016836, 0.00012437, 2.5725e-05, -6.2337e-05, -0.00015377, -2.7483e-05, -2.8455e-05, 0.00012458, 0.00015628, -2.4737e-05, -2.0912e-05, 4.3221e-05, -1.0155e-05, -9.9849e-05, 0.00014167, -9.9759e-05, -5.3681e-05, 2.4697e-05, 1.825e-05, 0.00019364, -7.2709e-05, 3.8335e-05, -1.9411e-05, -3.2116e-05, 5.1948e-05, -3.8287e-05, 9.7189e-05, -0.00011816, -0.0001609, 0.00011624, 4.9146e-05, 0.00010182, -1.4288e-05, 4.3292e-05, -1.9967e-05, -1.7368e-05, -1.9583e-05, -3.2833e-05, -5.3814e-05, -5.6208e-05, -5.3242e-05, 0.00024615, 9.7553e-05, 2.1844e-05, 3.0258e-05, -5.3699e-05, -2.5231e-05, -5.8324e-05, -4.705e-05, 3.6195e-05, -2.9441e-05, -6.9517e-05, 0.00012457, -3.5054e-05, 2.1987e-05, -1.5332e-05, -2.3047e-05],
[-3.6084e-05, -1.9307e-05, 6.647e-05, -6.9627e-05, 5.3718e-05, 8.6337e-05, 8.2142e-05, -8.1711e-05, 4.0206e-05, 7.8479e-05, -4.904e-05, 5.7454e-05, -0.00010018, -2.6148e-05, 7.1198e-05, 2.5683e-05, 0.00011929, 2.7861e-05, 3.2654e-06, -5.5574e-05, -2.4041e-05, -3.7016e-05, -0.00013309, 1.9238e-05, -2.7446e-05, -1.1994e-05, 3.5032e-05, 9.489e-05, 4.1828e-05, -3.4147e-05, 3.1692e-05, -0.00012748, -1.5841e-05, 4.7074e-05, -5.4219e-05, -2.7058e-05, 1.9573e-06, -4.2885e-06, 5.1784e-05, 9.7614e-05, 2.6206e-05, -3.8407e-05, -4.3621e-05, 6.1283e-05, -4.1485e-05, -1.8992e-05, -3.8766e-05, 2.4842e-05, 1.9431e-05, 5.7022e-05, 3.6943e-05, -2.2802e-05, 5.8533e-05, -3.8134e-05, -0.00010733, -2.1349e-05, 2.0213e-05, -1.0308e-05, -0.00013178, 9.2793e-06, -6.4061e-06, 0.00010489, -3.6972e-05, 1.9206e-05, -2.512e-05, 6.6678e-06, -5.3173e-05, 1.5596e-05, 4.2064e-05, -0.00011209, -8.0476e-05, 8.6804e-05, 8.6344e-05, 2.8719e-05, -5.3155e-05, -5.4571e-05, 2.774e-05, 3.129e-06, 1.8897e-06, -0.00012179, 6.684e-05, -0.00010634, 3.586e-05, 0.00015372, 9.3482e-05, -5.1253e-05, -1.1146e-05, -1.9744e-05, -7.8769e-05, -7.5893e-05, 1.3246e-07, -0.00019713, -1.3375e-05, -3.2244e-05, 4.5963e-05, 1.3631e-06, 6.1091e-05, -3.7064e-05, 5.3774e-05, 2.8715e-05, 4.3069e-06, -5.9399e-05, 9.4064e-05, -0.00012586, 5.0461e-05, 0.00013218, 9.0391e-05, -6.4299e-05, 6.1429e-05, 7.2397e-07, -6.3668e-05, 4.8759e-05, 1.3706e-06, -9.7973e-05, 2.9715e-05, -0.00017065, 5.6129e-07, 0.0001305, 3.9513e-05, -3.0858e-05, -8.0773e-05],
[-0.00010042, -7.5004e-05, 7.7579e-05, 0.0001506, 0.00010273, -1.3456e-06, -8.5138e-05, 9.5278e-06, -5.1251e-05, 2.1937e-06, -2.9907e-05, -1.7823e-05, 1.5921e-05, -4.262e-07, 7.5622e-05, 0.00012391, -3.7227e-05, -5.1852e-05, -8.036e-05, 7.6557e-06, -2.9341e-05, 8.2155e-05, -6.0163e-07, -9.0231e-05, -0.00014678, 5.8459e-05, 0.0001292, 6.8728e-05, -5.0835e-05, -4.9058e-05, 1.4667e-05, 2.2867e-06, -4.0793e-05, 3.1833e-05, -4.614e-05, -0.00013109, -4.5015e-06, 0.00013512, 8.2693e-05, 3.7213e-05, -0.00021402, 1.2161e-05, 9.9526e-07, -4.0751e-05, -5.3363e-05, 1.3589e-05, -3.4576e-05, -8.6226e-05, 0.00012833, 0.0001795, -7.6588e-05, -5.9447e-06, -3.3934e-05, 5.9031e-05, -2.0159e-05, 6.848e-06, -3.508e-05, -0.00010776, -6.0092e-05, -2.1592e-05, 0.00020857, 0.00013308, -0.00019039, -4.8312e-05, -4.4977e-05, 9.0492e-06, -5.3993e-05, 3.1276e-05, -3.2915e-06, -0.00013006, -6.2666e-05, 5.4667e-05, 0.00011703, 1.0892e-05, -0.00019162, 1.7056e-05, 2.9742e-05, 1.5551e-05, -4.5024e-05, -6.5835e-06, -0.00012256, -3.9207e-05, 5.772e-05, 0.00026173, 0.00011301, -5.0802e-05, -0.00012439, -0.00011512, -3.3744e-05, -3.5132e-05, -4.6346e-05, 1.503e-05, -7.9108e-05, -0.00013976, 0.00019174, 0.00023315, -3.2682e-05, -2.2277e-05, -0.0001316, -5.3704e-05, 4.6652e-06, -2.973e-06, -7.4267e-05, -5.3893e-05, -1.3168e-05, -7.309e-05, 0.00020791, 0.00015787, -6.9607e-05, -7.3262e-05, -1.4507e-05, 1.322e-05, -6.5931e-05, 8.7111e-05, -6.5268e-05, -9.1013e-05, -5.1961e-05, 0.00012231, 0.00015993, 5.6612e-07, -6.6483e-05],
[-0.01852, 0.033336, 0.06082, 0.040323, -0.049048, -0.063471, -0.041691, -0.04404, 0.011259, -0.02554, 0.043104, -0.028504, 0.02179, 0.044813, 0.072343, -0.0054581, -0.068821, -0.027964, -0.043244, -0.0078419, 0.02404, -0.035356, -0.00086043, 0.0096468, 0.029019, 0.067023, 0.05703, -0.043874, -0.075663, -0.046868, -0.018265, -0.0074627, -0.021262, -0.0082441, 0.0029956, -0.0089729, 0.061101, 0.099636, 0.012468, -0.10296, -0.052371, -0.027535, -0.029446, -0.014438, -0.020598, -0.0069193, -0.0068354, 0.046889, 0.095419, 0.11953, -0.07176, -0.097543, -0.038582, -0.011359, 0.0096414, -0.019378, -0.027302, -0.018977, -0.0097874, 0.052494, 0.13674, 0.079523, -0.12204, -0.086659, -0.050788, -0.0095706, -0.031867, 0.0065403, -0.013821, -0.025842, 0.039928, 0.078784, 0.14509, 0.015223, -0.15795, -0.078115, -0.035586, -0.0074434, -0.0031399, -0.0037907, -0.01703, -0.028687, 0.033231, 0.078113, 0.14322, -0.019232, -0.14759, -0.079879, -0.0083759, -0.0013328, -0.0069555, -0.013966, -0.0084517, -0.030636, 0.062565, 0.097484, 0.098393, -0.075766, -0.1345, 0.014089, -0.011156, -0.013224, 0.016021, -0.0092009, -0.026044, -0.0089943, 0.040512, 0.13766, 0.019532, -0.11369, -0.014675, 0.010069, -0.0027238, -0.029504, 0.023985, -0.030692, 0.00075273, 0.016509, 0.052598, 0.093807, -0.010161],
[0.02242, -0.01264, -0.054968, -0.096784, -0.029279, -0.02714, -0.0090863, -0.014365, -0.0036875, 0.046401, 0.069449, 0.046438, 0.054029, -0.014721, -0.062916, -0.098776, -0.045678, -0.010326, 0.0033233, -0.0034084, 0.018489, 0.06168, 0.030027, 0.056348, 0.02544, -0.0079353, -0.09041, -0.1292, -0.034537, -0.018949, -0.0010619, 0.013098, 0.032364, 0.050549, 0.03199, 0.050349, 0.05595, -0.021494, -0.10945, -0.097342, -0.069734, 0.00046789, 0.0088096, 0.021994, 0.002741, 0.039372, 0.046871, 0.065601, 0.050121, -0.016483, -0.12612, -0.1119, -0.047332, -0.017261, 0.012597, -0.007535, 0.0038006, 0.051789, 0.056093, 0.084082, 0.077149, 0.01105, -0.12129, -0.12084, -0.053177, -0.02708, -0.0075679, -0.016071, -0.019008, 0.030912, 0.061183, 0.067858, 0.11649, 0.051234, -0.062048, -0.12296, -0.11728, -0.00044317, -0.0022492, -0.027298, -0.0037413, 0.018339, 0.014062, 0.042777, 0.12122, 0.043922, -0.060791, -0.14711, 0.016829, 0.0097743, -0.026557, 0.01411, 0.0015912, 0.0048096, 0.029094, 0.022041, 0.11057, 0.028481, -0.10628, -0.035908, 0.013354, -0.0026337, 0.0037218, 0.012118, -0.017185, 0.03754, 0.021333, 0.037077, 0.034944, 0.0038125, -0.011495, -0.002531, 0.017794, -0.0060676, 0.0061802, 0.023088, -0.0090738, 0.039517, 0.034463, 0.032449, 0.034403],
[0.0068337, -0.018869, -0.059136, -0.028733, -0.048296, -0.013674, 0.02159, -0.011046, -9.2586e-05, -0.019605, -0.043554, -0.0067654, -0.020683, -0.030702, -0.028849, -0.017813, -0.045032, -0.06082, -0.010178, 0.015937, -0.016985, -0.040648, 0.062809, 0.03329, 0.0086341, -0.010323, -0.059033, -0.063911, -0.040962, -0.027001, -0.03499, -0.028182, -0.042998, 0.06917, 0.043704, 0.052829, 0.047981, -0.062747, -0.078758, -0.075128, -0.067144, -0.066726, -0.041696, -0.06075, 0.024188, 0.068641, 0.041599, 0.078907, 0.083979, -0.0038264, -0.12006, -0.11316, -0.13579, -0.093038, -0.094331, 0.039375, 0.0018503, 0.00098404, 0.043251, 0.1029, 0.10139, 0.098296, 0.0015172, -0.091353, -0.14409, -0.17601, 0.0027217, 0.005046, 0.013052, -0.022684, 0.0018963, 0.058561, 0.10082, 0.12841, 0.081889, 0.020432, -0.041168, -0.0055029, -0.0065943, 0.014863, 0.003731, -0.0055734, -0.0095154, -0.0085635, 0.013253, 0.048733, 0.069683, 0.046721, 0.01748, 0.01314, 0.0057339, -0.012004, 0.023956, -0.030001, 0.047563, 0.007726, 0.033238, 0.017011, 0.061534, 0.020213, 0.017305, 0.0022898, 0.0016835, 0.0010206, 0.017475, -0.01795, 0.0165, -0.011803, 0.0071376, 0.020111, 0.0066511, -0.035355, 0.027934, 0.0035907, -0.011547, 0.022731, 0.0063451, 0.063988, 0.03377, 0.019839, 0.040068],
[-0.091836, -0.046604, -0.041677, -0.03393, -0.035176, -0.0080454, -0.0090217, -0.021214, -0.062925, -0.05369, -0.061859, -0.06938, -0.020604, -0.034831, -0.019889, -0.011468, -0.0094848, -0.02506, -0.013132, -0.034374, -0.029389, -0.054679, -0.040921, -0.079026, -0.031301, -0.0071872, 0.0034458, -0.042066, -0.021032, -0.0012771, -0.005576, -0.049905, -0.067836, -0.02538, -0.060497, -0.095684, -0.066898, -0.065214, -0.042634, -0.077401, -0.069225, -0.046597, -0.048532, -0.039853, 0.058792, 0.01903, -0.024286, -0.032536, -0.054851, -0.02916, -0.01714, -0.025126, -0.021866, 0.028553, 0.039992, 0.097746, 0.075003, 0.074305, 0.046933, 0.098597, 0.06983, 0.076648, 0.055005, 0.03235, 0.096666, 0.010919, 0.022114, 0.052323, -0.012178, -0.010456, -0.01888, 0.00472, 0.002689, 0.018985, -0.0023285, 0.0062287, 0.029915, 0.035545, 0.031167, 0.023817, -0.02707, 0.012571, -0.010192, 0.038028, 0.021584, 0.004171, 0.0055754, 0.017283, 0.012313, 0.014889, 0.0026556, 0.0041491, 0.0089248, -0.035192, 0.014939, 0.014097, 0.0038995, 0.0038989, 0.017267, 0.034244, 0.049764, -0.0052189, 0.026331, 0.0018007, 0.040202, 0.008388, 0.0089671, 0.021012, 0.0053809, 0.011463, -0.0066134, 0.045841, 0.047592, -0.011382, -0.00070927, 0.0074075, 0.0019847, -0.030303, 0.018518, 0.026217, 0.034368],
[-0.027531, -0.04099, -0.026966, -0.012312, -0.039448, -0.036665, -0.037447, -0.022588, -0.062582, -0.033424, -0.0076373, -0.033316, -0.0039483, -0.016274, -0.012993, -0.034373, -0.034351, -0.051089, -0.046268, 0.0338, -0.0073587, 0.019133, -0.058298, -0.031083, 0.0083773, -0.037071, -0.023704, -0.039292, -0.048264, -0.012347, 0.035773, 0.037157, 0.02657, -0.037942, -0.024177, -0.031307, -0.054205, -0.067683, -0.053316, -0.010339, 0.029943, 0.014711, 0.049806, 0.052372, -0.10703, -0.045011, -0.092731, -0.085093, -0.06361, -0.0095235, 0.042742, 0.043444, 0.046036, 0.028779, 0.047907, -0.12009, -0.11013, -0.078798, -0.018737, 0.031174, 0.095075, 0.060365, 0.019221, 0.01389, -0.0076667, 0.016337, -0.0089402, -0.0095031, 0.069645, 0.10401, 0.05246, -0.026938, 0.0042842, -0.010856, 0.016053, -0.028949, 0.00023294, 0.10368, 0.050069, 0.036853, 0.0065038, 0.0055476, -0.0010844, -0.0013257, -0.0055543, 0.04533, 0.0065356, 0.00060779, 0.072039, 0.028969, 0.013967, -0.0072271, 0.0072232, 0.0088564, -0.012818, 0.0018159, -0.011049, 0.0081952, 0.01255, 0.030697, 0.067976, -0.02221, 0.017374, -0.0058382, -0.016933, -0.020607, -0.0037044, 0.0029398, 0.0096079, 0.0041619, 0.051669, 0.0039989, 0.031118, 0.026295, 0.017533, 0.025534, 0.015159, -0.0079481, 0.0038965, -0.0053933, 0.021361],
[0.012976, 0.019239, 0.015861, -0.050084, -0.01483, -0.042429, -0.054637, -0.087876, -0.026659, -0.01559, 0.036899, 0.024659, 0.0020171, 0.017922, -0.027324, -0.01318, -0.055753, -0.049085, -0.02237, -0.0042862, 0.041589, 0.026715, 0.03305, 0.0089521, -0.017401, 0.0075428, -0.059296, -0.055869, -0.05766, -0.042846, 0.014164, 0.016126, 0.045832, -0.034399, 0.024141, -0.034808, -0.040343, -0.071211, -0.066221, -0.021197, 0.040154, 0.026898, 0.041076, 0.013103, -0.054802, -0.036158, -0.02565, -0.031709, -0.071922, 0.0018536, 0.061357, -0.0047183, 0.040749, 0.013386, 0.022021, -0.071345, -0.032751, -0.061368, -0.077484, 0.040235, 0.068103, 0.052652, 0.03711, -0.0069502, 0.0099627, -0.013836, -0.10765, -0.055495, -0.03497, 0.011212, 0.071812, 0.073453, 0.011483, 0.0046876, -0.018293, 0.034171, -0.010281, -0.11953, -0.027929, 0.039183, 0.054784, 0.058364, 0.010348, 0.024383, -0.037225, 0.018329, -0.021362, 0.016318, -0.036989, 0.025345, 0.049929, 0.046243, -0.0049605, 0.003492, -0.044847, 0.0083152, -0.0013348, -0.031795, 0.0084112, 0.042995, 0.01037, 0.032727, 0.017614, -0.01788, 0.013044, 0.0031246, 0.017806, -0.0083911, 0.0067982, -0.013767, 0.056008, 0.046171, -0.0067631, -0.011002, 0.021424, 0.024102, 0.034702, 0.021782, -0.020309, -0.016831, -0.0089978],
[-0.00053289, 0.011812, -0.0097595, -0.0329, -0.040055, -0.087664, -0.054682, -0.012138, 0.0081353, 0.05825, 0.030708, -0.015345, -0.017994, 0.0049204, -0.013879, -0.030835, -0.057101, -0.032671, -0.003775, 0.046975, 0.027796, 0.0092523, -0.018921, -0.017058, -0.0026666, -0.03212, -0.044974, -0.055384, -0.0091233, 0.042053, 0.0059455, 0.0522, 0.013922, -0.019418, -0.0042121, -0.016059, -0.019873, -0.063211, -0.061902, 0.010728, 0.048801, 0.037393, 0.0072674, 0.01281, -0.0034511, 0.016898, -0.02259, -0.062363, -0.060955, 0.018029, 0.071601, 0.039035, 0.020919, 0.016562, -0.023867, -0.027629, -0.029462, -0.055111, -0.068953, -0.031776, 0.038109, 0.032616, -0.0056891, 0.0095691, -0.019287, 0.0062446, -0.028641, -0.044572, -0.056247, -0.03575, 0.073366, 0.067655, 0.026481, -0.022367, -0.0069125, 0.0098899, -0.013395, -0.059838, -0.055071, -0.057235, 0.026937, 0.056778, 0.045512, 0.01049, -0.021873, 0.00025674, -0.0091984, -0.003236, -0.098454, -0.056634, 0.040879, 0.053708, 0.021417, 0.03366, -0.024267, -0.039721, 0.025845, -0.0036737, -0.0019563, -0.092076, 0.0071538, 0.048235, 0.031954, 0.0039891, 0.013124, 0.011507, 0.0048599, -0.02807, -0.013715, 0.0044504, 0.011633, 0.016825, 0.04401, 0.043599, 0.010462, -0.011714, 0.02335, 0.025825, -0.040209, 0.022222, -0.018984],
[-0.00012902, -6.2039e-06, 3.2702e-05, -3.1071e-05, -7.8012e-05, -1.2261e-06, -9.3429e-06, 7.5834e-05, 1.8838e-05, 3.8242e-05, -5.8627e-05, 1.2707e-05, -2.0943e-05, 7.2618e-05, -0.0001086, -2.8985e-05, -0.00016736, 5.8134e-05, 0.00011172, 1.7755e-05, -9.4519e-05, 2.1444e-05, 4.6865e-05, -4.6388e-05, -8.9561e-06, 2.9043e-05, -8.1943e-05, -6.1236e-05, -1.1153e-05, 0.00010189, -2.2193e-05, -2.2869e-05, -0.0001151, -4.9758e-05, -1.9393e-05, -9.4734e-05, -3.0802e-05, -1.1207e-05, -8.8749e-05, 0.00013301, -3.5925e-05, 0.00013742, -0.00011808, 2.2415e-05, 2.3854e-05, -4.5322e-05, 3.4573e-05, -4.6143e-05, -7.5349e-05, 8.1388e-05, 3.3797e-05, 8.4447e-05, -9.0275e-06, 7.0081e-05, -6.146e-05, -5.3968e-05, 2.2718e-05, -0.00015616, -5.6949e-05, -7.4116e-05, -6.3488e-05, 7.5446e-05, 4.4607e-05, -0.0001045, 9.5752e-05, -4.4579e-05, 9.0415e-05, 7.3014e-06, -6.6094e-05, -0.00017393, 0.00014376, 0.00014113, -1.417e-06, 9.806e-06, 6.5253e-05, -0.00013048, 3.4993e-05, -0.00010216, -8.422e-05, -9.7025e-06, -8.5183e-05, -1.8575e-05, 3.8638e-05, 7.925e-05, -9.6774e-05, -6.2754e-05, 0.00014663, 1.7007e-05, 5.5151e-06, -5.1712e-05, -0.00014949, 4.8591e-05, 3.882e-05, 4.357e-05, 1.1474e-05, 7.3157e-05, -3.8172e-06, -6.3708e-05, 7.266e-05, -0.00010594, -6.3345e-05, -5.4025e-05, 8.3061e-05, 0.00010798, -1.84e-05, -4.9804e-05, 3.6573e-05, -4.7482e-05, 1.7943e-05, 4.769e-05, -1.2466e-05, -0.00019635, 2.4802e-06, 0.00015032, 9.532e-05, 2.4342e-05, 8.4135e-06, -1.0238e-05, 1.764e-05, -4.9212e-05, -6.478e-06],
[-2.1082e-05, -8.3621e-05, -7.9324e-05, -5.637e-05, -2.5225e-05, 6.7038e-05, 1.8979e-05, -3.6384e-05, 6.3535e-05, 5.8201e-05, 4.158e-05, -8.0246e-05, -7.7025e-05, 8.0153e-05, -0.00014514, -2.5225e-05, 0.00016502, 2.6271e-05, 2.5316e-05, -6.7103e-05, -1.1804e-05, -3.7281e-05, 5.2411e-06, 1.9188e-06, -4.1461e-05, 2.4848e-05, -0.00010693, 2.6295e-05, 0.00024743, -1.3795e-05, 5.7822e-05, -6.3546e-05, 7.9185e-06, -2.9438e-05, -5.1192e-05, -5.2297e-05, -0.00015826, 4.471e-05, 0.00010007, -1.5725e-05, 0.00011394, -1.2177e-05, -6.2006e-06, 1.6735e-05, -3.2321e-05, 7.0455e-05, -1.1204e-05, -3.7759e-05, -9.6707e-05, 8.528e-05, 0.00010626, -7.906e-05, 8.7526e-05, -6.0073e-05, 2.9006e-06, -2.2316e-05, -6.2577e-05, 5.1835e-05, -7.8179e-05, 2.8747e-05, 9.1197e-05, -8.5285e-05, 1.5505e-05, -4.3118e-05, 5.1102e-05, -2.5996e-05, 9.5403e-06, 5.4456e-05, -0.00012492, -8.4469e-05, -9.0009e-05, 4.6173e-05, 7.1313e-05, -0.00011471, -1.4347e-05, 9.7454e-05, -4.1038e-05, 4.6701e-05, -3.9864e-05, 2.8496e-05, -9.0668e-05, -4.4743e-05, 2.8884e-05, 0.00010541, 3.8505e-05, -0.00015699, 7.3335e-06, 4.9803e-05, 4.7615e-05, 2.1925e-05, -6.863e-05, -0.00015531, -3.1002e-05, 6.3968e-05, -3.1107e-05, 9.1935e-05, 2.6946e-05, -5.4283e-05, 4.0195e-05, -2.9248e-05, 2.7238e-05, 9.8186e-05, -4.2389e-05, 4.3793e-05, 1.6481e-05, 9.6248e-05, -3.3119e-05, 6.7699e-06, 1.8953e-05, 2.9371e-05, 1.8804e-05, -0.00019186, -5.3615e-05, -6.4625e-05, 6.2102e-05, 0.00011143, 2.7598e-05, -2.5795e-05, 6.4102e-06, 4.3683e-06, -6.8056e-06],
[8.7288e-05, -0.00016058, 4.24e-05, -5.4107e-05, 3.0344e-05, 8.8236e-05, 0.00018665, -1.0618e-05, 4.8858e-05, 2.5609e-05, -0.00010411, 7.9334e-05, 0.00011912, -0.00017618, -0.00011562, -0.00015415, 0.00014088, 0.00016468, 0.00011508, -0.0001571, 0.00010763, -9.1181e-05, -5.5087e-05, 5.9474e-06, -8.6291e-05, -0.0001242, -0.00010347, 9.36e-05, 0.00026255, 6.4223e-06, 7.2573e-05, -4.0335e-05, 6.7906e-05, -2.9378e-05, -2.3486e-05, -8.391e-05, -0.00020864, -6.7756e-05, 0.00015157, 0.00017534, 9.5333e-05, -7.862e-05, -1.9996e-05, -3.9619e-05, -0.00010062, -4.9007e-05, -3.336e-05, -6.023e-05, -0.00015274, 5.8063e-05, 0.00017946, -1.3679e-05, -7.8757e-05, 2.3928e-06, -2.3839e-05, -9.2483e-05, 2.977e-05, -0.00014104, -4.8579e-05, -0.00017751, 0.00018735, 0.00010606, 0.00010934, 4.3269e-06, -7.1744e-05, 7.0321e-05, -8.9326e-05, -3.4592e-05, -0.00011019, -0.00019881, 5.2019e-07, 8.541e-05, 0.00020005, -2.2823e-05, -6.6226e-05, -1.4683e-05, -9.083e-05, -7.0533e-05, -4.3155e-06, -6.6612e-05, -0.00012963, -8.4206e-05, 0.00019016, 4.6518e-05, 6.503e-05, 2.5248e-05, 4.9507e-05, 5.4034e-05, -8.5821e-05, -9.1441e-05, -0.00013512, -6.0564e-05, 2.1194e-05, 0.0001521, 0.00017075, -9.0845e-05, 5.4303e-05, 0.0001018, -6.0323e-05, -9.4463e-05, -3.224e-05, -0.0001201, -0.00012404, 4.4631e-05, 5.2507e-05, 0.00017357, -7.696e-06, -2.871e-06, -3.4926e-05, 6.2447e-05, -0.00017904, -2.0437e-05, -0.00018575, -0.00012522, -2.4217e-05, 0.00014052, -8.2035e-07, 8.7476e-05, 2.4935e-05, 6.4846e-05, -6.3934e-05],
[3.5395e-05, -6.8076e-05, -6.0927e-05, -0.00015316, 7.348e-05, 9.7564e-05, -1.245e-05, -1.4501e-05, -7.3971e-05, -4.034e-06, -3.8655e-05, 1.4379e-05, 3.4687e-06, -0.00015845, -7.2931e-05, -0.00011775, 7.4048e-05, 0.00013239, 4.7082e-06, 8.9098e-05, -3.4631e-06, 5.0421e-05, 2.6443e-05, 8.6583e-06, -3.7941e-05, -0.00013987, 4.0145e-05, -5.4758e-05, 2.3031e-05, 1.5356e-05, -7.6915e-07, 2.645e-05, 3.4036e-06, 3.9163e-05, 0.00015363, 3.3088e-05, -0.00016826, -0.00014952, 3.5498e-05, 4.8879e-06, 4.927e-05, 3.2068e-06, 6.9986e-07, -5.7017e-05, 0.00012398, 2.8576e-05, 4.4997e-05, -7.6582e-05, -0.00017982, 7.7914e-05, 9.1821e-05, 2.0136e-05, 5.9721e-05, -9.1171e-06, 2.2421e-05, 9.2992e-05, 1.5505e-05, 7.2487e-05, -8.918e-05, -0.00025973, 3.0932e-05, 9.1342e-05, 2.3131e-05, 1.2247e-05, 4.2369e-05, 5.3252e-05, 0.00012343, 8.7665e-05, 1.294e-05, -8.4931e-05, -0.00012908, -1.2682e-06, 0.00010437, 0.00013645, 1.6058e-05, -4.4318e-05, -7.4065e-05, 8.9411e-05, 4.046e-05, 4.7208e-06, -1.2597e-05, -0.00010568, -9.4992e-05, 2.7651e-05, 7.6097e-05, -1.9995e-06, 6.7764e-05, 3.5255e-05, 3.2643e-05, 2.144e-05, 3.8888e-05, -0.00012811, -0.00019783, -7.7663e-05, 0.00014427, -2.1274e-05, 0.0001232, 1.0103e-05, -1.6055e-05, 5.7715e-05, -5.6047e-05, -1.7521e-05, 2.7609e-05, -0.00021782, -0.00010669, 0.00020792, 0.00011484, 1.3285e-06, 3.8059e-05, -1.2194e-05, 3.8422e-05, 0.00012682, -4.4552e-05, -3.6963e-05, -0.00019868, -7.997e-05, 3.4789e-05, 0.0001943, -9.2258e-06, -2.1814e-07, 7.6669e-05],
[-0.040989, -0.072593, -0.020478, -0.025778, 0.022398, 0.003098, -0.025475, 0.0014983, 0.013473, 0.015344, 0.013699, -0.042586, -0.041387, -0.088633, -0.058018, 0.015074, 0.0039592, -0.0024599, 0.018532, -0.0072521, 0.039351, -0.010584, 0.031659, 0.004946, -0.023228, -0.098922, -0.083752, -0.038393, -0.0084343, 0.0076729, 0.048785, 0.017104, 0.020754, 0.049112, 0.05764, 0.019839, -0.0027111, -0.10015, -0.13202, -0.062978, 0.025824, 0.01588, 0.023625, -0.0046384, 0.026114, 0.091319, 0.15889, 0.077891, 0.095775, -0.1244, -0.14161, -0.07551, -0.02844, 0.021985, 0.015549, -0.0023889, 0.034888, 0.071073, 0.14647, 0.20035, 0.16005, -0.08676, -0.13618, -0.015931, 0.005888, 0.008444, -0.095816, -0.069713, -0.017803, 0.02785, 0.099568, 0.18576, 0.10917, -0.064365, -0.053216, -0.029503, -0.0098623, -0.10681, -0.14826, -0.11347, -0.064061, 0.0027157, 0.09181, 0.11261, 0.043784, -0.02707, -0.022521, -0.010411, -0.062429, -0.078463, -0.099127, -0.097932, -0.053659, 0.020027, 0.097468, 0.045269, 3.4983e-05, 0.00096206, -0.0042047, 0.012971, -0.018376, -0.044257, -0.07615, -0.03979, -0.032111, 0.060509, 0.066025, 0.043696, -0.0062411, 0.0065601, 0.070877, 0.055992, 0.017987, -0.0038242, 0.01131, -0.010488, 0.020902, -0.0025447, 0.059004, -0.013398, 0.0035443],
[0.030346, 0.0060729, -0.039343, 0.015518, 0.026091, 0.057075, -0.007681, -0.0080709, 0.016419, 0.002842, -0.013731, -0.019522, -0.016221, 0.014954, -0.034022, -0.013762, 0.024753, 0.03953, 0.0045833, 0.0083765, 0.036851, 0.055084, -0.056976, -0.029318, -0.025595, -0.020946, -0.05804, -0.013577, -0.010021, -0.0018451, 0.020025, -0.0075917, 0.015631, -0.082666, -0.080551, -0.050441, -0.072777, -0.062636, -0.071289, -0.044269, -0.01929, -0.00063644, 0.035648, 0.0080666, -0.069973, -0.072406, -0.062813, -0.060859, -0.10297, -0.074727, -0.077151, -0.089632, -0.060208, -0.036005, 0.03058, 0.018237, 0.02174, 0.026791, 0.078395, 0.079774, 0.048845, -0.011284, -0.042893, -0.060469, -0.077717, -0.041768, 0.11045, 0.084453, 0.058717, 0.11797, 0.15001, 0.14682, 0.13949, 0.071901, 0.022952, -0.037573, -0.064497, 0.10514, 0.014296, 0.047946, -0.018433, -0.0048603, 0.039432, 0.090925, 0.075278, 0.081171, 0.0073834, 0.00032987, 0.022814, -0.0086828, -0.048521, -0.019109, -0.065561, -0.080183, 0.0032263, -0.00099659, 0.052424, 0.022386, 0.03912, -0.031164, -0.06394, -0.079117, -0.078917, -0.058881, -0.10111, -0.051141, 0.014884, -0.014461, 0.036092, 0.039866, -0.028625, 0.023879, -0.025206, -0.023467, -0.076188, -0.040233, -0.051996, -0.040468, -0.026854, 0.027, 0.070256],
[-0.002803, 0.040759, 4.1768e-06, 0.02026, -0.0059647, 0.05181, 0.026346, 0.012265, -0.010147, -0.033548, -0.019732, -0.0022578, -0.016262, -0.017314, 0.014344, 0.03797, -0.013837, 0.016742, -0.030123, -0.027736, -0.0022683, -0.019176, -0.015693, 0.013114, -0.036321, -0.063043, 0.0049614, -0.036805, -0.037438, -0.023603, -0.0072298, -0.059869, -0.041756, -0.034104, -0.037695, -0.019866, -0.037321, -0.029615, -0.062379, -0.077726, -0.06433, -0.067627, -0.066911, -0.051814, -0.064044, -0.040498, -0.068571, -0.064782, -0.077465, -0.059301, -0.045729, -0.033973, -0.014237, -0.0051404, -0.015748, -0.12091, -0.11592, -0.046036, -0.026967, -0.0013909, 0.070814, 0.069292, 0.071817, 0.074605, 0.095415, 0.10749, -0.095996, -0.0040976, 0.045306, 0.075554, 0.11846, 0.084776, 0.084264, 0.10125, 0.073977, 0.080838, 0.054211, 0.020058, 0.071877, 0.073614, 0.09027, 0.047956, 0.043147, -0.0011986, -0.013094, -0.030256, -0.0095367, 0.016709, 0.061142, 0.081217, 0.010386, 0.037778, -0.018148, -0.02519, -0.047772, -0.061855, -0.053653, -0.051552, -0.034374, 0.019703, 0.040215, 0.0094463, -0.022748, 0.006918, -0.015913, -0.027028, -0.014329, -0.027715, -0.062068, -0.062015, -0.021184, -0.039143, 0.02283, 0.0032039, 0.000343, -0.012231, -0.0032112, -0.025263, -0.0022995, -0.02705, -0.039549],
[0.065221, 0.025071, 0.019912, 0.019313, 0.022457, 0.038123, 0.0055997, -0.012446, -0.020127, -0.019608, -0.05192, -0.0038021, 0.02754, -0.031394, -0.018499, -0.028503, 0.010984, -0.0021915, -0.019643, -0.042421, -0.081508, -0.072244, -0.0017842, -0.010893, -0.00948, -0.0041071, -0.031711, -0.025317, -0.048905, -0.039098, -0.066267, -0.05717, -0.12354, 0.001926, 0.010455, -0.047326, -0.014954, -0.014952, -0.060399, -0.051482, -0.056999, -0.056279, -0.0082532, -0.004728, -0.024889, -0.046325, -0.02707, -0.035511, -0.041562, -0.042411, -0.058674, 0.022288, 0.042564, 0.091511, 0.10753, -0.02319, -0.016617, -0.083807, -0.058259, -0.070742, 0.025574, 0.11914, 0.12549, 0.12136, 0.11708, 0.086423, -0.00030667, -0.03844, -0.049405, -0.092975, -0.03285, 0.10353, 0.14958, 0.086084, 0.035831, 0.024743, 0.036726, -0.0024422, 0.00040113, -0.052519, -0.04457, -0.034619, 0.049819, 0.0024548, 0.026916, 0.00043142, 0.012654, -0.051856, 0.030047, 0.00061641, -0.031155, -0.044323, 0.0045373, -0.0071958, 0.0063658, 0.018539, -0.030331, -0.031774, -0.0088228, -0.015163, -0.058176, -0.0040183, 0.018492, 0.0022898, -0.02563, -0.031897, 0.020493, -0.0060867, 0.0079195, -0.020677, -0.031625, -0.028354, -0.05878, 0.016741, 0.026376, 0.015891, 0.04844, -0.0032501, 0.0044459, -0.016656, 0.0096496],
[0.038712, 0.012491, 0.025252, -0.00063429, 0.035928, 0.023763, 0.040775, -0.023415, -0.04864, -0.050013, -0.064429, 0.02178, 0.049862, -0.018289, 0.03589, 0.020066, 0.049563, 0.0077522, -0.055571, -0.068511, -0.057717, -0.034901, 0.021956, 0.035415, 0.026124, 0.0017095, 0.034316, -0.027522, -0.099289, -0.072699, -0.040034, -0.0025525, -0.0029101, 0.021515, 0.040227, 0.036476, 0.031515, -0.0086616, -0.13841, -0.11459, 0.01045, -0.0035536, 0.071253, 0.042724, 0.0093417, -0.01287, 0.032546, -0.015625, -0.11666, -0.14109, 0.067348, 0.076093, 0.11562, 0.050225, 0.042124, 0.021445, -0.0084783, -0.0121, -0.030956, -0.11121, 0.082861, 0.1479, 0.10501, 0.046748, 0.019903, 0.03052, 0.018229, -0.010089, 0.0013081, -0.046366, 0.04446, 0.10594, 0.079519, 0.01936, -0.0052888, -0.072262, -0.063107, -0.0032667, 0.03186, 0.018646, -0.012065, 0.084958, 0.048023, 0.0056015, -0.071195, -0.070333, -0.10991, -0.11771, 0.019377, 0.026707, 0.073584, 0.054153, 0.025448, 0.0040382, -0.054679, -0.089933, -0.071996, -0.06277, -0.065226, 0.038396, 0.016152, 0.027023, 0.082904, 0.047187, -0.00079516, -0.095891, -0.049462, -0.072305, -0.01168, -0.030194, 0.014156, 0.05086, 0.03919, 0.061499, 0.022736, 0.015951, 0.015999, -0.043223, -0.024248, 0.040112, 0.060525],
[0.0024769, 0.023654, 0.0065905, 0.029715, 0.016982, 0.035002, 0.01506, 0.0023775, 0.015463, 0.0082508, 0.045204, 0.029099, 0.037371, 0.048547, 0.039675, 0.025868, 0.014832, -0.0075821, -0.02093, -0.032499, -0.001802, 0.043938, 0.028726, 0.0010439, 0.042588, 0.017848, 0.0022798, -0.0045873, -0.0088422, -0.040477, -0.084833, -0.075254, -0.04364, 0.048831, 0.031624, 0.01249, -0.044447, -0.023794, -0.094393, -0.072032, -0.064708, -0.064217, -0.11171, -0.09873, 0.034791, -0.0062696, -0.037764, -0.066032, -0.085655, -0.056461, -0.067826, -0.060588, -0.060359, -0.075101, -0.11166, -0.049683, -0.032238, -0.086484, -0.054274, 0.010713, 0.051484, 0.072737, 0.066174, 0.047053, 0.014573, -0.037236, -0.038926, -0.045893, 0.01037, 0.11284, 0.12481, 0.11598, 0.11519, 0.1144, 0.11283, 0.072652, 0.069633, 0.012081, -0.012907, 0.078197, 0.084842, 0.025449, 0.033318, -0.0032467, -0.00077916, 0.019237, 0.040468, 0.081825, 0.032173, 0.0072246, 0.035146, 0.032218, -0.004157, -0.032284, -0.048064, -0.036308, -0.0088796, -0.050648, -0.00021, 0.029706, 0.032099, 0.00779, -0.0059912, -0.037978, -0.032943, -0.074828, -0.086594, -0.070295, -0.021598, -0.034675, 0.03915, 0.016075, 0.0072486, -0.021666, -0.015742, -0.057129, -0.069826, -0.043047, -0.00021744, 0.0031614, -0.005484],
[0.0078584, 0.010418, 0.015826, 0.0278, 0.037504, 0.02189, 0.038405, 0.033824, -0.015111, 0.020273, 0.032943, -0.0012524, -0.020725, -0.012427, 0.015268, 0.015474, 0.021472, 0.031768, 0.012185, 0.0036407, -0.0025327, 0.0078854, -0.042336, -0.056683, -0.026575, -0.028598, -0.042658, -0.041424, -0.036798, -0.038263, 0.0019027, 0.0093814, 0.0084716, -0.045038, -0.075792, -0.059375, -0.061832, -0.043299, -0.043801, -0.051618, -0.065611, -0.047247, -0.057968, -0.0096927, -0.00097814, -0.0011438, -0.032865, -0.035434, -0.072329, -0.040236, -0.06695, -0.082126, -0.062804, -0.081492, -0.067532, 0.094558, 0.05016, 0.085679, 0.046323, 0.055993, 0.048912, 0.031195, -0.0026454, -0.040344, -0.097033, -0.10039, 0.073981, 0.044681, 0.04953, 0.11289, 0.077053, 0.087639, 0.090661, 0.083978, 0.064049, 0.024327, -0.04232, -0.0021389, 0.0059539, 0.0021759, -0.0093588, 0.02429, 0.026077, 0.078773, 0.091982, 0.064361, 0.081984, 0.028646, -0.042605, -0.039659, -0.023542, -0.044811, -0.037047, -0.027701, 0.003355, -0.0131, 0.059271, 0.046282, 0.087355, -0.05379, -0.052156, -0.056795, -0.021944, -0.031144, -0.032409, -0.013571, -0.031194, -0.024378, 0.029149, 0.030673, -0.022978, -0.011077, -0.0055112, -0.016195, -0.010223, -0.0017694, -0.016982, 0.02312, -0.0046449, -0.0051817, -0.022733],
[-0.0090421, 0.017453, -0.017832, -0.0037291, 0.039065, 0.023173, 0.017934, 0.013098, 0.045168, 0.042194, 0.040022, -0.12965, -0.098696, -0.057792, -0.036039, -0.028194, -0.0054252, -0.0069512, 0.0207, -0.027659, 0.015383, 0.029921, -0.10604, -0.13745, -0.10216, -0.082045, -0.062542, -0.0060266, -0.034856, -0.019904, 0.00031968, -0.03239, 0.024398, 0.10509, -0.013047, -0.077744, -0.12223, -0.1125, -0.074496, -0.056697, -0.041104, -0.03665, -0.010932, -0.01645, 0.15622, 0.096727, 0.054042, -0.003099, -0.046208, -0.065923, -0.065579, -0.059507, 0.0088063, -0.037443, -0.017903, 0.092956, 0.14429, 0.15461, 0.10488, 0.07465, 0.031359, -0.044524, -0.028003, -0.074286, -0.017952, -0.023443, 0.00067037, 0.048256, 0.064112, 0.12606, 0.11963, 0.10488, 0.033679, -0.06098, -0.043664, -0.023617, 0.010589, -0.042281, -0.020904, 0.0042455, -0.00023867, 0.036855, 0.064226, 0.058947, -0.0015714, -0.0095707, -0.013148, 0.01221, -0.05139, -0.055206, -0.033651, -0.030728, -0.0069396, -0.011576, 0.0073686, 0.069747, -0.013521, 0.006596, -0.019525, -0.017644, -0.036983, -0.032526, -0.059542, -0.021433, -0.036208, 0.00082772, 0.048327, 0.057951, 0.0015733, 0.0068908, 0.044822, -0.0029222, 0.0015559, 0.015954, -0.0256, 0.047827, 0.0062289, 0.021267, 0.057036, 0.018964, -0.042249],
[0.082567, 0.055833, 0.037656, -0.025001, -0.028413, -0.050162, -0.064109, -0.085323, -0.013537, 0.013709, 0.018599, 0.075347, 0.062559, -0.031285, -0.042803, -0.031429, -0.073827, -0.024222, 0.0076413, 0.024212, -0.059471, -0.03088, 0.067967, 0.040823, 0.010014, -0.076238, -0.0682, -0.03367, 0.0026546, -0.046483, -0.013765, -0.027635, -0.061826, 0.031594, 0.021366, -0.013394, -0.094758, -0.049119, -0.045552, -9.1106e-05, 0.0079383, 0.011255, -0.0065767, -0.047662, 0.044446, -0.00093206, -0.0095391, -0.050733, -0.086831, 0.032526, 0.092702, 0.0094084, -0.023484, 0.0092934, 0.022791, 0.039003, -0.0086098, -0.034768, -0.031884, 0.066429, 0.15091, 0.13216, -0.059201, -0.13696, 0.048045, 0.098721, 0.012407, 0.015257, 0.05201, 0.10321, 0.042459, 0.088724, 0.068939, 0.017008, -0.085318, -0.018126, 0.11519, -0.025017, 0.019451, 0.022495, 0.0526, 0.033867, 0.032217, 0.05936, 0.014141, -0.025091, -0.026683, 0.040958, -0.050856, 0.0049324, -0.00049817, 0.016553, -0.005958, 0.045307, 0.057898, 0.042726, -0.0017969, -0.014382, -0.037002, 0.025111, -0.00016282, 0.024515, 0.021259, 0.024401, 0.036876, 0.039423, 0.040371, -0.00092562, -0.0052629, 0.009327, -0.011241, 0.0019913, -0.025005, -0.0056086, 0.014352, 0.050873, 0.10004, 0.064681, 0.046196, 0.069301, 0.02951],
[0.031888, 0.017285, 0.042745, 0.031228, 0.025514, 0.023254, 0.017245, 0.0091144, 0.061255, 0.028608, -0.017058, 0.03126, -0.022799, -0.027838, -0.031938, -0.0079427, 0.0022782, -0.0029791, 0.014262, -0.011888, 0.1018, 0.01749, -0.02166, -0.0295, -0.017844, -0.0065925, -0.055318, -0.0090733, 0.00041947, -0.056493, -0.073202, -0.046645, 0.062082, -0.031339, -0.06541, -0.02626, -0.028514, 0.010511, 0.026139, 0.033081, 0.01041, 0.0083594, -0.066648, -0.061127, -0.06066, -0.029413, -0.014383, -0.061113, -0.086766, -0.11103, -0.095559, -0.069648, -0.044428, 0.025756, 0.006956, -0.081588, -0.10519, -0.071336, 0.00057042, 0.013813, 0.02671, 0.049812, 0.093582, -0.021925, -0.055498, 0.006515, -0.054554, 0.0083049, 0.13185, 0.12213, 0.011707, -0.025907, -0.02482, 0.054011, 0.13634, 0.12397, -0.0094684, 0.08236, 0.12982, 0.038245, -0.028863, -0.012402, -0.029029, 0.0060992, -0.0040297, -0.046885, -0.0033331, 0.055326, 0.13031, 0.014467, -0.059527, -0.024457, -0.0011607, 0.049887, -0.021189, 0.0053423, 0.019767, -0.075051, 0.055581, 0.11044, 0.071965, -0.090663, -0.035117, 0.048069, 0.041134, 0.083494, 0.029111, 0.031267, -0.039508, 0.027491, 0.092284, 0.066698, 0.0046771, -0.057628, 0.035842, 0.082678, 0.097332, 0.050682, -0.010181, -0.033101, 0.0060053],
[-0.017681, 0.0050575, 0.025216, -0.0050258, -0.057033, -0.052107, -0.045597, -0.0066502, -0.004089, -0.0036027, 0.054265, -0.041055, -0.0014473, 0.034597, 0.060836, 0.029247, -0.07214, -0.079673, 0.0063944, -0.00075079, -0.0024171, 0.00014142, -0.071901, -0.07131, -0.070947, -0.033682, 0.059046, 0.098589, -0.0012454, -0.018862, 0.070385, -0.0038593, -0.035716, -0.028904, 0.022169, -0.005638, 0.015212, -0.077801, -0.029804, 0.019462, 0.066876, 0.074347, 0.075531, -0.047355, 0.038231, -0.014508, -0.088435, -0.10062, 0.067343, 0.024924, -0.092546, -0.014998, 0.02795, 0.066064, 0.02189, 0.13086, 0.090325, -0.051344, -0.10634, 0.041577, 0.18956, 0.15362, -0.1177, -0.063931, 0.053765, 0.012821, 0.16702, 0.091883, 0.046064, 0.02516, 0.071125, 0.035423, -0.0028389, -0.062881, -0.078524, 0.0060489, 0.031324, 0.0578, 0.035259, -0.015526, -0.051491, -0.070998, -0.08834, -0.063258, 0.00058158, -0.016399, 0.063472, 0.059448, -0.072023, -0.020115, 0.01927, 0.043045, 0.00016106, 0.009692, 0.0068556, 0.049381, -0.0045235, 0.032978, 0.031253, 0.0569, 0.028263, 0.035152, 0.035462, 0.039852, 0.019659, 0.033958, -0.01984, 0.059037, 0.009726, -0.014938, 0.019067, 0.070682, 0.067102, 0.069013, 0.010045, -0.0063893, 0.0050956, -0.045818, 0.058781, 0.015059, 0.0093869],
[-0.059247, 0.0021433, 0.0030538, 0.0058555, -0.08563, -0.071756, -0.04245, -0.042689, -0.01111, -0.0079405, 0.027079, -0.027547, 0.039878, -0.032474, -0.046922, 0.033618, -0.034288, -0.043372, 0.041614, -0.043095, -0.010111, 0.022895, 0.075387, 0.009213, -0.088278, 0.037398, -0.0022263, 0.0099245, -0.02003, 0.056811, 0.0073928, -0.078186, -0.0081464, 0.079204, -0.049194, -0.10782, -0.041094, 0.036883, 0.037669, 0.01322, 0.053408, -0.026734, -0.12858, 0.021075, 0.12904, 0.017327, -0.14567, -0.082472, 0.058957, 0.11486, 0.1286, 0.095519, -0.061066, -0.0067977, 0.11055, 0.11156, 0.11891, 0.017852, 0.00062817, -0.0056022, 0.077625, 0.060407, 0.059517, 0.027002, -0.044412, -0.02565, 0.068363, 0.063021, 0.059444, 0.010334, 0.042111, 0.015415, 0.0023344, -0.027063, -0.053547, 0.024499, -0.052268, 0.088857, 0.023558, -0.013779, -0.023579, -0.062755, -0.078234, -0.044287, -0.055979, 0.032155, 0.054401, 0.04823, 0.045141, 0.038705, 0.085911, 0.0043579, 0.012844, 0.010883, 0.028932, 0.064841, 0.008315, 0.028737, 0.052023, 0.033414, -0.001552, 0.042607, 0.022302, 0.022174, -0.019436, -0.00050396, -0.005214, 0.030174, -0.004641, 0.049756, 0.0048322, 0.052626, -0.004347, 0.024476, -0.0014551, 0.0025588, 0.023351, 0.00075945, 0.067061, 0.06672, -0.03618],
[-0.057112, -0.031889, -0.020365, 0.0031374, 0.013437, 0.0059513, 0.0080221, -0.0033222, -0.0048278, -0.026659, -0.062783, -0.076967, -0.033637, 0.02637, 0.0139, 0.041921, 0.05048, 0.040062, 0.044565, 0.0069941, 0.030937, -0.0062436, -0.046321, 0.011237, 0.036259, 0.0082963, -0.10315, -0.12978, -0.10762, -0.028238, 0.077775, 0.057645, 0.020682, 0.015699, 0.023615, -0.041772, -0.12747, -0.031283, -0.012702, -0.031003, -0.053233, -0.11695, 0.019915, 0.030434, 0.034287, -0.042572, -0.084216, 0.069861, -0.012205, -0.018891, 0.01964, 0.077725, -0.080366, -0.015106, 0.034588, 0.11598, -0.02265, -0.10542, 0.064909, -0.0032238, 0.10106, 0.028245, 0.13831, -0.029406, -0.1748, 0.10111, 0.10656, 0.0077236, -0.14344, 0.050109, 0.086716, 0.09309, 0.1245, 0.12884, -0.07042, -0.12323, 0.070753, 0.12051, 0.010234, -0.097733, -0.059331, 0.058783, 0.085326, 0.076776, 0.029787, -0.018648, -0.021041, -0.00034305, 0.084298, 0.056835, 0.053326, -0.039639, -0.0050146, 0.013779, -0.010486, -0.0072346, -0.01195, -0.0025969, -0.039482, 0.09283, 0.042943, -0.0075415, 0.018317, -0.03913, -0.041539, -0.027052, -0.042059, 0.051858, -0.038626, 0.089622, 0.071389, 0.086449, 0.055651, 0.013639, 0.017996, -0.018016, 0.063459, 0.053364, 0.074742, 0.070779, 0.038021],
[0.016782, 0.022184, -0.01761, -0.083789, -0.061012, -0.049437, -0.016011, -0.0012931, 0.0181, 0.042203, 0.091115, -0.030973, -0.0032195, 0.001676, -0.014121, -0.048982, -0.010745, -0.097652, -0.082419, -0.0086676, 0.038493, 0.038422, -0.023684, -0.042571, 0.027674, -0.0045846, -0.029036, -0.014288, -0.036492, -0.073188, -0.058474, 0.061157, 0.037513, -0.044263, 0.03708, 0.008866, 0.00080273, -0.029635, -0.06189, 0.0038986, -0.055589, -0.064826, -0.040454, 0.071936, 0.051468, 0.01663, -0.040009, -0.019116, 0.091905, 0.068371, -0.035382, -0.031696, -0.023951, -0.0394, 0.037638, 0.11971, 0.089542, -0.048322, -0.10362, 0.03196, 0.22708, 0.096993, 0.02671, -0.043789, -0.030431, -0.036199, 0.11281, 0.058354, -0.064975, -0.065781, -0.0084482, 0.091242, 0.12718, 0.076435, 0.052637, -0.011144, -0.036138, 0.069125, 0.013399, 0.029824, -0.0037613, 0.0021896, 0.063412, 0.05214, 0.050386, 0.035325, -0.02123, -0.041481, -0.023404, 0.025149, -0.0071054, 0.029758, 0.0085265, 0.049979, 0.047608, 0.0073875, 0.023178, -0.034372, -0.022118, -0.032551, -0.0095361, 0.023952, 0.0097167, 0.033562, 0.04459, 0.040596, 0.032654, 0.0057649, -0.015195, -0.044827, 0.071208, 0.041893, 0.048927, 0.073828, 0.065245, -0.0017293, 0.05839, 0.046492, -0.044449, 0.0032058, -0.083492],
[-0.021979, 0.04175, 0.036317, 0.019304, 0.043331, 0.039532, -0.036476, 0.012807, 0.022714, 0.026792, 0.017781, 0.021847, 0.035543, 0.022495, -0.019212, 0.046687, 0.032073, -0.028687, -0.068123, 0.0012941, -0.034564, 0.050972, 0.017345, 0.035613, -0.047699, -0.033623, -0.032521, -0.0013901, -0.038202, -0.031763, -0.046961, -0.04907, 0.017435, -0.030703, -0.057162, -0.0037112, 0.0060696, 0.038135, 0.011369, 0.043812, -0.034218, -0.053541, -0.039937, -0.06177, -0.03524, 0.001645, -0.019801, -0.07722, -0.075502, -0.087592, -0.11013, -0.061233, -0.03823, -0.064265, -0.052615, -0.023206, 0.011035, -0.0009788, 0.015272, 0.010027, 0.057985, 0.070841, 0.019039, -0.041762, -0.15551, -0.076282, 0.017047, 0.093015, 0.093581, 0.043403, 0.0066461, -0.028933, 0.071469, 0.099203, 0.16738, 0.069044, -0.077497, 0.099573, 0.048571, -0.064145, -0.017709, -0.033773, -0.03677, 0.021125, -0.032531, 0.01618, 0.090578, 0.10585, 0.10394, -0.039147, -0.030448, -0.0058756, 0.0049201, 0.065015, 0.02356, 0.0086862, -0.066304, -0.0023589, 0.10485, 0.041244, -0.0046939, -0.050266, 0.079897, 0.051812, 0.059364, 0.063039, -0.0096554, -0.069243, -0.047052, 0.071058, -0.034427, 0.033352, -0.038713, 0.040541, 0.067514, 0.082806, 0.10708, 0.017928, 0.0011601, -0.043674, 0.12867],
[-0.051872, -0.019281, -0.054683, 0.00094479, -0.013017, -0.01289, -0.035617, 0.0014515, 0.042883, -0.01052, 0.0075578, -0.022058, -0.029115, 0.0012529, 0.023269, -0.067475, -0.039425, 0.047183, 0.018571, -0.031453, -0.0042628, -0.065391, -0.06231, -0.00018351, 0.034076, 0.020712, -0.015816, 0.036106, -0.0057176, -0.0078035, 0.022002, -0.075063, -0.056833, -0.078488, 0.053315, 0.089792, 0.06558, -0.020138, -0.069355, -0.0129, 0.067494, 0.0052092, -0.0050446, -0.034013, -0.049221, 0.036993, 0.073527, 0.023627, -0.12669, -0.04993, 0.13709, -0.043083, -0.11283, -0.022958, -0.01638, -0.06148, 0.083723, 0.026146, -0.1093, 0.093485, 0.21229, 0.12152, -0.0085143, -0.11195, 0.008757, 0.11393, -0.058279, -0.0080422, -0.0037128, -0.090611, -0.02375, -0.0033262, 0.051599, 0.11795, 0.052188, 0.05104, 0.13056, -0.012214, 0.036432, 0.036671, -0.0078012, -0.080637, -0.098442, -0.035088, -0.032649, -0.016985, -0.027536, 0.061159, -0.0051669, 0.054347, 0.045747, 0.064739, 0.049553, 0.018862, 0.048983, 0.062542, 0.0072515, -0.023347, -0.075602, -0.057354, -0.017631, 0.022946, 0.090873, 0.0042985, 0.028246, 0.0087607, 0.074352, 0.035005, 0.031603, 0.034524, -0.07659, -0.017921, 0.0062989, -0.013815, 0.080616, 0.019782, 0.075648, 0.04319, 0.074149, 0.0477, 0.08084],
[0.026722, 0.011659, -0.030401, -0.078934, -0.025083, -0.051258, -0.063738, -0.045361, -0.0072455, -0.0016165, -0.089855, 0.0097208, 0.032567, -0.063546, 0.0040587, -0.01178, 0.046622, -0.0061913, -0.00040806, -0.038285, -0.045803, 0.00013567, 0.071841, -0.0035185, -0.054904, 0.029242, -0.016896, -0.018745, 0.075717, 0.019648, -0.043886, -0.018293, 0.029237, 0.079481, -0.10679, -0.13519, -0.0021618, 0.057839, 0.046853, 0.010614, 0.03944, -0.092858, -0.054138, 0.041015, 0.063451, 0.04747, -0.11151, 0.024333, 0.10457, 0.11493, 0.064349, 0.02496, -0.12313, -0.035728, 0.056358, 0.035122, 0.040853, 0.0048171, -0.018878, 0.063834, 0.099594, 0.10457, -0.0059324, 0.051541, 0.043792, 0.066822, -0.022981, 0.012624, -0.027434, -0.03732, -0.040761, 0.0054311, 0.077857, 0.061026, 0.062914, 0.039279, 0.051551, 0.068228, 0.053793, 0.033116, -0.087231, -0.062413, -0.082179, -0.049408, -0.05136, 0.017042, 0.0083053, 0.057973, 0.049273, 0.050549, 0.05419, 0.076357, -0.02016, -0.014968, -0.0083188, 0.032399, 0.029725, 0.081168, 0.0010767, 0.0031321, 0.039599, 0.032665, -0.0076124, 0.01439, -0.024144, 0.015901, 0.036463, 0.0059983, 0.0073771, 0.068758, 0.001845, 0.058983, 0.061023, 0.019189, 0.052229, 0.022904, 0.0093546, -0.022264, 0.028743, 0.031821, 0.031025],
[-0.024932, 0.0067371, -0.0073915, 0.017497, 0.023423, -0.0094929, -0.02194, 0.00025349, -0.041633, -0.04628, -0.067789, -0.024674, -0.029908, -0.0063449, 0.038828, 0.068463, 0.027205, 0.034295, 0.020017, -0.044148, -0.059872, -0.051482, 0.011124, 0.016763, 0.050887, 0.025498, -0.093955, -0.092391, -0.032479, 0.034463, 0.059969, 0.025585, -0.054354, -0.021502, 0.051547, -0.034008, -0.10294, -0.068214, -0.036091, -0.035862, -0.06695, -0.078867, 0.01349, -0.0092992, 0.051242, 0.063155, -0.057574, 0.01889, -0.042698, 0.0063897, 0.035994, 0.10789, -0.06818, -0.075882, -0.019748, 0.10736, -0.038698, -0.15857, 0.077712, 0.0027822, 0.033503, 0.044529, 0.1147, 0.037629, -0.11802, 0.089816, 0.14095, -0.021945, -0.18628, 0.057227, 0.17885, 0.12351, 0.032873, 0.13094, -0.079054, -0.098874, 0.071037, 0.024172, 0.04436, -0.051013, -0.039066, 0.10491, 0.12042, 0.1636, -0.0083142, -0.029805, -0.023079, 0.05985, -0.035424, -0.02533, -0.034243, -0.063442, -0.046964, 0.00071816, 0.022784, 0.0091086, 0.017544, 0.028538, 0.080903, 0.062288, 0.04819, 0.021557, -0.022313, -0.091204, -0.048678, -0.018881, 0.023198, 0.011883, 0.040745, 0.055218, 0.075292, 0.12951, 0.034067, 0.055263, 0.00092956, 0.0025829, -0.012623, 0.045045, 0.035721, 0.073251, 0.09494],
[-0.054694, -0.036142, 0.01214, -0.015154, 0.0068463, -0.0093137, -0.048684, -0.04943, -0.041065, -0.077254, -0.05266, 0.02644, -0.035826, 0.00018949, 0.020886, -0.00065949, 0.022071, 0.0040314, -0.035333, -0.028227, -0.018098, -0.020234, 0.015321, -0.0014404, 0.01118, 0.01148, 0.050415, 0.011826, -0.0058862, -0.010693, -0.052712, -0.039587, -0.015153, 0.021776, 0.018485, 0.017271, 0.025545, 0.0035527, -0.0072077, -0.016928, 0.010103, -0.011397, -0.054136, -0.0087759, 0.045429, 0.026079, 0.018401, -0.010305, 0.031175, -0.022965, 0.0073488, -0.033665, 0.0040173, 0.00073106, 0.00092921, 0.038456, 0.051027, 0.032164, 0.0030919, -0.018051, -0.037581, -0.042983, -0.032974, 0.0034357, -0.0029191, 0.049102, 0.045968, 0.037533, 0.053552, 0.0025191, -0.047509, -0.072789, -0.064427, -0.041221, -0.026781, 0.045893, 0.043427, 0.063353, 0.057676, 0.04031, 0.041067, -0.051029, -0.081223, -0.10623, -0.040384, 0.012699, 0.02785, 0.073423, 0.013872, 0.086837, 0.078231, 0.025402, -0.0085959, -0.10094, -0.079771, -0.089308, 0.015198, 0.061289, 0.065949, 0.041036, 0.059558, 0.080006, 0.074883, -0.014113, -0.032421, -0.11385, -0.10292, -0.012981, 0.05222, 0.12083, 0.10605, 0.086255, 0.083214, 0.048515, 0.044244, -0.042579, -0.1003, -0.1041, -0.086308, 0.033369, 0.16061],
[0.12274, 0.042815, 0.018062, 0.0053062, 0.035824, 0.010649, 0.016551, 0.0149, 0.067444, 0.0014206, 0.017061, 0.10626, 0.03566, 0.0027511, -0.012308, -0.013786, -0.051328, -0.086, 0.051803, 0.039048, 0.047854, -0.026266, 0.030741, 0.039407, -0.0082192, 0.009945, -0.011589, -0.069863, -0.071219, 0.02673, 0.064361, 0.049962, -0.024026, 0.063809, -0.014374, 0.023605, -0.042857, -0.030014, -0.098897, -0.043739, 0.034309, 0.071348, 0.037614, -0.0008217, 0.020111, -0.0023311, -0.015928, -0.024232, -0.12213, -0.077412, 0.003285, -0.010022, 0.084367, 0.068284, 0.02711, -0.034521, 0.0059706, -0.054405, -0.058783, -0.10071, 0.0067298, 0.052326, 0.021602, 0.033366, 0.06045, 0.028672, -0.069276, -0.046529, -0.071031, -0.068872, 0.046654, 0.13894, 0.088207, 0.009134, 0.033848, 0.047381, 0.043418, -0.099683, -0.072929, -0.076421, 0.030782, 0.14194, 0.10541, 0.050344, 0.042628, 0.0019869, 0.0029129, 0.033418, -0.10626, -0.089797, -0.012631, 0.10656, 0.081787, 0.015706, -0.0081475, 0.017962, -0.0076821, -0.018533, -0.025747, -0.068636, -0.016417, 0.052027, 0.084415, -0.031666, -0.081385, -0.042068, 0.00053002, -0.034028, -0.036058, -0.094127, -0.028724, 0.036956, 0.11399, 0.047784, -0.084618, -0.1042, -0.096931, -0.038842, -0.019078, -0.04597, -0.10436],
[0.065758, 0.074778, 0.018293, 0.028173, -0.0089483, -0.052546, -0.10879, -0.039787, 0.003021, 0.043862, 0.020559, 0.044706, 0.012785, 0.016258, -0.038127, -0.037498, -0.11769, -0.048823, 0.039098, 0.067056, 0.0755, 0.076146, -0.041032, 0.015972, -0.037661, -0.038829, -0.10585, -0.049772, 0.0044956, 0.11402, 0.09097, 0.082806, 0.059837, -0.013125, -0.02906, -0.0085932, -0.055642, -0.085865, -0.010732, 0.12911, 0.033631, 0.034969, 0.022613, 0.023084, -0.026127, -0.036556, -0.034549, -0.0096972, -0.039485, 0.044564, 0.10334, -0.022991, -0.068462, -0.026651, -0.042353, -0.063143, -0.03867, -0.032191, 0.0024621, 0.033854, 0.10018, 0.03905, -0.14322, -0.067922, -0.083174, -0.086986, -0.049997, -0.069642, -0.017581, 0.045667, 0.064475, 0.066381, 0.049759, -0.16688, -0.10148, -0.045652, -0.025089, -0.04692, -0.063091, 0.0092457, 0.038333, 0.061578, 0.05623, 0.077373, 0.043186, -0.038313, 0.011392, 0.029086, -0.087358, -0.045745, 0.035034, 0.038753, 0.010285, -0.017746, 0.011579, 0.10678, 0.12921, 0.062105, 0.031615, -0.035992, -0.035806, 0.032429, 0.01335, -0.00025562, -0.0075837, -0.05781, -0.02738, 0.077504, 0.13304, 0.070152, -0.018705, -0.015887, -0.012406, -0.036315, -0.05746, -0.034056, -0.071575, -0.0683, 0.0017292, 0.060839, 0.15051],
[-0.12025, -0.096169, -0.017372, 0.11248, 0.14311, 0.082528, 0.041, -0.0022277, 0.010468, 0.02376, -0.028258, -0.084469, -0.063106, 0.034558, 0.08054, 0.030927, -0.055932, -0.023595, -0.021308, -0.063108, -0.073253, -0.058339, -0.045166, 0.026985, 0.084702, 0.041281, -0.12024, -0.10043, -0.049765, -0.027095, -0.010458, -0.089462, -0.12894, -0.010214, 0.05398, 0.069469, 0.12953, -0.14182, -0.14285, -0.052861, 0.063969, 0.053939, -0.022029, -0.10819, 0.016492, 0.038639, 0.024021, 0.065593, 0.16113, 0.023615, 0.043352, 0.0076979, 0.043112, 0.00071988, -0.045961, -0.0069127, -0.0077205, -0.031892, -0.017037, 0.035037, 0.16303, 0.17418, 0.057001, 0.022916, -0.010513, -0.052886, -0.004313, -0.0018885, -0.04479, -0.03232, -0.048961, -0.0094053, 0.052253, 0.14016, 0.040657, 0.024408, 0.029986, -0.033973, -0.017547, -0.037345, -0.061376, -0.039373, -0.054467, 0.037877, 0.098581, 0.089151, 0.012958, 0.027625, -0.0058828, -0.057087, 0.00032845, -0.03784, -0.033696, 0.025913, -0.017025, 0.067748, 0.06453, 0.059856, -0.0040795, -0.064492, -0.022927, -0.068257, -0.038787, 0.015689, 5.5172e-05, 0.032388, 0.053502, 0.062621, 0.011267, -0.03949, -0.094319, -0.047548, -0.0091541, -0.048201, -0.012241, 0.0012541, 0.016596, 0.020434, 0.0367, -0.0026055, -0.03918],
[-0.039044, -0.014032, -0.017175, -0.041782, -0.059374, -0.0085344, -0.0163, -0.037295, -0.01755, -0.078448, -0.02004, -0.056769, -0.059967, -0.049253, -0.069472, -0.071903, -0.044718, -0.036365, -0.0034412, -0.046411, -0.02859, -0.083768, 0.095116, 0.062452, -0.024834, -0.097859, -0.1128, -0.088068, -0.088836, -0.068545, 0.0011511, 0.068272, 0.080894, 0.13533, 0.18058, 0.089393, -0.037713, -0.18005, -0.1676, -0.11135, -0.046002, 0.067488, 0.16041, 0.16021, 0.032243, 0.072927, 0.12673, 0.076775, -0.027586, -0.060585, -0.065958, 0.046189, 0.064053, 0.066545, 0.046954, 0.0044609, 0.0091618, 0.04196, 0.090849, 0.099019, 0.090334, 0.067826, 0.012714, -0.0052083, 0.011532, 0.046913, -0.0026789, 0.028085, 0.027041, 0.015104, 0.059853, 0.032101, 0.025279, -0.0455, -0.0092655, 0.032696, 0.0058023, -0.0018139, -0.0029109, 0.010427, -9.6032e-05, 0.021289, 0.04108, 0.016357, -0.032396, -0.0096468, -0.015147, 0.013413, -0.0013428, 0.038224, -0.013377, 0.026456, 0.0224, 0.0083204, 0.0021987, -0.014294, -0.011198, -0.025765, -0.0044403, 0.026453, -0.016392, -0.011847, -0.030835, 0.0092711, 0.0079232, 0.015034, -0.027786, -0.033709, -0.015542, 0.00048635, -0.026695, -0.012725, -0.013287, -0.042306, -0.033424, 0.0087293, -0.030243, -0.013051, -0.037604, -0.048538, -0.061784],
[-0.064896, -0.020224, 0.015905, 0.013552, 0.082226, 0.052591, 0.042258, 0.070648, -0.0011992, -0.034367, -0.072361, -0.056224, -0.046255, -0.030585, -0.034996, -0.043018, -0.074117, -0.058193, 0.099175, 0.085979, 0.026079, -0.090336, -0.10363, -0.05683, -0.032955, -0.035953, -0.08367, -0.14307, -0.17021, 0.05656, 0.13539, 0.11265, 0.011674, -0.065806, -0.015917, 0.049372, 0.032602, -0.023482, -0.14885, -0.14122, 0.038948, 0.090755, 0.11462, 0.049233, -0.020681, 0.0059189, 0.048036, 0.048757, 0.01503, -0.0045823, 0.044145, 0.050072, 0.009451, 0.024379, 0.052749, 0.006439, -0.0002812, -0.0064547, 0.067242, 0.14642, 0.12089, 0.045524, -0.027904, -0.020728, 0.011973, 0.02314, 0.062288, 0.0030853, -0.010563, 0.054746, 0.10799, 0.014816, -0.067729, -0.069429, -0.039673, 0.0072945, 0.031666, 0.077903, 0.033144, -0.01109, 0.025953, 0.040729, 0.015524, -0.02128, -0.074601, -0.032635, -0.040767, 0.029069, 0.050404, 0.016601, 0.0082563, 0.040076, 0.031009, 0.021258, -0.0026365, -0.025393, -0.0401, -0.051105, -0.067993, -0.00046433, -0.0039876, 0.022729, 0.039556, 0.05383, -0.0014414, 0.037268, -0.022232, -0.03405, -0.073952, -0.043558, 0.0063279, -0.079884, -0.051796, -0.012968, 0.01677, 0.039339, -0.014907, -0.021083, 0.00037446, -0.082723, -0.10307],
[-0.037003, -0.051801, -0.060853, -0.009415, -0.034328, 0.0033826, 0.012447, 0.028264, 0.051241, 0.029467, 0.094296, 0.017996, 0.074495, 0.018562, 0.0011775, -0.033436, -0.035846, -0.0247, -0.024949, -0.024856, 0.022655, 0.01397, -0.015621, 0.084344, 0.12526, 0.058408, 0.045127, -0.043164, -0.1024, -0.096781, 0.0053916, -0.033844, -0.012658, 0.0013785, 0.011573, 0.068403, 0.052981, 0.12667, 0.035046, -0.06896, -0.060072, -0.062721, -0.03001, -0.0092089, -0.053346, -0.051522, -0.019671, -0.055874, 0.041979, 0.16389, 0.0010636, -0.05391, -0.068154, -0.055293, -0.039462, -0.095726, -0.092291, -0.11339, -0.13838, -0.035746, 0.22607, 0.12814, -0.0024482, -0.033611, -0.051839, -0.084236, -0.029032, -0.058899, -0.11075, -0.15312, -0.020725, 0.16843, 0.12744, 0.080332, 0.021566, -0.082353, -0.069018, 0.049857, 0.040106, -0.055334, -0.042096, 0.066709, 0.04242, 0.069012, 0.079984, 0.034372, -0.017332, -0.083009, 0.042454, 0.051061, 0.073169, 0.10111, 0.015416, -0.074122, 0.037506, 0.056372, 0.069803, 0.02283, -0.088476, 0.056381, 0.11797, 0.08516, 0.0057507, -0.05215, 0.00071341, -0.033052, 0.042466, 0.066153, 0.041059, -0.074912, 0.059833, 0.050036, 0.073439, -0.035055, -0.043214, -0.028434, -0.049723, -0.042469, 0.0058212, 0.0033814, -0.06458],
[-0.052049, -0.057238, -0.0083906, 0.0062458, 0.035747, 0.078399, 0.078852, 0.065079, 0.051674, 0.056599, 0.11124, -0.049452, -0.033113, -0.044704, -0.0069392, -0.023795, 0.010055, 0.051862, 0.032051, 0.0034551, 0.060343, 0.071821, -0.011974, -0.026068, -0.020183, -0.01395, -0.050699, -0.020356, 0.029015, 0.044993, 0.041705, 0.033988, 0.042094, -0.031293, 0.022301, -0.017436, 0.0086405, -0.033429, -0.059144, 0.0055853, 0.0041508, 0.049461, 0.05086, 0.079934, 0.0095959, 0.025688, 0.00556, 0.013382, -0.058014, -0.0895, -0.071592, -0.019107, -0.0082745, 0.032585, 0.046701, -0.0096068, -0.020513, -0.0038438, 0.014614, 0.068186, -0.01831, -0.11323, -0.096406, -0.052403, 0.027222, 0.030318, 0.019657, -0.00966, -0.018627, 0.0081908, 0.1218, 0.15081, 0.075807, -0.062761, -0.10013, -0.068245, -0.022266, 0.00065584, -0.015209, 0.018867, 0.0052685, 0.065684, 0.10987, 0.14929, 0.059435, -0.060186, -0.089355, -0.066217, -0.023536, -0.054962, -0.059013, 0.01999, 0.0054003, 0.032463, 0.045867, 0.10506, 0.055756, -0.05989, -0.092316, -0.071619, -0.075031, -0.062254, -0.046947, -0.048116, -0.036582, -0.061107, 0.036505, 0.10111, 0.051178, -0.044432, -0.10159, -0.077159, -0.030393, -0.050071, -0.074596, -0.073459, -0.078358, -0.030279, 0.084454, 0.12337, 0.062469],
[0.11115, 0.051561, -0.019027, -0.053735, -0.0071101, -0.060332, -0.012734, -0.083914, -0.0068743, 0.03645, 0.057484, 0.10199, 0.082977, 0.018624, -0.020037, -0.058992, -0.0043094, -0.061801, -0.032137, -0.019998, 0.029478, 0.093322, 0.070136, 0.05702, 0.0539, -0.0026388, -0.0087945, -0.044887, -0.031767, -0.042174, -0.032508, 0.034115, 0.093106, 0.018637, 0.046736, 0.021858, 0.027569, -0.0019748, -0.020011, -0.038263, -0.041761, -0.030815, 0.028817, 0.071787, -0.0097081, 0.040408, 0.047903, 0.049152, 0.016182, -0.017239, -0.040469, -0.045703, -0.016282, 0.0034546, 0.034807, -0.018386, 0.019694, 0.067999, 0.064831, -0.014465, 0.011125, -0.06123, -0.076621, -0.023624, -0.0028778, 0.037589, -0.069263, 0.003136, 0.057378, 0.052692, 0.0174, -0.01857, -0.046214, -0.066633, 0.0049373, -0.0038829, 0.025714, -0.083379, 0.0056691, 0.11608, 0.073533, 0.038227, -0.077119, -0.055463, -0.043043, -0.019189, 0.017298, -0.023171, -0.097271, 0.026385, 0.084669, 0.092505, 0.016711, -0.044363, -0.045451, -0.049551, 0.013625, 0.020562, -0.030007, -0.063981, 0.075872, 0.05312, 0.065924, 0.031466, -0.012256, -0.031399, -0.018769, -0.040221, -0.0015619, -0.0069604, 0.060783, 0.075569, 0.052256, 0.07814, 0.038095, 0.052435, 0.048884, -0.055026, -0.045282, -0.041013, 0.099044],
[-0.11204, -0.039742, 0.01106, 0.068772, 0.091947, 0.063013, 0.053208, 0.020539, 0.038057, 0.038787, 0.028122, -0.04492, -0.028946, 0.03825, 0.064449, 0.074567, 0.056118, 0.057712, -0.019732, 0.012263, 0.0040348, 0.043114, 0.0036262, 0.040929, 0.05322, 0.046769, -0.017166, 0.0054891, -0.020481, -0.022929, -0.019377, -0.050393, -0.028341, 0.044369, 0.034906, -0.011072, -0.065544, -0.057326, -0.098654, -0.021151, -0.038971, -0.051955, -0.065697, -0.076669, 0.057537, 0.0059026, -0.046204, -0.082611, -0.084852, -0.079141, -0.097004, -0.076062, -0.063164, -0.083321, -0.057461, 0.027801, -0.018768, -0.029692, -0.014541, 0.083906, 0.20739, 0.0467, -0.060572, -0.13038, -0.13805, -0.12359, 0.0074711, -0.022238, -0.0067832, 0.00050857, 0.12335, 0.15023, 0.24256, 0.13265, -0.036349, -0.096342, -0.1238, -0.0059223, 0.0092529, -0.0086414, 0.014912, -0.006971, 0.062192, 0.048857, 0.099736, 0.10383, -0.0017267, -0.03338, -0.041016, 0.028075, -0.024175, 0.00037852, 0.02829, -0.017178, 0.012211, 0.021091, 0.048801, 0.058893, 0.041186, -0.050228, -0.063589, -0.016279, -0.0047557, 0.019166, -0.004286, 0.072221, 0.027668, 0.0076072, 0.046252, 0.045328, -0.058087, -0.052569, -0.044762, -0.023156, -0.00017763, 0.05236, 0.017613, 0.026754, -0.0071592, 0.02145, 0.026061],
[0.074443, 0.02501, -0.0072387, -0.034581, 0.0075069, 0.050532, 0.097729, 0.10515, -0.0020886, -0.064607, -0.071901, 0.06271, 0.04811, -0.0061288, -0.048708, -0.028878, 0.049283, 0.10301, 0.091885, 0.10831, -0.0069202, -0.07108, -0.032385, -0.041457, -0.037318, -0.037271, -0.040336, -0.030542, 0.027846, 0.051126, 0.039458, 0.061534, -0.0088597, -0.058003, -0.036151, -0.039854, -0.04856, -0.058763, -0.083102, -0.091876, -0.077267, 0.00086207, 0.064568, 0.051764, -0.087357, -0.053385, -0.019429, -0.023415, -0.08563, -0.12611, -0.086692, -0.12449, -0.055126, 0.030267, 0.083602, -0.12584, -0.091278, -0.07353, -0.085046, 0.01189, 0.13738, 0.12692, -0.020512, -0.083332, -0.045688, 0.094722, -0.11768, -0.11561, -0.06055, 0.081985, 0.17044, 0.11966, 0.11254, 0.074741, -0.025738, -0.033587, 0.034114, 0.051553, -0.020223, 0.04569, 0.056071, 0.020998, 0.044562, 0.029391, 0.026725, 0.013325, -0.019773, 0.0027476, 0.12423, 0.04555, 0.018947, 0.005724, -0.0058699, 0.005037, 0.043724, 0.019509, -0.0018888, -0.0096177, -0.0132, 0.10144, 0.085182, -0.01332, 0.0029189, 0.010088, 0.0094933, 0.01793, 0.031407, 0.011734, -0.050901, -0.015736, 0.029231, 0.048512, 0.013899, -0.031158, -0.040662, -0.0083011, 0.043045, -0.010968, -0.0012439, -0.022627, -0.11766],
[-0.039873, 0.00012185, 0.018432, -0.060305, 0.014643, 0.012981, -0.0070294, -0.055625, -0.011913, 0.0084125, 0.010421, 0.014232, 0.0046832, 0.03282, 0.013207, -0.023534, -0.011405, -0.042582, -0.018915, -0.049511, -0.018366, -0.0058433, 0.022316, 0.021335, 0.034666, 0.06001, -0.034246, -0.047005, -0.047922, -0.041049, -0.026714, -0.03879, -0.018331, 0.037977, 0.028814, 0.01977, 0.037289, -0.066963, -0.10295, -0.090035, -0.060416, -0.030822, 0.024013, -0.023616, 0.014618, 0.0051973, -0.0053409, 0.019717, -0.078767, -0.029297, -0.02328, -0.014403, -0.0092264, -0.033409, -0.020726, -0.035932, -0.02301, -0.039252, -0.016761, 0.053608, 0.1333, 0.1649, 0.090281, 0.04523, 0.017404, 0.013598, -0.047298, -0.067622, -0.027196, 0.065506, 0.022326, 0.046886, 0.043069, 0.12018, 0.084303, 0.020672, 0.020185, -0.071051, -0.079542, -0.016269, 0.033355, 0.028706, -0.012012, -0.015403, 0.031358, 0.10477, 0.0025587, 0.021109, -0.039308, -0.093768, -0.022121, 0.023658, 0.0016241, 0.011496, -0.039667, 0.01091, 0.063816, 0.062965, 0.011666, -0.024049, -0.0027909, -0.053242, -0.014763, -0.009588, -0.031087, -0.030645, 0.010272, 0.037482, 0.060317, 0.024907, -0.0456, -0.020358, -0.062106, 0.036987, -0.038453, -0.044857, -0.034311, -0.011784, 0.018763, 0.061657, 0.040804],
[-0.030967, -0.034705, -0.030029, -0.073209, -0.048949, -0.038641, 0.051475, 0.074237, 0.11135, 0.076704, 0.047486, -0.068456, -0.035129, -0.0025322, -0.057134, -0.053441, 0.017149, 0.05211, 0.058782, 0.047057, 0.040322, 0.007803, -0.056083, -0.046847, -0.0065577, 0.015471, 0.0066615, 0.05262, 0.00019301, 0.077547, 0.050314, -0.024569, 0.034663, -0.004403, -0.038893, 0.018694, 0.035428, 0.060686, 0.058741, 0.0014872, -0.045756, -0.047945, -0.092818, -0.021044, 0.0075622, 0.0087803, 0.024403, -0.018245, 0.0056819, -0.12201, -0.11278, -0.054719, -0.090167, -0.032775, -0.07964, -0.0081433, 0.036416, -0.029719, -0.083432, -0.09701, -0.078382, -0.061852, -0.023646, -0.040448, -0.078556, -0.035219, -0.027449, -0.0024222, -0.0086514, -0.069056, -0.046264, -0.026684, 0.0085151, 0.015105, 0.031314, 0.036056, 0.025591, 0.0051354, -0.023005, 0.021047, -0.014202, -0.043602, 0.014084, 0.047988, 0.0040769, 0.04007, 0.031368, 0.041402, 0.0083542, 0.053524, 0.038347, -0.0075355, 0.033837, 0.037702, 0.023171, 0.00063875, 0.022457, 0.058804, 0.033466, 0.011934, -0.0031203, 0.016069, 0.037622, -0.010943, 0.046299, -0.0027638, 4.2317e-06, -0.0038944, 0.0096576, -0.01851, -0.054006, 0.017238, 0.0091597, 0.028997, 0.033953, 0.070753, 0.003781, 0.0272, 0.009142, 0.027115, 0.01271],
[-0.059222, -0.0013807, 0.027613, 0.10527, 0.056162, 0.063382, 0.0052814, 0.022701, 0.023071, 0.011641, 0.037101, -0.096537, -0.037975, 0.00038733, 0.050625, 0.065087, 0.0010273, 0.010303, 0.0050328, 0.050959, 0.053162, 0.030888, -0.021359, -0.030127, 0.014336, 0.044082, 0.045143, 0.013943, -0.07448, -0.021195, 0.010166, 0.028012, -0.022729, -0.03377, 0.0042314, 0.022687, 0.046542, 0.1131, -0.0045052, 0.072384, 0.037892, 0.04464, 0.053305, 0.055298, -0.02526, 0.023523, 0.029551, -0.057104, -0.037228, -0.040335, -0.066002, 0.051806, 0.090921, 0.015823, -0.038665, 0.0092907, -0.028826, -0.074981, -0.057874, -0.10796, -0.046546, -0.11182, -0.10192, -0.085702, -0.093906, -0.14398, -0.056829, -0.066264, -0.071883, -0.05541, -0.0092823, 0.0018364, -0.0066183, -0.011825, -0.09252, -0.088262, 0.0069521, -0.025393, -0.0063947, -0.043362, -0.022174, 0.0077219, -0.025334, -0.0083153, 0.037371, 0.012799, 0.015685, -0.0096592, -0.0057849, -0.010757, 0.017757, 0.04453, 0.0041941, 0.054645, 0.03971, 0.033911, 0.065272, 0.03489, 0.095387, 0.012474, -0.0089935, 0.04438, 0.030765, 0.018887, 0.031788, 0.031674, 0.020197, -0.0012983, 0.046204, 0.043617, 0.05228, 0.035529, 0.048753, -0.010956, -0.010948, 0.0023335, 0.0008262, -0.028699, 0.014222, -0.0098069, -0.035273],
[0.062947, 0.064519, 0.032897, -0.045712, 0.020599, 0.063655, 0.014616, -0.027441, 0.035616, 0.0094036, 0.056507, 0.031273, -0.011035, 0.038887, -0.021343, -0.016083, 0.03398, 0.052626, -0.025295, -0.026549, 0.030681, 0.027583, 0.080967, 0.035373, 0.0349, -0.012799, 0.043192, 0.022703, 0.050265, 0.00034374, -0.012567, 0.07343, 0.0065301, 0.017282, 0.049276, -0.027253, -0.0086521, 0.047527, 0.17862, 0.086809, -0.019355, -0.04187, -0.055305, 0.078291, -0.12691, -0.09628, -0.092541, -0.10217, -0.041913, -0.0061569, -0.023942, -0.051812, -0.12531, -0.097862, -0.10634, -0.088742, -0.060959, -0.031993, -0.036846, -0.092274, -0.11353, -0.036147, 0.011597, -0.013144, -0.063917, -0.11042, -0.012416, -0.061287, -0.019684, -0.023518, -0.0066523, -0.014485, 0.018028, 0.0080843, 0.036972, -0.018618, -0.10924, 0.030523, 0.012989, 0.04012, 0.061496, 0.04845, 0.019214, 0.02151, 0.072093, 0.03741, 0.04916, -0.013141, 0.060643, 0.022195, 0.051299, 0.013218, 0.041766, 0.010616, -0.010208, -0.0005756, 0.076314, 0.01751, 0.060847, 0.033003, 0.048985, -0.0064822, -0.0021063, 0.010623, 0.028539, 0.028618, -0.023485, -0.0028276, 0.044106, 0.022575, -0.025473, 0.026401, -0.02986, -0.035148, -0.028004, -0.010875, -0.025206, -0.031473, -0.013822, -0.010973, 0.076092],
[0.036904, 0.056002, -0.010952, 0.040331, -0.0037441, 0.049112, 0.007917, 0.11344, 0.00075633, -0.037483, -0.018736, 0.011745, 0.036506, 0.0534, 0.023086, 0.0044153, -0.0036749, 0.049657, 0.004597, 0.040393, -0.029098, -0.074894, 0.0016705, -0.032136, 0.03675, 0.03203, -0.02511, 0.022111, -0.011119, 0.027124, 0.061095, -0.024784, -0.059956, 0.013712, 0.036558, 0.08411, 0.05595, -0.020007, 0.020789, 0.049866, 0.039022, 0.088846, 0.012344, -0.055388, -0.028389, 0.025833, 0.10642, 0.052723, -0.054784, -0.1019, -0.049794, -0.0069086, 0.018753, 0.0082098, 0.013268, -0.18181, -0.12596, -0.094587, -0.027565, -0.06434, -0.091631, -0.092278, -0.07557, -0.11648, 0.0033702, 0.029872, -0.04912, -0.1095, -0.082986, -0.020757, 0.03284, 0.027499, -0.051265, -0.028727, -0.074363, -0.078828, -0.048211, 0.024175, 0.0074473, -0.0074232, -0.00077866, 0.056675, 0.02248, -0.022053, -0.025989, 0.0064103, -0.020235, -0.064838, 0.08154, 0.05056, 0.027641, 0.056668, 0.031151, 0.039877, 0.032444, 0.042983, -0.0018216, 0.0070638, -0.005843, 0.067604, 0.030913, 0.028072, -0.001085, 0.015535, 0.043687, 0.019384, 0.03294, 0.05737, 0.0076083, 0.0044987, -0.011422, -0.029081, -0.0036106, -0.0032691, -0.063552, -0.022937, 0.0091467, -0.011391, 0.068188, 0.0038844, 0.071449],
[0.09367, -0.0060186, 0.064975, 0.057205, 0.032039, 0.017361, -0.05431, -0.074304, -0.022134, -0.034414, 0.0044163, 0.028938, 0.016585, 0.025525, 0.035894, 0.0076747, -0.0019368, 0.0066708, -0.10424, -0.00055455, 0.0022381, -0.028409, -0.0040177, -0.013989, 0.025428, 0.064148, 0.077486, 0.034007, 0.046771, 0.054056, -0.068292, -0.011916, -0.082369, -0.034027, -0.093927, -0.028299, -0.083188, 0.006867, 0.07996, 0.063772, 0.00087634, 0.020692, -0.012739, -0.018539, -0.082159, -0.035509, -0.090379, -0.072582, -0.10221, -0.10665, 0.00090251, 0.015335, 0.046228, 0.038103, -0.0062461, -0.067246, -0.053326, -0.0029145, -0.055346, -0.055246, -0.11557, -0.12679, -0.01865, 0.020112, 0.0072375, 0.013539, 0.039109, 0.051642, 0.0078965, 0.023871, -0.017458, 0.018892, -0.10505, -0.08968, -0.042725, 0.026725, 0.011636, 0.084889, 0.034195, 0.065857, 0.0042427, -0.012401, 0.042723, 0.033509, -0.0086453, -0.09177, 0.02075, 0.019877, 0.010695, 0.047156, 0.044111, -0.014435, 0.071374, 0.034756, 0.040578, -0.0071663, 0.025408, 0.043339, 0.01048, -0.0087307, -0.013411, -0.020395, 0.0060122, 0.024188, 0.041668, 0.041183, 0.10243, -0.029406, 0.0031099, 0.0030509, -0.017382, 0.0048264, -0.026782, 0.011942, 0.0024678, 0.040929, 0.080623, 0.029179, 0.043039, 0.0055502, 0.0002791],
[-0.033397, 0.0096415, -0.018237, -0.034139, -0.0024439, 0.0055087, -0.0026268, -0.028241, 0.005216, -0.021235, -0.047074, -0.026122, -0.027138, -0.048107, -0.040211, -0.030102, -0.0032793, 0.059679, 0.0067584, 0.030667, 0.0095436, -0.016919, 0.0038233, -0.058996, -0.030891, -0.05815, -0.081535, -0.006358, -0.017081, 0.043337, 0.062984, 0.040401, 0.0072034, 0.011593, -0.0033021, -0.057817, -0.037813, -0.12426, -0.10986, -0.093813, 0.065001, 0.034844, 0.056616, -0.014925, -0.021165, -0.0032162, -0.01231, -0.017827, 0.035551, -0.070468, -0.034864, -0.017196, 0.028479, -0.022807, 0.032134, 0.026469, 0.0095896, 0.035119, 0.13551, 0.13689, 0.16248, 0.015875, -0.020831, -0.0011812, -0.019841, -0.088082, 0.030458, 0.026063, 0.047026, 0.070569, 0.062917, 0.049799, 0.085486, 0.035142, -0.020167, -0.061685, -0.092848, -0.0015897, 0.016609, 0.055002, 0.070868, 0.013235, -0.00082084, 0.038005, 0.073573, -0.035372, -0.031698, -0.086249, 0.01039, 0.020134, 0.013596, 0.055295, 0.0095627, -0.021797, -0.0091913, 0.042724, 0.028966, -0.048329, -0.097, -0.035392, -0.0091231, 0.047734, 0.0249, 0.040202, -0.042437, -0.0088865, 0.0034761, -0.012834, -0.011082, -0.086374, 0.010907, 0.0015854, 0.059934, 0.039391, 0.025936, 0.018352, -0.066655, -0.036969, 3.6891e-05, -0.037622, -0.087739],
[-0.0096923, -0.014831, -0.020109, -0.04153, -0.079113, -0.02844, -0.047215, 0.01792, -0.043731, -0.0083078, 0.0080638, -0.042848, 0.015733, -0.035877, -0.020275, 0.0060017, -0.011038, -0.0079322, 0.0024669, -0.047175, 0.019485, 0.038912, 0.039176, 0.0053798, 0.011395, 0.022135, 0.10262, 0.060645, -0.0049047, -0.026338, -0.0003105, 0.021471, -0.029131, 0.049021, 0.048247, 0.087541, 0.072996, 0.019711, 0.053346, 0.068713, 0.0089235, -0.0091036, 0.005913, -0.012742, 0.056215, 0.063791, -0.020641, -0.030947, -0.016712, 0.11272, 0.026897, -0.013567, -0.01709, 0.014777, -0.010782, -0.0069221, -0.089428, -0.067233, -0.026911, 0.035337, 0.16957, -0.0065458, -0.024077, 0.032167, -0.017459, -0.040089, -0.099301, -0.011985, -0.027641, 0.012259, 0.09947, 0.030179, 0.017807, -0.031244, 0.036953, -0.062248, -0.018967, -0.066056, -0.026801, -0.012533, 0.024585, 0.05625, 0.041206, -0.010337, -0.044756, -0.072391, -0.0056601, -0.022192, -0.02598, -0.0048569, 0.0022456, 0.048042, 0.021878, -0.031094, 0.031079, 0.02862, -0.059947, 0.016802, -0.0025822, 0.084439, -0.0032539, 0.021756, 0.044396, -0.0081787, 0.043428, -0.012816, 0.014791, -0.028622, -0.048855, -0.035405, 0.070881, 0.054725, 0.086069, 0.04987, 0.024135, 0.016045, 0.021408, -0.0019594, -0.052757, -0.046484, -0.068063],
[-0.044332, -0.05433, -0.051769, -0.015254, -0.010701, 0.0092805, -0.006241, 0.020072, 0.063349, -0.049922, -0.024848, 0.061077, 0.073127, 0.03427, 0.035888, 0.065559, 0.0050894, -0.017425, 0.064103, 0.063691, 0.011937, 0.0065559, 0.059352, 0.036171, 0.073145, 0.043276, -0.0077362, -0.022749, 0.004669, -0.00069003, 0.06394, -0.014967, 0.0030728, 0.026663, 0.05282, 0.017109, -0.022409, -0.087085, -0.09757, 0.021721, 0.051712, 0.032757, 0.01782, -0.037826, -0.099907, -0.11008, -0.06304, -0.11066, -0.056464, 0.026811, 0.07562, 0.073184, 0.035501, -0.023905, -0.017845, -0.11757, -0.12168, -0.083114, -0.034921, 0.046766, 0.058774, 0.010496, -0.002213, 0.0511, 0.024775, 0.023471, 0.015632, 0.01797, 0.0019336, 0.030515, -0.03111, 0.033605, 0.036258, -0.022201, -0.023003, 0.014758, -0.0070368, 0.1179, 0.049474, 0.062413, 0.052777, 0.0094326, 0.032164, -0.0071376, 0.0032749, 0.0067896, 0.022973, -0.030044, 0.095055, 0.077918, 0.025171, 0.032486, 0.0054809, 0.046288, -0.0048347, 0.010141, 0.006405, -0.016193, -0.02077, 0.071543, 0.041812, -0.0011514, -0.0069609, 0.01636, 0.025003, 0.020552, -0.0015891, 0.036688, -0.059255, -0.0045241, -0.022765, 0.055697, 0.058835, -0.017696, 0.014345, -0.020606, 0.02101, -0.022475, -0.040297, -0.040552, -0.03658],
[0.04868, -0.0052211, 0.01119, -0.014771, -0.034142, -0.028004, 0.0059494, 0.015102, 0.019901, 0.039961, 0.0038194, 0.01389, 0.075503, 0.059891, 0.075512, 0.073756, 0.10697, 0.068741, 0.048031, 0.042366, -4.2027e-05, -0.012109, -0.011319, -0.037382, -0.021548, 0.018482, -0.0052013, 0.027477, -0.013858, 0.043728, -0.025032, -0.029687, -0.019073, 0.033492, -0.065964, -0.062342, -0.075624, -0.053586, -0.028774, 0.0066218, -0.10036, -0.089046, -0.04614, 0.072975, 0.087251, 0.045168, -0.053337, -0.082409, -0.091444, -0.074426, -0.092126, -0.037675, -0.0056525, 0.067513, 0.093934, 0.0092897, 0.018516, 0.037298, -0.021567, -0.034819, -0.021783, -0.025809, -0.036853, 0.0050072, -0.0054865, 0.036889, 0.020304, 0.06235, 0.038517, 0.067308, 0.058616, -0.0042178, 0.054673, 0.039231, 0.031392, 0.043919, 0.043293, 0.018805, 0.017383, 0.059662, 0.033699, 0.013342, 0.08421, 0.025431, 0.012904, 0.065431, 0.011197, 0.029136, 0.062541, 0.045383, -0.0053463, -0.017267, 0.02042, 0.013123, 0.015259, -0.01873, 0.023824, 0.052818, 0.015447, -0.01249, 0.014684, -0.026853, 0.028989, -0.0048952, 0.024942, 0.080075, 0.013283, -0.03042, -0.0077059, 0.0057615, -0.022997, -0.031813, -0.0074071, 0.0074686, 0.066652, -0.04319, 0.0087486, 0.035607, 0.0093449, -0.060326, -0.029897],
[-0.021247, -0.022204, 0.086827, -0.025228, 0.046972, -0.032033, -0.018785, -0.0043159, -0.041827, -0.069289, -0.0081667, -0.017438, -0.024335, 0.028654, 0.072066, 0.016591, 0.024633, 0.07814, 0.056622, 0.037503, 0.03784, 0.032, 0.013106, 0.012369, -0.028706, 0.0050659, 0.013853, 0.00055953, 0.020323, 0.075276, 0.091913, 0.11099, 0.078217, 0.015546, -0.011745, 0.051738, -0.012734, 0.016769, -0.044366, -0.099554, -0.0501, -0.057248, 0.016222, 0.0676, -0.0086481, -0.0032869, 0.0085923, 0.046768, 0.072794, 0.045295, -0.084825, -0.14861, -0.051316, -0.12479, -0.085079, -0.0057128, 0.044163, -0.001048, 0.030855, 0.035139, 0.072277, 0.053918, -0.044672, -0.082685, -0.106, -0.15447, -0.011133, 0.028928, 0.0038564, 0.016248, 0.017416, -0.021407, 0.026964, 0.028131, 0.025158, 0.037924, -0.004685, -0.027697, -0.041379, 0.0087612, 0.0052052, 0.0439, 0.07761, 0.023416, 0.06086, 0.035574, 0.071928, 0.064071, 0.013358, -0.048366, 0.029793, 0.0052255, 0.0017724, 0.043271, 0.061872, 0.06025, 0.0059221, 0.067275, 0.1015, -0.030662, 0.00089429, -0.057645, 0.033295, 0.024006, 0.0049161, -0.018549, 0.028088, 0.023382, 0.034065, 0.076788, -0.05767, -0.034528, 0.02176, -0.072334, -0.00053618, 0.029546, 0.0043528, 0.0050097, 0.045672, 0.027025, 0.047575],
[8.4608e-05, -0.00051459, -0.00065583, 0.00020679, -0.0011087, 1.7283e-05, -0.00069139, -0.00067753, 7.4613e-06, -0.00070527, 0.00036511, -0.00022613, 0.00083733, -0.00038556, -0.00020677, 0.00010704, 0.00015849, -0.00023179, -0.00023816, -0.00042063, -0.00035892, -0.0010411, -0.00070995, 0.000723, -0.00024736, 0.00048919, 0.00024924, 0.00060669, 0.0014982, 0.0005362, 0.00050087, 0.00089807, 0.00023875, 0.0001569, -5.4315e-05, 0.00056173, -0.00015464, 0.0003081, 0.0010477, 0.00054031, 0.0020028, 0.00073696, 0.00041838, 0.0011534, -0.0014158, -1.7385e-05, -0.0003327, 0.00025909, -6.7895e-05, 0.0020025, -0.00060121, -0.00063729, 0.00088529, 0.00051385, 0.00080077, -0.00021374, -0.00012764, -0.00032299, -5.5464e-05, -0.00038413, 0.00098096, 0.0016769, -0.00023683, -0.00047131, -0.0011834, 0.00011653, -0.00069781, -0.00081516, 0.00031472, 3.2978e-05, -0.00074268, 9.2834e-05, 0.0016276, 0.00052039, 0.00032858, -0.00090914, -0.00066274, -0.00049429, 0.00081787, -0.00028647, -0.00047775, -0.0011287, -0.00014959, 0.00067728, 0.0018427, 0.00042127, -0.0011898, -0.0021021, 0.00025863, -0.00028165, -6.7871e-06, 0.00010673, -0.00081947, -0.00050656, -0.00045739, 0.0012233, 0.0012483, 0.00023367, -0.00049654, -0.00060431, 0.00048856, -0.00039402, -0.00030283, -0.00048298, -0.0004503, 6.8065e-05, 0.00029381, 0.0008075, 0.0010027, 0.0012118, -0.000315, -0.00096615, -0.00016521, -0.0002593, 0.00070445, -0.00051525, -4.9951e-05, 0.0002327, 0.00098128, 0.0017427, 0.0012749],
[-0.092167, 0.0056729, -0.0093745, -0.013062, 0.026811, 0.049001, -0.021651, 0.037001, 0.0042183, 0.0018621, -0.0002865, 0.0053573, -0.024952, -0.053963, 0.022201, -0.013351, 0.012385, -0.018031, 0.025522, 0.012537, -0.011992, 0.045187, -0.0094335, -0.0044184, -0.013784, 0.025926, -0.041054, -0.038893, -0.039896, 0.035441, 0.023677, -0.041022, -0.057696, -0.017627, -0.020217, 0.027628, -0.018841, -0.015264, -0.042663, -0.076632, -0.057529, -0.014905, -0.066898, -0.06533, -0.0076506, -0.048587, 0.085982, 0.023145, 0.069503, 0.023607, -0.037011, -0.086464, 0.0048593, -0.047933, -0.065202, -0.0083087, 0.0036049, -0.014176, 0.086525, 0.025019, 0.18351, 0.17731, 0.052646, 0.046296, 0.017268, 0.091744, -0.011477, -0.0031098, -0.044721, 0.035195, 0.035162, -0.085226, 0.059126, 0.14804, 0.094894, 0.10021, 0.0948, 0.016819, -0.0016208, 0.0056984, 0.02466, -0.0017441, -0.031929, -0.082346, -0.036632, -0.00060561, -0.0084924, 0.029093, 0.021734, -0.019869, 0.0049377, 0.035446, 0.03566, 0.057302, -0.038292, -0.061604, -0.062082, -0.043689, -0.019287, -0.015927, 0.020688, 0.0061875, 0.0079545, 0.03821, 0.017747, 0.018299, -0.071994, -0.048806, -0.041478, -0.074196, -0.04357, -0.02427, 0.048012, -0.0022007, -0.012801, 0.052876, 0.06225, 0.025342, 0.0028709, -0.041475, -0.016771],
[0.020792, -0.026685, 0.0052684, -0.034939, 0.021609, 0.07276, 0.041389, -0.022051, -0.037669, -0.038136, 0.056138, 0.018701, 0.024053, -0.044522, -0.0072803, 0.025522, 0.055898, 0.020086, 0.022258, -0.043113, 0.025461, -0.042, -0.022104, 0.020437, -0.0089104, -0.040754, -0.044989, 0.014514, -0.024973, 0.041776, -0.020618, -0.027452, -0.058121, -0.019728, -0.064864, -0.065429, -0.034021, -0.070154, -0.047186, -0.066865, -0.066928, -0.045242, -0.041527, 0.0090972, 0.066567, 0.092179, 0.035601, -0.031646, -0.084854, -0.078072, -0.058064, 0.027433, 0.038431, 0.093545, 0.02082, 0.053868, 0.080127, 0.12823, 0.10909, 0.12328, 0.10908, 0.1275, 0.08982, 0.13207, 0.040999, 0.05859, -0.028141, 0.011014, 0.010818, 0.057563, 0.043454, 0.063805, 0.039305, 0.014669, 0.031073, -0.064254, -0.058945, 0.011933, -0.088116, -0.1313, -0.083772, -0.057942, -0.054054, -0.052884, -0.09094, -0.054181, -0.048566, 0.041762, 0.052504, 0.04064, -0.017347, -0.07672, -0.061855, -0.020823, -0.062266, -0.047703, -0.040227, 0.046901, 0.057527, 0.025438, 0.069957, -0.0081337, -0.020792, -0.040002, -0.057585, -0.023269, -0.043727, -0.025274, 0.047882, 0.055113, 0.04126, 0.030578, 0.040162, 0.077326, 0.049074, 0.020718, 0.052627, 0.057604, 0.051058, 0.023973, 0.10154],
[0.038642, -0.0050245, 0.0046137, -0.0067584, 0.031421, 0.043864, -0.0015665, -0.080588, 0.023011, -0.031974, -0.045853, 0.0073322, 0.024538, 0.026494, 0.012817, 0.015873, 0.010885, -0.025022, 0.037514, -0.046295, 0.011215, -0.028657, -0.015741, 0.010582, -0.0060245, -0.0021638, -0.012232, -0.038573, -0.034197, 0.021759, 0.0040701, 0.033019, -0.051704, -0.053297, -0.087987, -0.036089, -0.024714, -0.045558, -0.063234, -0.0079876, -0.001269, 0.047525, 0.014455, -0.018257, -0.027678, -0.073305, -0.062178, -0.056046, -0.061583, -0.013982, 0.036486, -0.018427, 0.072797, -0.0075591, -0.024644, 0.061682, 0.060669, 0.037714, 0.078055, 0.14419, 0.1556, 0.067522, 0.019946, 0.026659, -0.01207, 0.0057426, 0.083145, 0.11628, 0.053997, 0.07441, 0.067029, -0.054231, 0.003903, 0.062433, 0.025821, -0.026727, -0.010193, 0.020416, 0.060395, 0.011092, -0.046966, -0.070524, -0.072562, -0.027651, 0.06845, 0.033, 0.041736, 0.011928, -0.054917, -0.051654, -0.028774, -0.037453, -0.08234, 0.012375, -0.0058925, 0.11105, 0.016941, 0.033194, -0.0018374, -0.095054, -0.058966, -0.040233, -0.046409, 0.0083077, 0.044775, 0.06359, -0.010509, 0.066094, -0.0027753, -0.010076, -0.050324, -0.0068444, -0.0041476, -0.0038945, 0.028367, 0.032085, 0.0293, 0.0032286, 0.071386, 0.023726, -0.071251],
[0.10873, 0.014278, 0.012274, -0.0081393, 0.057053, 0.042322, 0.033324, -0.0094696, 0.022832, -0.060308, -0.029388, 0.047863, -0.010046, -0.018988, -0.039886, -0.040504, -0.014329, 0.066888, 0.054681, 0.036468, 0.027426, -0.041157, -0.071084, -0.038858, -0.052405, -0.03744, -0.072142, -0.064832, -0.093371, 0.012493, -0.012993, 0.012828, 0.028496, -0.088967, -0.059145, -0.073604, 0.0014228, -0.061366, -0.054663, -0.10168, -0.086349, -0.013058, -0.020967, -0.024969, -0.0086781, -0.050928, -0.012321, -0.009796, -0.060386, -0.073566, -0.098901, -0.095045, -0.05081, -0.020639, 0.0068009, 0.15286, 0.097545, 0.11068, 0.11229, 0.18428, 0.11307, -0.0045716, 0.0064434, -0.052854, -0.020146, 0.0036235, 0.055737, 0.046046, 0.022877, 0.019702, -0.04451, 0.02626, 0.0012791, 0.11283, 0.045956, -0.036756, 0.013793, -0.00031411, -0.024157, -0.0076891, -0.018311, -0.036925, 0.015877, -0.00074296, 0.044351, 0.09355, 0.034107, 0.0074667, -0.055729, -0.024915, -0.040394, -0.014479, -0.021786, 0.034463, 0.019018, 0.019996, 0.057264, 0.040807, -0.028383, 0.012261, 0.036427, -0.022903, 0.006834, -0.0095408, 0.021714, -0.0024252, 0.026187, 0.062738, 0.0131, 0.021845, -0.0064556, -0.01806, -0.011501, 0.011069, -0.0076556, -0.060373, 0.018731, 0.010879, 0.039313, 0.050533, 0.0308],
[0.040803, 0.065104, 0.015718, -0.042967, 0.053812, 0.074783, 0.057112, -0.0020897, -0.031444, 0.036659, 0.079578, -0.014495, 0.023854, -0.08596, 0.016421, 0.053099, 0.044587, 0.075787, -0.020575, -0.052303, -0.0027126, -0.025365, -0.075564, -0.039845, -0.035504, -0.031983, 0.016275, -0.014983, 0.0085163, -0.010415, -0.080245, -0.068934, -0.082117, -0.10868, -0.11517, -0.05217, -0.078003, -0.084743, -0.090079, -0.045561, -0.099138, -0.089931, -0.071757, -0.1012, -0.026109, -0.028956, -0.052953, -0.040651, -0.062404, -0.062531, -0.04764, 0.02155, 0.042012, -0.0014168, -0.060018, 0.050239, 0.094413, 0.14253, 0.12071, 0.11698, 0.098976, 0.12841, 0.10926, 0.10934, 0.037269, 0.02278, 0.044474, -0.0060598, 0.0061609, -0.0064769, 0.03487, 0.03938, -0.0013958, -0.028963, 0.0046569, 0.043728, -0.006941, 0.018088, 0.0082024, -0.0099195, -0.060301, -0.049617, 0.032033, -0.017011, -0.040659, -0.017714, -0.017211, 0.05557, 0.064732, 0.014251, -0.026793, -0.03762, -0.035454, -0.0033597, -0.0018842, -0.035139, 0.0012996, -0.020445, 0.037428, 0.021313, 0.054608, 0.044538, -0.025503, -0.045072, 0.014586, -0.031781, 0.0068856, 0.0054809, 0.010448, 0.036007, 0.072978, 0.0081452, 0.018678, 0.002222, 0.038134, -0.022256, 0.018473, -0.019159, 0.053864, 0.0041179, 0.042052],
[-0.11959, 0.00046909, -0.017807, 0.060029, 0.010483, 0.11341, 0.060972, 0.0095573, 0.024172, 0.011559, 0.074094, -0.001533, -0.042434, 0.0093888, 0.054397, 0.049821, 0.0059163, 0.02311, -0.025328, -0.071392, 0.0028116, 0.04064, 0.023985, 0.00080593, -0.017294, 0.019318, -0.051786, -0.060402, -0.051631, -0.02641, -0.025387, -0.086705, -0.031667, -0.032597, 0.0060778, -0.03085, -0.1089, -0.059264, -0.058027, -0.065551, -0.076388, -0.014694, -0.1161, -0.13336, -0.013872, -0.071355, -0.046296, -0.046341, -0.059804, -0.05569, -0.088752, -0.0092767, -0.010766, -0.01369, -0.058954, 0.018927, -0.027282, -0.039857, 0.012549, 0.010688, 0.080319, 0.15262, 0.086961, 0.15253, 0.069464, 0.11198, 0.017371, 0.015813, 0.032806, 0.017747, 0.073545, -0.03211, 0.019567, 0.029618, 0.038786, 0.032628, 0.069817, -0.0062508, 0.051458, 0.030409, 0.046777, 0.040002, -0.020088, -0.012635, -0.04525, -0.034254, -0.021876, -0.045999, -0.024164, 0.0075637, -0.00091422, 0.035703, 0.088575, -0.013735, -0.0098033, -0.042826, -0.0012702, 0.0127, -0.043166, -0.032268, -0.0035433, 0.006758, -0.0053454, 0.023288, 0.074293, 0.019467, -0.017988, -0.0012524, 0.022264, 0.0012391, 0.0013565, -0.0046713, 0.016578, 0.036584, 0.0010972, 0.011357, 0.05343, -0.00068444, -0.038448, -0.0005839, 0.003291],
[0.0087137, 0.021185, 0.044118, 0.040648, 0.032447, -0.013324, -0.020142, -0.025882, -0.0024841, -0.01901, -0.0021128, 0.0091018, 0.039626, 0.01797, 0.03736, 0.019343, 0.014757, -0.0010528, -0.025962, -0.010286, -0.011165, -0.0019599, 0.0087082, 0.034494, 0.028652, 0.0403, 0.033374, 0.05035, 0.0063626, -0.024012, -0.042233, 0.022058, 0.053376, 0.02062, 0.02954, 0.057652, 0.067979, 0.062647, 0.04924, 0.02117, 0.011454, 0.010299, -0.0018357, 0.05593, -0.011232, 0.032042, 0.015713, -0.0070039, -0.0091016, 0.016511, -0.019705, -0.039092, -0.045771, -0.0077692, 0.049862, -0.067365, -0.076963, -0.040595, -0.030389, -0.092514, -0.057212, -0.00095436, -0.045682, -0.036819, -0.068244, -0.027588, -0.041645, -0.043031, -0.054498, -0.068638, -0.097786, -0.065713, -0.052882, -0.013397, -0.019034, -0.023493, -0.036063, 0.027782, 0.012907, -0.017337, -0.064488, -0.099835, -0.1029, -0.064664, -0.064124, 0.010795, 0.02495, 0.01812, 0.10433, 0.10219, 0.013337, -0.0236, -0.089888, -0.10446, -0.11164, -0.051552, 0.045267, 0.069677, 0.13697, 0.064483, 0.098551, 0.093606, 0.037819, -0.0035166, -0.0028484, -0.031609, 0.0046812, 0.017172, 0.10537, 0.082514, 0.01027, 0.047236, 0.079023, 0.073711, 0.040152, 0.077665, 0.044443, 0.014455, 0.0224, 0.017225, 0.064739],
[0.086172, 0.043276, 0.030057, -0.012273, -0.0084498, 0.033192, -0.034726, 0.018177, -0.0097128, 0.0085166, 0.030227, 0.052416, 0.051669, -0.01391, -0.014893, -0.030204, -0.023349, -0.039154, -0.020299, -0.02687, -0.021027, -0.048342, 0.050216, 0.0017508, 0.017848, -0.035663, -0.055701, -0.034566, -0.00014494, -0.011843, -0.030725, 0.037181, -0.014335, 0.026403, -0.021572, -0.050785, -0.0067591, -0.057082, 0.0016645, -0.0041547, -0.028756, -0.037141, -0.058967, -0.016029, -0.0031722, 0.0023078, -0.048022, -0.093376, -0.055543, -0.11398, -0.027457, 0.016614, 0.0027741, -0.016349, -0.072147, 0.0015395, -0.052683, -0.060379, -0.068267, -0.036772, 0.11935, 0.10245, 0.027543, -0.03207, -0.022385, 0.05629, -0.034119, -0.069687, -0.049956, 0.029733, 0.20069, 0.11621, -0.04341, -0.0030594, 0.00063196, -0.0015553, 0.065277, 0.010466, -0.020041, 0.061756, 0.12137, 0.078247, -0.080725, -0.075077, 0.012154, 0.036822, 0.024721, 0.040716, 0.021623, 0.038658, 0.052579, 0.083631, 0.047882, -0.075157, -0.050688, -0.008839, 0.091035, 0.078447, 0.062276, 0.060595, 0.016938, 0.064081, -0.014548, 0.065658, 0.018129, -0.087985, -0.026622, 0.060886, 0.077751, 0.066438, 0.019422, 0.048505, 0.070414, 0.035827, 0.083548, 0.060028, -0.0054325, -0.0020892, -0.030512, -0.00047303, -0.023512],
[-0.019836, -0.0017613, 0.020981, 0.032445, 0.035482, 0.051464, 0.013871, 0.012773, -0.0056081, -0.011615, -0.044318, -0.060123, -0.014777, -0.0053583, -0.05438, -0.041378, -0.048977, 0.076953, 0.026914, -0.0014017, 0.0097461, 0.0046964, -0.006913, -0.040628, 0.034129, 0.011114, 0.026924, -0.034902, -0.083572, -0.017956, -0.013806, -0.062394, -0.0041427, -0.037637, -0.037725, -0.013775, -0.057705, 0.0048236, 0.072282, 0.032162, -0.065745, -0.043635, 0.00026056, -0.019143, -0.028408, -0.057929, -0.050766, 0.034536, -0.092192, -0.10533, -0.012076, 0.047513, 0.0020512, -0.026305, 0.059014, -0.041219, -0.037909, -0.035254, -0.0037642, 0.10583, 0.15061, -0.044965, -0.038673, 0.032859, 0.036836, 0.091521, 0.06793, 0.0016575, 0.011255, 0.019715, -0.04603, -0.005182, 0.13027, 0.076244, -0.062532, -0.073584, 0.077175, 0.049433, 0.035864, 0.03572, 0.020318, 0.028617, -0.18445, -0.027969, 0.14692, 0.1481, -0.032906, -0.022817, 0.081643, 0.073319, 0.096552, 0.057497, 0.019593, -0.060101, -0.05529, 0.077753, 0.082231, 0.043013, -0.084999, 0.047227, 0.11708, 0.073958, 0.068482, -0.025788, -0.042548, -0.028797, -0.028665, -0.050465, 0.0099283, 0.0074795, 0.035767, 0.013423, 0.059917, -0.017252, 0.00014025, -0.028233, -0.037232, 0.038073, 0.017201, 0.048124, 0.082875],
[0.0081889, -0.058862, -0.043961, -0.063177, -0.018314, 0.034878, 0.035304, 0.014294, -0.027457, -0.068368, 0.0016691, -0.040968, -0.039439, -0.021638, -0.037684, -0.017748, -0.042289, -0.0018177, 0.030934, 0.011733, 0.02709, 0.0017191, 0.043276, -0.072533, -0.030224, 0.021072, -0.0074147, -0.043925, 0.020289, -0.034527, 3.0471e-05, 0.026067, 0.08854, 0.014139, 0.022766, -0.0018481, 0.042676, 0.017054, -0.096746, -0.10757, 0.070755, 0.015756, 0.0096692, -0.003229, -0.015101, 0.057926, 0.050109, 0.034385, 0.054202, -0.15713, -0.10755, 0.054216, 0.15266, 0.055888, -0.095941, 0.033287, 0.093531, 0.14384, 0.12025, 0.055497, 0.036285, 0.066833, 0.042161, 0.047588, 0.021868, -0.056412, 0.067603, 0.031338, 0.050713, 0.052148, 0.018648, -0.050759, -0.044588, -0.039313, -0.059936, -0.055185, -0.019957, 0.050193, -7.1757e-05, -0.033092, -0.034428, -0.034413, -0.023267, 0.031902, 0.020239, 0.0042221, 0.015602, 0.060847, 0.041402, -0.0034146, -0.007456, -0.015894, 0.056392, 0.063355, 0.0087304, 0.013014, -0.0020131, 0.045232, 0.035378, 0.0826, 0.033716, 0.016513, 0.015814, -0.016537, 0.022388, -0.012153, 0.02454, 0.023109, 0.0067064, 0.01196, 0.018086, 0.022565, 0.02924, 0.0070031, 0.042819, 0.063646, 0.071445, 0.025002, -0.029884, -0.044839, 0.0048106],
[0.0076044, -0.031647, -0.063172, -0.074495, -0.018994, 0.052827, 0.03289, -0.01363, -0.064808, -0.029394, -0.036471, -0.0098222, -0.035121, -0.039435, -0.028818, 0.038501, -0.0049329, -0.027625, -0.067847, -0.0011073, -0.051841, -0.055931, -0.017412, -0.057527, -0.055499, 0.028375, 0.035911, -0.014961, 0.011607, -0.0075877, -0.0045075, -0.0082003, 0.01378, -0.050073, -0.049085, 0.070063, 0.041211, 0.044222, -0.09251, -0.017246, 0.0054614, 0.0057318, 0.033493, 0.0086141, 0.019265, 0.0091442, 0.058445, 0.11213, 0.0075004, -0.14041, -0.13224, 0.046901, 0.043119, 0.08258, 0.068684, 0.041318, 0.085515, 0.023787, 0.088925, 0.13629, 0.0054698, -0.086543, 0.025965, 0.10588, 0.09446, 0.081346, 0.041592, 0.0066818, 0.077674, 0.0056684, 0.042096, 0.032191, 0.030453, -0.025984, 0.025271, 0.034212, -0.011964, 0.037077, 0.045086, 0.0051588, 0.028807, 0.0386, 0.024876, -0.013892, 0.021756, -0.065358, -0.061058, -0.024592, -0.0075328, 0.019987, 0.040909, 0.040437, 0.040035, 0.018813, -0.030276, -0.030271, -0.016191, 0.0068099, 0.037916, -0.038319, 0.010307, 0.015829, 0.0408, 0.056154, 0.047863, 0.034288, 0.060681, 0.0032703, 0.0013153, 0.060955, -0.040792, 0.016183, 0.019528, 0.028894, -0.0012919, 0.034618, 0.043406, 0.029089, 0.0088268, 0.01826, 0.075373],
[0.027451, 0.041263, -0.013145, 0.012208, 0.0092477, -0.012849, 0.0045636, 0.010876, 0.028905, 0.026392, 0.010733, 0.015032, -0.029908, 0.021412, -0.057537, -0.053416, -0.048866, -0.03557, -0.018461, -0.0029791, 0.032112, 0.051478, -0.0057662, -0.017767, -0.028238, 0.023529, -0.04216, -0.041032, -0.06681, -0.039632, -0.022227, -0.0041149, 0.032302, -0.013891, -0.034276, -0.0051503, -0.021066, 0.022152, -0.0022992, -0.06277, -0.019724, -0.057691, -0.042379, 0.028983, -0.019396, -0.029332, -0.010746, -0.013921, -0.029609, -0.12538, -0.095617, -0.035129, -0.039982, 0.0090953, -0.022087, 0.029136, -0.032594, -0.020184, 0.061602, 0.15458, 0.16957, -0.040428, -0.14425, -0.071643, -0.042253, -0.027875, 0.058879, -0.00047065, -0.04392, 0.054967, -0.069297, 0.11119, 0.23666, 0.12148, -0.011434, -0.048195, -0.079328, 0.0017254, 0.037709, 0.042182, 0.03583, -0.073358, -0.14576, 0.04829, 0.1488, 0.10065, 0.063705, -0.030693, 0.056256, 0.10255, 0.078604, 0.016466, -0.0056464, -0.13298, -0.028765, 0.059394, 0.14023, 0.01141, 0.01604, 0.032382, 0.10196, 0.061382, 0.082412, -0.063666, -0.018779, -0.038366, 0.077993, 0.037853, 0.040997, 0.011083, -0.0056645, -0.014755, 0.018865, 0.0075268, 0.014018, -0.010121, 0.019767, 0.039941, 0.099261, 0.052915, 0.022179],
[-0.097161, 0.021642, 0.029135, 0.013999, 0.059317, 0.033067, 0.0085646, 0.010286, -0.0083818, 0.018754, -0.030375, -0.041904, -0.055862, -0.010903, 0.068265, 0.026036, -0.0012924, -0.0017623, 0.0054685, -0.021756, -0.049506, -0.066112, -0.022252, -0.0081983, -0.037367, 0.012775, -0.062951, -0.045045, 0.048001, 0.030007, -0.0018969, -0.015723, -0.05512, -0.012097, 0.0026362, -0.072633, -0.068873, 0.017773, 0.072339, 0.018535, -0.045281, -0.011332, -0.02728, -0.058723, 0.026328, -0.010818, -0.030611, -0.028513, 0.0012489, -0.11197, -0.05527, 0.011156, 0.0082229, -0.032306, -0.015024, 0.049383, 0.015328, 0.037662, -0.035013, -0.02945, 0.12073, 0.02286, -0.023256, -0.083648, 0.0074002, 0.010004, 0.099372, -0.025222, -0.096641, 0.053094, 0.15894, 0.033387, -0.048085, -0.010054, 0.037824, 0.0397, 0.054256, -0.024015, -0.029043, 0.046139, 0.16217, 0.01609, -0.091199, -0.076361, 0.031988, 0.036455, 0.025465, 0.074147, -0.046979, -0.049629, 0.079772, 0.087758, 0.049829, -0.030455, -0.024452, 0.067009, 0.11752, 0.11427, 0.074067, 0.0062338, -0.043366, -0.03995, -0.03541, -0.035864, 0.017813, -0.024727, -0.022276, 0.076761, 0.062045, 0.069838, 0.073013, 0.060191, -0.025406, 0.023373, 0.030478, -0.00023012, -0.026087, -0.01902, -0.036715, 0.058818, 0.068381],
[-0.011512, -0.033324, -0.0776, 0.030092, 0.03689, 0.015053, 0.028017, -0.01019, -0.078318, -0.059233, -0.018527, 0.053961, -0.026974, -0.018041, 0.044307, 0.015819, -0.031954, -0.027401, -0.046791, -0.020608, -0.026272, -0.080187, 0.083846, 0.0014068, -0.049854, -0.021417, 0.066537, -0.0073245, -0.018145, -0.015182, -0.045131, 0.029948, 0.0064481, 0.042275, -0.074359, -0.014177, 0.077655, -0.010551, -0.12638, -0.033587, 0.062817, 0.0053909, 0.025795, 0.059722, -0.082995, 0.0042617, 0.10585, 0.071364, -0.026422, -0.16101, -0.05472, 0.048999, 0.075435, 0.010536, -0.048017, -0.08034, 0.039577, 0.036637, 0.12099, 0.13549, 0.051195, 0.018226, 0.085661, 0.18622, 0.10338, 0.023906, -0.0041823, -0.10643, -0.078125, -0.073469, -0.04842, 0.015109, -0.032646, 0.036236, 0.0080905, 0.11268, 0.10279, 0.044282, 0.010681, 0.048923, 0.054874, -0.018065, -0.018189, -0.071125, -0.10261, -0.05249, 0.024032, 0.019694, 0.049637, 0.032196, 0.008328, 0.070139, 0.06755, 0.057434, 0.020438, 0.0032421, -0.050695, -0.015384, 0.020203, -0.015663, 0.031709, 0.012506, 0.028623, 0.059463, 0.011987, 0.029656, -0.0016058, 0.032925, 0.031881, 0.050423, 0.015557, 0.021386, 0.0099933, 0.014351, 0.039479, 0.066852, 0.040297, 0.0099526, -0.0023558, 0.018149, 0.059119],
[-0.015757, -0.049129, -0.023998, -0.021003, -0.0015358, 0.0021065, -0.037107, -0.042352, -0.061163, -0.034051, -0.02272, -0.06074, -0.026757, 0.00055934, -0.022616, 0.0070862, 0.013566, -0.0028115, -0.03858, -0.014823, -0.034836, -0.026656, -0.019478, -0.012107, 0.0042484, 0.016085, 0.00066552, 0.0016008, 0.020524, 0.061833, 0.0036079, -0.069862, -0.027833, -0.032569, 0.045124, -0.020542, 0.006226, -0.017204, -0.067138, -0.02151, 0.10815, 0.03721, -0.0060277, -0.016395, 0.027666, 0.073069, 0.050576, 0.042568, -0.040728, -0.18025, -0.051804, 0.068699, 0.10469, 0.046931, -0.024345, 0.081519, 0.13438, 0.12767, 0.058828, -0.065397, -0.010972, 0.015965, 0.064316, 0.092048, 0.079924, 0.0045625, -0.018287, 0.01743, 0.076145, 0.042835, 0.080207, 0.036117, 0.047379, -0.019875, 0.037658, 0.026116, 0.071588, -0.057638, -0.083807, -0.020457, -0.0066816, -0.010482, 0.0098189, -0.018911, 0.027174, 0.0048187, 0.0084831, 0.046647, 0.074896, -0.0027052, -0.052391, -0.035811, -0.010963, 0.036472, 0.015668, 0.03188, 0.028321, 0.029977, -0.0029437, 0.03462, 0.085725, 0.014662, 0.057456, -0.007795, 0.056967, 0.039174, -4.3951e-05, 0.039525, 0.033815, -0.053148, 0.046135, 0.034368, 0.025851, 0.043642, 0.028915, -0.0046553, 0.040695, 0.050442, 0.023379, -0.0043674, -0.067829]
]
},
"numPatches": 71,
"patchSize": [11, 11],
"canvasSize": [114, 102]
},
"shapeModel": {
"eigenVectors": [
[-0.25918, -0.049312, -0.13804, -0.050836, 0.00068527, -0.019144, 0.023319, -0.016196, 0.0036094, -0.23833, 0.020658, -0.015932, 0.064262, -0.090635, 0.022056, -0.093726, 0.055118, -0.053233, 0.0062574, -0.094495],
[-0.015371, -0.27559, 0.043057, -0.017592, -0.095867, 0.037459, 0.028918, 0.13017, 0.063869, 0.093354, 0.031861, 0.020242, 0.27294, -0.13041, -0.0031444, 0.065211, 0.23797, -0.14727, 0.036057, -0.12952],
[-0.27439, -0.039853, -0.1345, -0.029787, -0.079526, -0.11665, 0.035666, 0.0024172, 0.071, -0.194, 0.047707, -0.060782, 0.075256, -0.086537, -0.010494, 0.0038623, 0.019089, -0.010833, 0.01729, -0.048709],
[-6.0611e-05, -0.29074, 0.061165, -0.040564, -0.096174, -0.006241, 0.098422, 0.12645, 0.05234, 0.14549, 0.019045, 0.11593, 0.11304, -0.22654, -0.026029, 0.14284, 0.10353, -0.031496, -0.047636, -0.031406],
[-0.28061, -0.0285, -0.13348, -0.048224, -0.11476, -0.16358, 0.04864, 0.010323, 0.044309, -0.1123, 0.056897, -0.04627, -0.037397, -0.13318, -0.010864, 0.039312, -0.010946, -0.012651, 0.011106, 0.030546],
[0.014069, -0.25865, 0.065608, -0.045936, -0.077032, -0.012717, 0.12471, 0.11892, -0.01367, 0.12043, 0.011009, 0.19013, -0.032169, -0.17265, -0.036627, 0.11829, -0.077253, 0.049108, -0.088365, 0.034692],
[-0.2649, -0.016038, -0.15478, -0.054519, -0.11072, -0.13807, 0.083151, -0.00084689, -0.066659, -0.014543, 0.052714, 0.027388, -0.14574, -0.06911, 0.0058712, 0.038653, 0.035449, -0.027971, -0.0058316, -0.01235],
[0.046354, -0.20341, 0.067449, -0.041981, -0.01392, -0.04931, 0.10476, 0.16149, -0.057377, 0.068718, -0.055875, 0.29988, -0.16587, -0.018902, -0.021824, 0.01015, -0.1561, 0.13122, -0.13142, 0.13137],
[-0.20187, 0.0034527, -0.14527, -0.054549, -0.07767, -0.099693, 0.11163, -0.027564, -0.17, 0.052817, 0.0046486, 0.13801, -0.22662, 0.025099, 0.05739, -0.010585, 0.062813, -0.066384, 0.029034, -0.11015],
[0.059919, -0.17456, 0.045547, -0.021382, 0.056054, -0.055753, 0.05095, 0.14366, -0.058304, -0.039882, -0.029734, 0.2412, -0.1539, 0.099337, -0.0079106, -0.091413, -0.17109, 0.079536, -0.07008, 0.10305],
[-0.11407, 0.0077005, -0.097128, -0.048798, -0.034682, -0.034999, 0.086921, -0.095836, -0.20896, 0.08204, -0.038157, 0.17097, -0.22949, 0.12077, 0.083445, -0.06885, 0.10657, -0.11112, 0.14357, -0.1473],
[0.050549, -0.13771, -0.008012, -0.0015715, 0.11898, -0.070033, 0.016791, 0.11156, -0.08231, -0.17681, 0.031785, 0.13575, -0.030875, 0.14057, 0.011927, -0.12276, -0.089723, 0.026135, -0.012285, 0.045456],
[-0.01028, -0.0013954, -0.0425, -0.040684, -3.7807e-05, 0.035049, 0.013909, -0.16422, -0.15344, 0.06372, -0.032069, 0.09303, -0.10431, 0.21548, 0.062045, -0.0975, 0.082375, -0.15218, 0.21188, -0.078833],
[0.020507, -0.080792, -0.076178, 0.048751, 0.16094, -0.0849, 0.019596, 0.042554, -0.092199, -0.29635, 0.068277, 0.016317, 0.097753, 0.078154, 0.043343, -0.075376, 0.033023, 0.059878, 0.024112, -0.088306],
[0.040972, -0.0012967, -0.0020002, 0.0014908, 0.0030003, -0.0021443, 0.00056119, -0.19612, -0.0017679, -0.0059159, 0.0012463, 0.02461, 0.0022007, 0.22488, -0.00058423, -0.082013, 0.00042633, 0.0033161, 0.27617, -0.0016609],
[-0.00080695, -0.065839, -0.10156, 0.075695, 0.15234, -0.10888, 0.028494, 0.0038627, -0.089766, -0.30037, 0.063282, -0.0004847, 0.11174, -0.004429, -0.029664, 0.0016153, 0.021647, 0.16837, -0.0054392, -0.084329],
[-0.011079, -0.0017869, 0.039468, 0.042572, 0.0063749, -0.038365, -0.013127, -0.16577, 0.14969, -0.07534, 0.034732, 0.092316, 0.10808, 0.21223, -0.060291, -0.094457, -0.081011, 0.15442, 0.21076, 0.075295],
[-0.020086, -0.080784, -0.077792, 0.047112, 0.16082, -0.083454, 0.020128, -0.036055, -0.09817, -0.29361, 0.066961, -0.019967, 0.09357, -0.086578, 0.045752, 0.079157, 0.036241, 0.053839, -0.032436, -0.091341],
[-0.11597, -0.013117, 0.096737, 0.048698, 0.03934, 0.032214, -0.086192, -0.10015, 0.20556, -0.088938, 0.039379, 0.1655, 0.2281, 0.11514, -0.082911, -0.063962, -0.11002, 0.11206, 0.14394, 0.14898],
[-0.046018, -0.1373, -0.01183, -0.0034917, 0.11752, -0.071357, 0.0202, -0.1077, -0.090474, -0.17344, 0.030258, -0.14237, -0.039887, -0.14521, 0.015204, 0.12538, -0.085457, 0.02174, 0.0066221, 0.03962],
[-0.20407, -0.010324, 0.14695, 0.053665, 0.079817, 0.097421, -0.10953, -0.0332, 0.16757, -0.054347, -0.0058158, 0.12841, 0.22039, 0.021169, -0.057657, -0.0069775, -0.069501, 0.069464, 0.031771, 0.11412],
[-0.051924, -0.17429, 0.039791, -0.023513, 0.052953, -0.059636, 0.055306, -0.14246, -0.064953, -0.037771, -0.029527, -0.24645, -0.1627, -0.10025, -0.0056447, 0.091759, -0.16848, 0.07686, 0.068882, 0.098631],
[-0.26652, 0.0080164, 0.15732, 0.052824, 0.11009, 0.13602, -0.078962, -0.0072047, 0.064348, 0.017238, -0.054873, 0.015559, 0.13909, -0.068312, -0.006726, 0.038223, -0.041568, 0.033116, -0.0006524, 0.017514],
[-0.035888, -0.20388, 0.061302, -0.044095, -0.018269, -0.054708, 0.10796, -0.16133, -0.059957, 0.068092, -0.053756, -0.30073, -0.17148, 0.021608, -0.021576, -0.011664, -0.15458, 0.13002, 0.13155, 0.13078],
[-0.28095, 0.018294, 0.13596, 0.046378, 0.11163, 0.16295, -0.043692, 0.005633, -0.044813, 0.11695, -0.056419, -0.053721, 0.036101, -0.12627, 0.0094131, 0.034624, 0.0078958, 0.014575, 0.014576, -0.029157],
[-0.0030095, -0.25957, 0.060302, -0.047799, -0.081491, -0.019148, 0.12653, -0.11923, -0.011915, 0.11592, 0.013241, -0.18816, -0.033617, 0.17776, -0.037026, -0.11975, -0.077625, 0.048572, 0.08786, 0.035868],
[-0.27417, 0.028374, 0.13681, 0.028167, 0.075677, 0.11631, -0.031763, -0.0025636, -0.068884, 0.19958, -0.04692, -0.0653, -0.070747, -0.07755, 0.009461, -0.0017651, -0.014997, 0.0095846, 0.019152, 0.047435],
[0.010865, -0.29209, 0.055821, -0.041705, -0.099231, -0.010829, 0.09975, -0.12644, 0.055095, 0.13774, 0.020908, -0.11345, 0.11591, 0.22977, -0.026422, -0.14288, 0.1042, -0.031898, 0.046918, -0.033299],
[-0.25838, 0.038423, 0.13963, 0.050104, -0.0044595, 0.020604, -0.022162, -0.021309, -0.0010918, 0.24182, -0.019387, -0.016717, -0.053465, -0.08543, -0.022163, -0.096221, -0.045705, 0.047393, 0.0048329, 0.089322],
[0.025564, -0.27732, 0.037589, -0.01958, -0.095765, 0.036676, 0.029814, -0.12944, 0.063961, 0.083898, 0.03265, -0.019599, 0.27526, 0.13388, -0.0022735, -0.06147, 0.23995, -0.14925, -0.036275, -0.13314],
[-0.041104, 0.03824, 0.089308, 0.10752, -0.15824, -0.20816, -0.05678, 0.031965, -0.036292, -0.010284, -0.22616, 0.0035659, 0.061195, -0.077357, 0.10906, -0.32123, -0.062437, 0.045061, -0.13893, -0.075947],
[-0.00058626, -0.028013, 0.033925, 0.096976, 0.12885, -0.13433, -0.054635, -0.18671, 0.12024, -0.016776, -0.37344, 0.16617, -0.043638, -0.021519, 0.08833, -0.099975, 0.11085, -0.017708, -0.082914, -0.0077089],
[0.02714, 0.023191, 0.068434, 0.071893, -0.1454, -0.16792, -0.070781, 0.066657, -0.076045, -0.03488, -0.278, 0.06132, 0.0723, -0.023705, -0.044019, -0.27111, -0.046476, 0.0004387, -0.12313, -0.15561],
[0.0076812, 0.027031, 0.05186, 0.093607, 0.237, -0.11818, 0.012899, -0.13978, 0.10628, 0.053512, -0.10841, 0.14453, -0.046948, -0.028787, -0.027495, 0.054014, 0.070313, -0.07865, -0.03377, 0.11646],
[0.059719, 0.019365, 0.039768, 0.02943, -0.099503, -0.095192, -0.037385, 0.08759, -0.063224, -0.023056, -0.11334, 0.070632, 0.04052, -0.01614, -0.20119, -0.13465, -0.11306, -0.21055, -0.043694, -0.053042],
[0.0041645, 0.070452, 0.057003, 0.12331, 0.23821, -0.13581, 0.032581, -0.092174, 0.027564, 0.12746, 0.12379, 0.10986, -0.021826, -0.040456, -0.0041165, 0.063285, -0.0047004, -0.052424, -0.01813, -0.030724],
[0.072669, 0.016043, 0.026274, 0.0035342, -0.059453, -0.049835, -0.02393, 0.10364, -0.062651, -0.008958, 0.013307, 0.06849, 0.042477, -0.012887, -0.32345, -0.10205, -0.17377, -0.23316, -0.011128, 0.0081902],
[0.00094691, 0.086262, 0.056562, 0.14777, 0.20316, -0.15155, 0.024606, -0.059728, -0.081607, 0.20453, 0.2079, 0.061226, 0.028169, -0.036131, 0.026537, 0.039991, -0.049029, -0.014036, -0.0096336, -0.23759],
[-0.041049, -0.039313, -0.087903, -0.10361, 0.16319, 0.20271, 0.054585, 0.039292, 0.040999, 0.0096154, 0.21128, -0.0029798, -0.062866, -0.076449, -0.10549, -0.31704, 0.066753, -0.045723, -0.13556, 0.075584],
[0.0022043, -0.026486, 0.037416, 0.10113, 0.12252, -0.14242, -0.056828, 0.1853, 0.11872, -0.017168, -0.38206, -0.16618, -0.041195, 0.024548, 0.092556, 0.11255, 0.10831, -0.01592, 0.08832, -0.010693],
[0.026817, -0.022109, -0.066339, -0.068152, 0.15462, 0.16314, 0.071234, 0.072109, 0.080171, 0.03696, 0.27352, 0.055582, -0.074092, -0.022553, 0.042902, -0.27302, 0.049209, -0.0035352, -0.12171, 0.16007],
[-0.0087439, 0.027923, 0.054514, 0.096365, 0.23109, -0.1247, 0.010102, 0.13705, 0.1032, 0.052097, -0.11927, -0.14683, -0.044065, 0.029698, -0.029207, -0.043298, 0.068429, -0.078571, 0.038592, 0.11024],
[0.059509, -0.016576, -0.037493, -0.024552, 0.10881, 0.089771, 0.038639, 0.091151, 0.06426, 0.028057, 0.11812, 0.066252, -0.041348, -0.014535, 0.20087, -0.13704, 0.11279, 0.20832, -0.042946, 0.051792],
[-0.0065127, 0.071159, 0.058524, 0.12437, 0.23411, -0.13946, 0.031083, 0.088654, 0.025053, 0.12646, 0.11923, -0.11255, -0.020213, 0.041061, -0.012035, -0.057934, -0.0091486, -0.060674, 0.019836, -0.032789],
[0.072575, -0.012634, -0.024026, 0.002287, 0.067406, 0.043829, 0.02488, 0.10591, 0.059389, 0.017004, -0.005111, 0.066026, -0.041334, -0.011454, 0.32424, -0.10355, 0.1717, 0.23243, -0.01074, -0.017539],
[-0.0038075, 0.086827, 0.057553, 0.1478, 0.20067, -0.1534, 0.023645, 0.0556, -0.084011, 0.20402, 0.20827, -0.063875, 0.029819, 0.036611, 0.013781, -0.035941, -0.055833, -0.023206, 0.010064, -0.23708],
[-0.023504, -0.039048, -0.085567, -0.07915, 0.12465, 0.13892, 0.024301, 0.066995, -0.036811, -0.0058879, -0.090783, -0.0042989, 0.043496, 0.062508, -0.078226, 0.043009, -0.006916, -0.04268, -0.019029, -0.015975],
[-0.0073613, -0.021107, 0.039763, 0.055626, -0.049656, 0.08481, -0.11232, 0.126, -0.023632, -0.057175, -0.0059589, -0.12646, -0.034427, 0.013453, 0.017897, -0.076871, 0.010909, -0.022518, 0.0081303, -0.034046],
[0.016949, -0.021935, -0.063152, -0.0528, 0.10435, 0.10825, 0.033041, 0.086335, -0.015563, 0.0087724, -0.09103, 0.0052611, 0.0074128, 0.12677, -0.010974, 0.12218, -0.032293, -0.041308, 0.0097002, -0.04612],
[-0.0066832, 0.0080822, 0.046932, 0.080999, -0.021246, 0.077223, -0.1208, 0.097572, -0.098662, -0.081072, -0.00075065, -0.10368, -0.10332, 0.018814, -0.010497, -0.061596, 0.18741, -0.10374, 0.0019642, 0.19297],
[0.0011333, -0.011109, -0.044177, -0.026938, 0.058203, 0.06766, 0.012523, 0.086955, 0.014537, -0.0024289, -0.067247, 0.010136, -0.021704, 0.059668, 0.090059, 0.058504, -0.095515, -0.060413, -0.017229, -0.065438],
[0.001501, 0.012001, 0.026456, 0.050506, -0.059044, 0.092763, -0.059216, 0.051446, -0.033728, -0.013303, 0.052355, -0.072966, -0.013674, 0.030573, -0.00012695, -0.036559, -0.077239, 0.00060169, 0.005698, -0.095808],
[0.0045411, -0.02974, -0.061285, -0.051929, 0.095879, 0.10777, 0.018083, 0.11657, -0.018095, 0.0028619, -0.11164, -0.0016145, 0.018507, 0.085963, -0.0049371, 0.10297, -0.034909, -0.032022, 0.026463, -0.058609],
[-0.003894, 0.012492, 0.035153, 0.021732, -0.075237, 0.11222, -0.12233, 0.089598, -0.025863, -0.0013533, 0.037452, -0.095172, -0.025294, 0.0092337, 0.045198, -0.060782, -0.10825, 0.10079, -0.015705, -0.15393],
[-0.0022817, -0.024061, -0.064375, -0.051684, 0.082587, 0.108, 0.011766, 0.13476, -0.02204, 0.0027266, -0.078308, -0.0085373, 0.018275, 0.14969, 0.011605, 0.20993, -0.039923, -0.056634, 0.061774, -0.1028],
[-0.0045582, -0.00066199, 0.030116, 0.052015, -0.057149, 0.10832, -0.12177, 0.094733, -0.053777, -0.066174, 0.026678, -0.096802, -0.073708, 0.014543, 0.0079362, -0.062351, 0.011446, -0.022934, -0.0045563, -0.014346],
[-0.023196, 0.038186, 0.087067, 0.081279, -0.12651, -0.13547, -0.028704, 0.061982, 0.035852, 0.003632, 0.090478, 0.00068386, -0.044818, 0.06193, 0.07887, 0.046002, 0.0073402, 0.04176, -0.019334, 0.014622],
[0.008281, -0.022628, 0.036363, 0.052466, -0.04471, 0.090214, -0.11127, -0.12854, -0.025063, -0.057363, -0.0095288, 0.12653, -0.032687, -0.015904, 0.014803, 0.075118, 0.010628, -0.024181, -0.0073747, -0.034648],
[0.017199, 0.022236, 0.064951, 0.055948, -0.10511, -0.10512, -0.037772, 0.082426, 0.011666, -0.011958, 0.09093, 0.0093392, -0.011475, 0.12593, 0.010552, 0.12451, 0.039647, 0.037191, 0.0096153, 0.053682],
[0.0060107, 0.0072123, 0.044409, 0.078858, -0.017121, 0.081425, -0.11941, -0.1009, -0.099198, -0.080664, -0.0043344, 0.10339, -0.10295, -0.023791, -0.010921, 0.056737, 0.186, -0.10529, -0.0023446, 0.191],
[0.0010733, 0.011572, 0.045184, 0.028906, -0.060482, -0.063955, -0.014845, 0.084862, -0.015854, 0.0019032, 0.069256, 0.013001, 0.021149, 0.058418, -0.089994, 0.059899, 0.0924, 0.06039, -0.01744, 0.061615],
[-0.0015445, 0.011555, 0.024696, 0.049406, -0.056706, 0.095356, -0.058677, -0.05483, -0.03313, -0.013389, 0.049667, 0.072511, -0.014518, -0.032899, 0.0034192, 0.034227, -0.08094, -0.0017775, -0.0050152, -0.09831],
[0.0046909, 0.030208, 0.062622, 0.052744, -0.098767, -0.10326, -0.022886, 0.11295, 0.017063, -0.0029129, 0.11303, 0.0021341, -0.019489, 0.085533, 0.0067129, 0.10528, 0.030619, 0.035966, 0.027061, 0.052503],
[0.0037122, 0.011312, 0.032713, 0.019671, -0.071403, 0.11638, -0.12153, -0.094118, -0.026556, -0.0012395, 0.033028, 0.095162, -0.024546, -0.012611, 0.044968, 0.056681, -0.10954, 0.099453, 0.014651, -0.15612],
[-0.0021004, 0.024016, 0.065511, 0.053692, -0.084773, -0.10365, -0.016552, 0.13092, 0.019906, -0.00533, 0.079298, -0.0047191, -0.021163, 0.149, -0.011283, 0.21223, 0.040343, 0.055687, 0.061906, 0.10216],
[0.0046445, -0.0016089, 0.027558, 0.04994, -0.053853, 0.11249, -0.12121, -0.099966, -0.054603, -0.066015, 0.023574, 0.097064, -0.072931, -0.020425, 0.008387, 0.054036, 0.0098649, -0.025146, 0.0021205, -0.018382],
[0.081811, 0.0013429, 0.00052034, 0.001415, -5.5785e-05, 0.00050437, 0.000145, 0.053461, -0.0023341, -0.00054674, 0.002414, 0.050804, 0.0020717, -0.043036, -0.0041825, -0.048411, -0.0026617, -0.002868, 0.023711, -0.00077901],
[-0.0016113, 0.068182, 0.02642, 0.071844, -0.0028325, 0.025609, 0.0073621, -0.0010529, -0.11851, -0.02776, 0.12257, -0.0010006, 0.10519, 0.0008476, -0.21236, 0.00095346, -0.13514, -0.14562, -0.00046699, -0.039553],
[0.093167, -0.014401, -0.024259, -0.036742, 0.00078129, 0.019454, -0.0039861, -0.020993, -0.038747, 0.022799, -0.026621, 0.0015937, 0.056985, -0.12003, -0.024168, -0.0052872, -0.066418, 0.13427, 0.12116, 0.017717],
[-0.0043277, 0.10938, 0.025032, -0.053334, -0.076358, 0.041667, 0.122, 0.019619, -0.0087275, -0.027906, -0.0020209, -0.03718, 0.085757, -0.0043895, 0.18879, -0.013536, -0.080459, -0.096481, 0.0087288, 0.10539],
[0.068926, -0.0038995, -0.038483, -0.053422, 0.020614, -0.024275, -0.033835, -0.0013678, -0.040894, -0.0036977, -0.022243, -0.0092916, 0.047029, -0.13509, 0.039419, -0.023948, -0.17002, -0.072578, 0.12021, 0.10088],
[-0.0035851, 0.098585, 0.036485, -0.07837, -0.060738, 0.024631, 0.11531, 0.025281, 0.020332, -0.017891, -0.012565, -0.029379, 0.056813, 0.016355, 0.1716, -0.027596, -0.057953, -0.014689, 0.0048945, 0.096282],
[0.082029, -0.0074757, -0.024317, -0.059451, 0.015388, -0.017755, -0.03101, 0.014233, -0.045998, 0.014614, -0.029813, -0.025341, 0.057084, -0.13354, 0.028972, -0.022875, -0.15035, -0.014709, 0.11573, 0.087448],
[0.0031065, 0.097355, 0.048803, -0.089657, -0.053981, 0.016189, 0.10551, 0.02838, 0.022379, -0.012573, -0.023347, -0.037642, 0.067804, 0.010192, 0.14003, -0.02179, -0.031733, 0.0074466, 0.0062393, 0.027541],
[0.13874, 0.0029894, 0.00093656, -0.00071957, -0.00088727, 0.00037084, 0.0039663, 0.011515, -0.0016058, -0.00059454, -0.00015463, -0.021428, 0.0017942, -0.18743, 0.00028053, -0.061963, 0.001006, -0.00058912, 0.18355, 0.0011045],
[-0.0027325, 0.15179, 0.047553, -0.036535, -0.045051, 0.018829, 0.20139, -0.0002268, -0.081533, -0.030187, -0.0078511, 0.00042203, 0.091097, 0.0036914, 0.014244, 0.0012204, 0.051077, -0.029912, -0.003615, 0.05608],
[0.081843, 0.011303, 0.02622, 0.055874, -0.017502, 0.018379, 0.03514, 0.013104, 0.046843, -0.015097, 0.028871, -0.023839, -0.05437, -0.13383, -0.023436, -0.021999, 0.14899, 0.014991, 0.1154, -0.086296],
[-0.006334, 0.096985, 0.047808, -0.091928, -0.053334, 0.015477, 0.10421, -0.028918, 0.02055, -0.011988, -0.024503, 0.038611, 0.069999, -0.0049259, 0.14106, 0.022674, -0.037629, 0.0068616, -0.010791, 0.030963],
[0.069014, 0.0077782, 0.03989, 0.050294, -0.02299, 0.025226, 0.038349, -0.0023622, 0.041663, 0.0029904, 0.021731, -0.0081276, -0.044755, -0.13563, -0.032631, -0.022843, 0.1676, 0.071943, 0.11993, -0.097015],
[0.00086837, 0.098355, 0.034941, -0.080413, -0.059879, 0.023656, 0.11389, -0.025207, 0.018706, -0.018023, -0.013432, 0.029722, 0.05862, -0.011023, 0.17302, 0.028518, -0.064602, -0.017535, -0.009624, 0.10018],
[0.093265, 0.018696, 0.025226, 0.034614, -0.0037873, -0.017798, 0.0087869, -0.021749, 0.038373, -0.02388, 0.026521, 0.0030565, -0.053564, -0.11976, 0.031583, -0.0047501, 0.063198, -0.13797, 0.12073, -0.013554],
[0.00065588, 0.10873, 0.024058, -0.05474, -0.076268, 0.042401, 0.12175, -0.018777, -0.010246, -0.026986, -0.0030676, 0.037088, 0.087934, 0.0091122, 0.1877, 0.013734, -0.083011, -0.091119, -0.013493, 0.106],
[0.15198, 0.0028006, 0.00074601, 0.00047878, -0.00028276, 0.00046544, 0.002781, 0.014577, -0.0023714, -7.4399e-05, 0.00042809, 0.032335, 0.0025661, -0.11258, -0.0019629, -0.068299, -0.00085204, -0.0010859, 0.1352, 0.00036773],
[-0.0029933, 0.1422, 0.037878, 0.024309, -0.014357, 0.023632, 0.1412, -0.0002871, -0.1204, -0.0037776, 0.021736, -0.00063685, 0.13029, 0.0022173, -0.099666, 0.0013452, -0.043261, -0.055136, -0.0026627, 0.018671],
[0.13164, -0.023622, -0.010986, -0.039968, 0.011571, 0.033206, -0.05117, -0.014142, -0.040076, 0.014048, -0.038612, -0.0061341, 0.01909, -0.16518, 0.030389, -0.0032825, -0.11074, -0.013924, 0.17523, 0.020528],
[-0.013331, 0.15174, 0.050439, -0.032634, -0.024682, 0.04785, 0.19726, 0.024422, -0.12826, -0.0096122, -0.051464, -0.034671, 0.12765, 0.0036732, 0.043964, -0.02446, 0.038083, 0.0069073, -0.0048465, 0.038265],
[0.13206, 0.029579, 0.012963, 0.038652, -0.012533, -0.031296, 0.058898, -0.015093, 0.034995, -0.014415, 0.036556, -0.0047642, -0.014049, -0.1652, -0.028634, -0.0023168, 0.11215, 0.014185, 0.17529, -0.019005],
[0.0081372, 0.15069, 0.049967, -0.034182, -0.024207, 0.04912, 0.1951, -0.023846, -0.12974, -0.0090517, -0.052945, 0.034885, 0.1283, 0.0028336, 0.045127, 0.02457, 0.033693, 0.0063537, -0.0020569, 0.039043],
[-0.0038309, -0.0063276, -0.052088, -0.1806, 0.06685, -0.12575, -0.21251, -0.073443, -0.16678, 0.074329, 0.013077, -0.062465, 0.12875, 0.012954, 0.029467, 0.0018815, 0.016686, -0.033447, -0.18253, 0.065849],
[0.0040364, 0.0054285, -0.044557, -0.17696, 0.004967, -0.10595, -0.15417, 0.058039, 0.23028, -0.0065144, 0.086591, -0.058097, -0.016971, 0.018176, 0.14783, -0.078001, -0.097636, -0.23239, 0.02167, 0.025891],
[0.066275, 0.010935, 0.014806, -0.12124, 0.028556, -0.036048, -0.10364, -0.075579, -0.14633, 0.0464, -0.037991, -0.052857, 0.077592, -0.036722, -0.060381, 0.04572, 0.040593, 0.17851, -0.11244, 0.010952],
[0.00064918, 0.075926, 0.017475, -0.19376, 0.0040828, -0.031841, -0.044577, 0.030139, 0.14151, -0.02134, 0.010565, -0.049083, -0.090521, 0.019608, -0.10736, -0.03545, 0.0033882, -0.0017409, 0.013727, -0.052914],
[0.10399, 0.0025553, 0.0092925, -0.039069, 0.0011162, -0.0035913, -0.04118, -0.062868, -0.065948, 0.030965, -0.014729, -0.042241, 0.06468, -0.073966, -0.027365, 0.0526, 0.011956, 0.12005, -0.032601, -0.0051692],
[-0.0023093, 0.11195, 0.046232, -0.16547, 0.0046114, -0.010781, 0.051679, 0.01146, 0.089804, -0.034391, -0.051201, -0.020257, -0.083425, 0.0026742, -0.23595, -0.023521, 0.05601, 0.075817, 0.0087274, -0.033058],
[0.11206, 0.002208, 0.00098929, -0.003301, 0.00025018, -0.00015106, 0.00091684, -0.06328, 0.0017043, -0.00032172, -0.0013785, -0.052335, -0.0015449, -0.053192, -0.0044537, 0.059986, 0.001468, 0.0015596, -0.0197, -0.0008542],
[-0.0022071, 0.11211, 0.05023, -0.16761, 0.012703, -0.0076701, 0.046552, 0.0012463, 0.086533, -0.016335, -0.069993, 0.0010307, -0.07844, 0.0010476, -0.22613, -0.0011814, 0.074535, 0.079185, 0.000388, -0.043371],
[0.104, 0.0018546, -0.007465, 0.032523, -0.00093374, 0.003164, 0.043183, -0.063271, 0.069433, -0.032295, 0.012701, -0.041411, -0.067914, -0.074014, 0.018054, 0.053485, -0.0097409, -0.11697, -0.032919, 0.0038635],
[-0.001787, 0.11196, 0.046562, -0.16688, 0.0046517, -0.010914, 0.050018, -0.008976, 0.087138, -0.033145, -0.051741, 0.021904, -0.080814, 0.00024026, -0.23685, 0.021431, 0.056437, 0.080485, -0.007437, -0.033236],
[0.066198, -0.0079373, -0.014107, 0.11351, -0.028373, 0.034766, 0.1018, -0.076707, 0.15179, -0.047204, 0.038378, -0.050883, -0.081096, -0.037466, 0.056107, 0.047081, -0.040428, -0.17844, -0.11289, -0.013027],
[-0.0032582, 0.076298, 0.018045, -0.19838, 0.005204, -0.033236, -0.048623, -0.02714, 0.13564, -0.019497, 0.0090612, 0.051126, -0.087396, -0.018147, -0.10965, 0.033622, 0.004984, 0.0052893, -0.0092889, -0.052441],
[-0.0039869, 0.0065364, 0.050294, 0.17349, -0.066602, 0.12149, 0.20627, -0.075671, 0.17571, -0.074528, -0.0096575, -0.060129, -0.12932, 0.012229, -0.023623, 0.0049513, -0.020517, 0.024271, -0.18324, -0.064778],
[-0.0038824, 0.0051751, -0.046574, -0.18393, 0.0075954, -0.11082, -0.16242, -0.055103, 0.22354, -0.0035826, 0.087039, 0.060512, -0.011888, -0.018672, 0.14888, 0.077867, -0.096904, -0.23352, -0.014466, 0.028463],
[0.03097, 0.0047092, -0.0075287, 0.16358, -0.05269, 0.089604, 0.14219, -0.10514, 0.1452, -0.054725, -0.029364, -0.050839, -0.06189, 0.044141, -0.050418, 0.025015, -0.016424, 0.044951, -0.20678, -0.068404],
[-0.0061911, 0.02549, -0.17773, -0.011649, -0.033779, -0.037805, -0.10673, -0.042821, 0.11269, 0.08733, 0.0073968, 0.043681, 0.017818, -0.025762, 0.053617, 0.053929, -0.045882, -0.054494, -0.01829, 0.050792],
[0.072542, 0.0064767, -0.026271, 0.11039, -0.034052, 0.048185, 0.068957, -0.088822, 0.083965, -0.032426, -0.026028, -0.062976, -0.033734, 0.05017, -0.0071563, 0.036377, -0.027785, 0.045788, -0.16057, -0.044454],
[-0.004648, 0.046087, -0.27901, 0.098064, -0.061904, 0.015661, -0.064718, -0.035866, 0.014465, 0.15614, -0.056402, 0.02919, 0.064899, -0.012066, 0.018025, 0.032618, 0.022591, 0.098127, -0.011371, 0.053108],
[0.092348, 0.0010952, -0.0059954, 0.002549, -0.0015526, 0.0006001, -0.00090017, -0.096894, -0.00043212, 0.0031098, -0.0013362, -0.068512, 0.0017058, 0.027411, -0.00020316, 0.051833, 0.00062915, 0.0030024, -0.12667, 0.0010261],
[-0.0018188, 0.055608, -0.30441, 0.12942, -0.078831, 0.03047, -0.045705, 0.0019083, -0.021941, 0.1579, -0.067846, 0.0013494, 0.08661, -0.00053986, -0.010315, -0.0010209, 0.031945, 0.15244, 0.0024948, 0.052101],
[0.072669, -0.004657, 0.015264, -0.10645, 0.031588, -0.047531, -0.071452, -0.087341, -0.083331, 0.038549, 0.023787, -0.064076, 0.036263, 0.050607, 0.0078605, 0.035065, 0.028653, -0.041889, -0.16, 0.046511],
[0.001788, 0.046306, -0.27983, 0.10233, -0.063197, 0.017546, -0.061952, 0.039336, 0.01776, 0.15474, -0.057383, -0.026688, 0.06352, 0.010081, 0.017729, -0.034025, 0.02148, 0.099853, 0.017685, 0.051316],
[0.03119, -0.0037019, 0.00052469, -0.16391, 0.051319, -0.091023, -0.14628, -0.10337, -0.14065, 0.058121, 0.029632, -0.052519, 0.062544, 0.045122, 0.05249, 0.022872, 0.014605, -0.047062, -0.2059, 0.070351],
[0.0049668, 0.025656, -0.17789, -0.0051996, -0.035828, -0.034248, -0.10105, 0.046928, 0.11832, 0.085108, 0.0062349, -0.041646, 0.015367, 0.024004, 0.05159, -0.054872, -0.046494, -0.052681, 0.026418, 0.04806],
[0.057822, 0.0015819, -0.0086989, -0.10254, 0.025957, -0.056268, -0.10132, -0.10023, -0.11389, 0.058429, 0.015547, -0.071095, 0.062314, 0.036858, -0.0011, 0.026105, 0.061097, 0.077304, -0.18756, 0.047389],
[0.0013806, 0.02828, -0.2478, 0.092947, -0.038758, 0.0028008, 0.012529, 0.044697, 0.077377, 0.071988, 0.010779, -0.031046, 0.0010044, 0.0066662, -0.12623, -0.045084, -0.044808, 0.017776, 0.016228, 0.056646],
[0.087439, 0.00080255, -0.0057786, 0.0027137, -0.00091803, 0.00011138, 0.00064189, -0.10812, 0.00033514, 0.0014623, -0.00028756, -0.059024, 0.0006845, 0.025379, -0.0033296, 0.027242, 2.5402e-05, 0.0016213, -0.13466, 0.0019404],
[-0.0017221, 0.040749, -0.29341, 0.13778, -0.046612, 0.0056551, 0.032591, 0.0021294, 0.017016, 0.074246, -0.014601, 0.0011625, 0.034755, -0.00049985, -0.16906, -0.00053653, 0.0012898, 0.082323, 0.0026522, 0.09852],
[0.057723, -0.00046713, -0.0010648, 0.10612, -0.027463, 0.056335, 0.10173, -0.10192, 0.11685, -0.055549, -0.01511, -0.069818, -0.062226, 0.036567, -0.0038711, 0.02786, -0.062814, -0.076544, -0.18805, -0.045122],
[-0.0036563, 0.02832, -0.24795, 0.088838, -0.037706, 0.00058311, 0.0085301, -0.040715, 0.072832, 0.074233, 0.011382, 0.033821, 0.0034572, -0.0081124, -0.12617, 0.044021, -0.042368, 0.020806, -0.0088305, 0.058468],
[0.066328, 0.00050249, 0.0006879, 0.099053, -0.027081, 0.043963, 0.085986, -0.064402, 0.11345, -0.045255, -0.0033627, -0.065527, -0.065674, -0.020838, 0.024403, 0.015466, -0.049327, -0.099549, -0.11056, -0.052035],
[-0.0034585, 0.08173, 0.042051, -0.20674, -0.019187, -0.017709, -0.062969, -0.020673, 0.1043, 0.0046453, 0.0023477, 0.04001, -0.060975, 0.0036578, -0.017463, 0.02278, 0.078178, 0.099432, -0.0024519, -0.126],
[0.097129, 0.0021092, 0.0011488, -0.0036647, -0.00020402, -0.00029506, 0.0001578, -0.08265, 0.0016066, -0.00015594, -5.4728e-05, -0.048474, -0.0013576, -0.037546, -0.0016562, 0.026719, 0.0026343, 0.0026627, -0.042088, -0.0029948],
[-0.001913, 0.10709, 0.058329, -0.18607, -0.010359, -0.014982, 0.0080122, 0.0016278, 0.081574, -0.0079178, -0.0027788, 0.00095469, -0.068929, 0.00073948, -0.08409, -0.00052623, 0.13375, 0.13519, 0.00082892, -0.15206],
[0.066413, 0.002716, 0.00096838, -0.10712, 0.026305, -0.044627, -0.088399, -0.063538, -0.10925, 0.045403, 0.0034526, -0.067051, 0.063222, -0.020966, -0.025072, 0.014557, 0.052367, 0.10339, -0.11038, 0.047034],
[0.00084414, 0.081687, 0.042045, -0.20268, -0.020238, -0.015965, -0.059534, 0.023193, 0.10869, 0.0028598, 0.0022134, -0.037398, -0.063514, -0.0028345, -0.016489, -0.023372, 0.076175, 0.095435, 0.0068033, -0.12795],
[0.20704, 0.0040955, 0.00091829, -0.00029318, -0.00055128, -0.00022805, 0.0051995, -0.007065, -0.0025938, -0.00022702, -0.00086173, 0.0039241, 0.0027605, -0.18349, -0.00045015, -0.021589, 0.00096281, -0.00018548, 0.23464, 0.001533],
[-0.0040776, 0.20795, 0.046625, -0.014886, -0.027991, -0.011579, 0.264, 0.00013915, -0.1317, -0.011527, -0.043754, -7.7284e-05, 0.14016, 0.0036138, -0.022856, 0.00042519, 0.048886, -0.0094174, -0.0046213, 0.077836],
[0.0016001, -0.029891, -0.0731, -0.058468, 0.1186, 0.12935, 0.032158, 0.082573, -0.0411, -0.0057089, -0.11638, -0.00536, 0.0098026, 0.099419, -0.049008, 0.096627, 0.019637, -0.043652, 0.0051687, 0.0072429],
[-0.0084656, -0.0046796, 0.045349, 0.07574, -0.034638, 0.082185, -0.12097, 0.11907, -0.077533, -0.078919, -0.012654, -0.1158, -0.086081, 0.014701, -0.0022791, -0.072634, 0.13958, -0.08019, 0.0020189, 0.12988],
[0.014244, -0.0142, -0.056192, -0.043173, 0.080962, 0.084431, 0.022293, 0.081954, 0.02152, 0.023645, -0.069978, 0.010578, 0.0055638, 0.10754, 0.047817, 0.10989, -0.10152, -0.038776, 0.0098529, -0.1048],
[-0.0019268, 0.0089254, 0.038396, 0.072665, -0.035316, 0.085966, -0.095828, 0.067001, -0.079359, -0.060241, 0.02296, -0.082724, -0.073347, 0.034409, -0.038908, -0.046993, 0.098013, -0.061029, 0.00076322, 0.10757],
[0.0059814, -0.019987, -0.05216, -0.04447, 0.076646, 0.092444, 0.004678, 0.10415, 0.0046581, 0.0051388, -0.096442, 0.0059707, -0.0081662, 0.083068, 0.047686, 0.097271, -0.082539, -0.026822, 0.0086197, -0.097325],
[-0.0021943, 0.014673, 0.029772, 0.032615, -0.070295, 0.11259, -0.099269, 0.067977, -0.030442, -0.007886, 0.04335, -0.085123, -0.024236, 0.010448, 0.034458, -0.043729, -0.1042, 0.051653, -0.0020921, -0.13234],
[-0.004206, -0.036745, -0.07115, -0.055276, 0.11733, 0.12551, 0.026702, 0.098002, -0.032058, -0.004739, -0.10681, 0.00206, 0.030173, 0.081617, -0.060518, 0.076499, 0.010561, -0.048468, 0.0058355, -0.010407],
[-0.0044632, -0.00045295, 0.035713, 0.033808, -0.072124, 0.10251, -0.12265, 0.11181, -0.025714, -0.01886, 0.019241, -0.11285, -0.030121, 0.016747, 0.051984, -0.066147, -0.080512, 0.05543, -0.0091079, -0.1189],
[0.0019322, 0.029684, 0.074829, 0.061405, -0.11987, -0.12601, -0.036896, 0.077821, 0.038016, 0.0025971, 0.11579, -0.0007963, -0.013184, 0.098763, 0.04888, 0.099412, -0.014125, 0.04046, 0.0050852, -0.0021232],
[0.008396, -0.0058529, 0.042436, 0.073379, -0.029941, 0.087214, -0.11961, -0.12223, -0.079091, -0.079083, -0.017226, 0.11592, -0.085628, -0.018604, -0.004207, 0.068773, 0.14025, -0.081846, -0.0022209, 0.13007],
[0.014309, 0.014541, 0.05766, 0.046001, -0.08229, -0.08098, -0.026049, 0.079252, -0.024628, -0.025998, 0.070828, 0.013827, -0.0084475, 0.1061, -0.049312, 0.11165, 0.1053, 0.036343, 0.0098152, 0.10895],
[0.0013644, 0.0083593, 0.036153, 0.070909, -0.032101, 0.089224, -0.094876, -0.070176, -0.07845, -0.059264, 0.020187, 0.082243, -0.073071, -0.038616, -0.036995, 0.04263, 0.093939, -0.062508, -0.0011506, 0.10336],
[0.0060632, 0.020549, 0.053291, 0.04572, -0.079355, -0.087939, -0.0085831, 0.1014, -0.0058532, -0.0054453, 0.098074, 0.0093178, 0.0072056, 0.082593, -0.046292, 0.098917, 0.078372, 0.028835, 0.0086953, 0.092038],
[0.0019571, 0.013874, 0.027695, 0.030838, -0.067223, 0.11615, -0.099008, -0.072025, -0.030235, -0.0076776, 0.039519, 0.084822, -0.024539, -0.013711, 0.036309, 0.039865, -0.10737, 0.050557, 0.0017511, -0.13607],
[-0.004027, 0.036698, 0.072501, 0.056564, -0.12008, -0.12138, -0.031511, 0.093524, 0.031021, 0.0039927, 0.10749, 0.0065019, -0.031336, 0.080895, 0.062517, 0.079044, -0.013723, 0.050613, 0.0061896, 0.0057174],
[0.0046253, -0.0018994, 0.032883, 0.031605, -0.067448, 0.10737, -0.1215, -0.11558, -0.026956, -0.019032, 0.01502, 0.11268, -0.02891, -0.019948, 0.04956, 0.063084, -0.080034, 0.053478, 0.0088711, -0.11922]
],
"numEvalues": 20,
"eigenValues": [
448.26,
152.88,
77.079,
38.34,
27.754,
15.293,
13.086,
10.197,
7.2365,
6.5965,
5.7389,
5.6223,
4.6227,
4.3931,
3.9714,
3.5791,
3.4264,
3.0788,
2.6396,
2.4414
],
"numPtsPerSample": 71,
"nonRegularizedVectors": [0],
"meanShape": [
[25.011, 34.815],
[24.382, 45.627],
[25.831, 56.165],
[28.675, 66.696],
[33.598, 75.549],
[40.333, 82.562],
[48.359, 88],
[57.764, 89.783],
[67.091, 87.631],
[74.897, 81.881],
[81.35, 74.609],
[85.921, 65.568],
[88.348, 54.934],
[89.382, 44.347],
[88.327, 33.568],
[81.567, 27.445],
[76.62, 25.173],
[69.154, 25.747],
[63.337, 27.341],
[31.525, 28.43],
[36.379, 25.966],
[43.862, 26.245],
[49.736, 27.609],
[35.982, 35.443],
[41.743, 32.491],
[48.057, 35.383],
[41.828, 37.011],
[41.961, 34.611],
[77.389, 34.628],
[71.516, 31.905],
[65.321, 35.043],
[71.61, 36.424],
[71.382, 34.031],
[56.646, 33.009],
[50.194, 46.941],
[47.457, 51.771],
[50.073, 55.035],
[57.101, 56.145],
[64.081, 54.759],
[66.566, 51.395],
[63.641, 46.676],
[56.826, 42.172],
[52.142, 53.256],
[61.943, 53.063],
[45.091, 66.457],
[49.307, 63.536],
[54.022, 62.36],
[57.236, 62.972],
[60.423, 62.234],
[65.181, 63.223],
[69.509, 65.977],
[66.693, 69.861],
[62.797, 72.43],
[57.439, 73.279],
[52.051, 72.642],
[48.057, 70.228],
[51.313, 68.335],
[57.355, 69.042],
[63.365, 68.097],
[63.303, 65.106],
[57.283, 65.373],
[51.258, 65.343],
[56.997, 50.867],
[38.345, 33.38],
[45.432, 33.213],
[45.103, 36.388],
[38.617, 36.562],
[74.947, 32.659],
[67.858, 32.771],
[68.312, 35.931],
[74.8, 35.849]
]
},
"hints": {
"rightEye": [71.382, 34.031],
"leftEye": [41.961, 34.611],
"nose": [56.997, 50.867]
}
};
// CommonJS and Node.js module support
{
// Support Node.js specific `module.exports` (which can be a function)
if ('object' !== 'undefined' && module.exports) {
exports = module.exports = pModel;
}
// But always support CommonJS module 1.1.1 spec (`exports` cannot be a function)
exports.pModel = pModel;
}
})(commonjsGlobal);
});
// webgl setup tests
/*
* Test whether we can render to floating point texture
*/
var canRenderToFloatTexture = function(webGLContext) {
var renderingSupported = false;
var gl = webGLContext;
// setup the texture
var texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.FLOAT, null);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
// setup the framebuffer
var framebuffer = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
gl.framebufferTexture2D(
gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
// check the framebuffer
var check = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
if (check == gl.FRAMEBUFFER_COMPLETE) {
renderingSupported = true;
}
// cleanup
gl.deleteTexture(texture);
gl.deleteFramebuffer(framebuffer);
gl.bindTexture(gl.TEXTURE_2D, null);
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
return renderingSupported
};
var version = "1.1.2";
/**
* clmtrackr library (https://www.github.com/auduno/clmtrackr/)
*
* Copyright (c) 2013, Audun Mathias Øygard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//import { drawPatches } from './utils.debugging.js';
var DEFAULT_MODEL = model_pca_20_svm;
// polyfills
raf_1.polyfill();
if (!window.Promise) window.Promise = promise;
var clm = {
tracker : function(params) {
if (!params) params = {};
if (params.constantVelocity === undefined) params.constantVelocity = true;
if (params.searchWindow === undefined) params.searchWindow = 11;
if (params.useWebGL === undefined) params.useWebGL = true;
if (params.scoreThreshold === undefined) params.scoreThreshold = 0.5;
if (params.stopOnConvergence === undefined) params.stopOnConvergence = false;
if (params.weightPoints === undefined) params.weightPoints = undefined;
if (params.sharpenResponse === undefined) params.sharpenResponse = false;
if (params.faceDetection === undefined) params.faceDetection = {};
if (params.eventDispatcher === undefined) params.eventDispatcher = document;
if (params.maxIterationsPerAnimFrame === undefined) params.maxIterationsPerAnimFrame = 3;
/** @type {Number} Minimum convergence before firing `clmtrackrConverged` event. */
var convergenceThreshold = 0.5;
var numPatches, patchSize, numParameters, patchType;
var gaussianPD;
var eigenVectors, eigenValues;
var sketchCC, sketchW, sketchH, sketchCanvas;
var weights, model, biases;
var sobelInit = false;
var lbpInit = false;
var currentParameters = [];
var currentPositions = [];
var previousParameters = [];
var previousPositions = [];
var patches = [];
var responses = [];
var meanShape = [];
var responseMode = 'single';
var responseList = ['raw'];
var responseIndex = 0;
/*
It's possible to experiment with the sequence of variances used for the finding the maximum in the KDE.
This sequence is pretty arbitrary, but was found to be okay using some manual testing.
*/
var varianceSeq = [10,5,1];
//var varianceSeq = [3,1.5,0.75];
//var varianceSeq = [6,3,0.75];
var PDMVariance = 0.7;
var relaxation = 0.1;
var first = true;
var detectingFace = false;
var convergenceLimit = 0.01;
var searchWindow;
var modelWidth, modelHeight;
var halfSearchWindow, vecProbs, responsePixels;
if(typeof Float64Array !== 'undefined') {
var updatePosition = new Float64Array(2);
var vecpos = new Float64Array(2);
} else {
var updatePosition = new Array(2);
var vecpos = new Array(2);
}
var pw, pl, pdataLength;
var facecheck_count = 0;
var webglFi, svmFi, mosseCalc;
var scoringCanvas = document.createElement('canvas');
var scoringContext = scoringCanvas.getContext('2d');
var msxmin, msymin, msxmax, msymax;
var msmodelwidth, msmodelheight;
var scoringWeights, scoringBias;
var scoringHistory = [];
var meanscore = 0;
var runnerTimeout, runnerElement, runnerBox;
var pointWeights;
var halfPI = Math.PI/2;
var faceDetector;
/*
* load model data, initialize filters, etc.
*
* @param <Object> pdm model object
*/
this.init = function(pdmmodel) {
// default model is pca 20 svm model
if (pdmmodel === undefined) pdmmodel = DEFAULT_MODEL;
model = pdmmodel;
// load from model
patchType = model.patchModel.patchType;
numPatches = model.patchModel.numPatches;
patchSize = model.patchModel.patchSize[0];
if (patchType == 'MOSSE') {
searchWindow = patchSize;
} else {
searchWindow = params.searchWindow;
}
numParameters = model.shapeModel.numEvalues;
modelWidth = model.patchModel.canvasSize[0];
modelHeight = model.patchModel.canvasSize[1];
// set up canvas to work on
sketchCanvas = document.createElement('canvas');
sketchCC = sketchCanvas.getContext('2d');
sketchW = sketchCanvas.width = modelWidth + (searchWindow-1) + patchSize-1;
sketchH = sketchCanvas.height = modelHeight + (searchWindow-1) + patchSize-1;
// load eigenvectors
eigenVectors = numeric1_2_6.rep([numPatches*2,numParameters],0.0);
for (var i = 0;i < numPatches*2;i++) {
for (var j = 0;j < numParameters;j++) {
eigenVectors[i][j] = model.shapeModel.eigenVectors[i][j];
}
}
// load mean shape
for (var i = 0; i < numPatches;i++) {
meanShape[i] = [model.shapeModel.meanShape[i][0], model.shapeModel.meanShape[i][1]];
}
// get max and mins, width and height of meanshape
msxmax = msymax = 0;
msxmin = msymin = 1000000;
for (var i = 0;i < numPatches;i++) {
if (meanShape[i][0] < msxmin) msxmin = meanShape[i][0];
if (meanShape[i][1] < msymin) msymin = meanShape[i][1];
if (meanShape[i][0] > msxmax) msxmax = meanShape[i][0];
if (meanShape[i][1] > msymax) msymax = meanShape[i][1];
}
msmodelwidth = msxmax-msxmin;
msmodelheight = msymax-msymin;
// get scoringweights if they exist
if (model.scoring) {
scoringWeights = new Float64Array(model.scoring.coef);
scoringBias = model.scoring.bias;
scoringCanvas.width = model.scoring.size[0];
scoringCanvas.height = model.scoring.size[1];
}
// load eigenvalues
eigenValues = model.shapeModel.eigenValues;
weights = model.patchModel.weights;
biases = model.patchModel.bias;
// precalculate gaussianPriorDiagonal
gaussianPD = numeric1_2_6.rep([numParameters+4, numParameters+4],0);
// set values and append manual inverse
for (var i = 0;i < numParameters;i++) {
if (model.shapeModel.nonRegularizedVectors.indexOf(i) >= 0) {
gaussianPD[i+4][i+4] = 1/10000000;
} else {
gaussianPD[i+4][i+4] = 1/eigenValues[i];
}
}
for (var i = 0;i < numParameters+4;i++) {
currentParameters[i] = 0;
}
if (patchType == 'SVM') {
var webGLContext;
var webGLTestCanvas = document.createElement('canvas');
if (window.WebGLRenderingContext) {
webGLContext = webGLTestCanvas.getContext('webgl') || webGLTestCanvas.getContext('experimental-webgl');
if (!webGLContext || !webGLContext.getExtension('OES_texture_float')) {
webGLContext = null;
} else {
// test whether it's possible to render to float texture
if (!canRenderToFloatTexture(webGLContext)) {
webGLContext = null;
}
}
}
if (webGLContext && params.useWebGL && (typeof(webglFilter) !== 'undefined')) {
webglFi = new webglFilter();
try {
webglFi.init(weights, biases, numPatches, searchWindow+patchSize-1, searchWindow+patchSize-1, patchSize, patchSize);
if ('lbp' in weights) lbpInit = true;
if ('sobel' in weights) sobelInit = true;
}
catch(err) {
console.error(err);
alert('There was a problem setting up webGL programs, falling back to slightly slower javascript version. :(');
webglFi = undefined;
svmFi = new svmFilter();
svmFi.init(weights['raw'], biases['raw'], numPatches, patchSize, searchWindow);
}
} else if (typeof(svmFilter) !== 'undefined') {
// use fft convolution if no webGL is available
svmFi = new svmFilter();
svmFi.init(weights['raw'], biases['raw'], numPatches, patchSize, searchWindow);
} else {
throw new Error('Could not initiate filters, please make sure that svmfilter.js or svmfilter_conv_js.js is loaded.');
}
} else if (patchType == 'MOSSE') {
mosseCalc = new mosseFilterResponses();
mosseCalc.init(weights, numPatches, patchSize, patchSize);
}
if (patchType == 'SVM') {
pw = pl = patchSize+searchWindow-1;
} else {
pw = pl = searchWindow;
}
pdataLength = pw*pl;
halfSearchWindow = (searchWindow-1)/2;
responsePixels = searchWindow*searchWindow;
if(typeof Float64Array !== 'undefined') {
vecProbs = new Float64Array(responsePixels);
for (var i = 0;i < numPatches;i++) {
patches[i] = new Float64Array(pdataLength);
}
} else {
vecProbs = new Array(responsePixels);
for (var i = 0;i < numPatches;i++) {
patches[i] = new Array(pdataLength);
}
}
if (params.weightPoints) {
// weighting of points
pointWeights = [];
for (var i = 0;i < numPatches;i++) {
if (i in params.weightPoints) {
pointWeights[(i*2)] = params.weightPoints[i];
pointWeights[(i*2)+1] = params.weightPoints[i];
} else {
pointWeights[(i*2)] = 1;
pointWeights[(i*2)+1] = 1;
}
}
pointWeights = numeric1_2_6.diag(pointWeights);
}
faceDetector = new faceDetection(model, params.faceDetection);
};
/*
* starts the tracker to run on a regular interval
*/
this.start = function(element, box) {
// check if model is initalized, else return false
if (typeof(model) === 'undefined') {
console.log('tracker needs to be initalized before starting to track.');
return false;
}
//check if a runnerelement already exists, if not, use passed parameters
if (typeof(runnerElement) === 'undefined') {
runnerElement = element;
runnerBox = box;
}
faceDetector.init(element);
// start named timeout function
runnerTimeout = requestAnimationFrame(runnerFunction);
};
var runnerFunction = function() {
runnerTimeout = requestAnimationFrame(runnerFunction);
// schedule as many iterations as we can during each request
var startTime = (new Date()).getTime();
var run_counter = 0;
while ((((new Date()).getTime() - startTime) < 16)
&& run_counter < params.maxIterationsPerAnimFrame) {
var tracking = this.track(runnerElement, runnerBox);
if (!tracking) break;
run_counter++;
}
}.bind(this);
/*
* stop the running tracker
*/
this.stop = function() {
// stop the running tracker if any exists
cancelAnimationFrame(runnerTimeout);
};
/*
* element : canvas or video element
* TODO: should be able to take img element as well
*/
this.track = function(element, box) {
emitEvent('clmtrackrBeforeTrack', params.eventDispatcher);
var scaling, translateX, translateY, rotation;
var ptch, px, py;
if (first) {
if (!detectingFace) {
detectingFace = true;
// this returns a Promise
faceDetector.getInitialPosition(box)
.then(function (result) {
scaling = result[0];
rotation = result[1];
translateX = result[2];
translateY = result[3];
currentParameters[0] = (scaling*Math.cos(rotation))-1;
currentParameters[1] = (scaling*Math.sin(rotation));
currentParameters[2] = translateX;
currentParameters[3] = translateY;
currentPositions = calculatePositions(currentParameters, true);
first = false;
detectingFace = false;
})
.catch(function (error) {
// send an event on no face found
emitEvent('clmtrackrNotFound', params.eventDispatcher);
detectingFace = false;
});
}
return false;
} else {
facecheck_count += 1;
if (params.constantVelocity) {
// calculate where to get patches via constant velocity prediction
if (previousParameters.length >= 2) {
for (var i = 0;i < currentParameters.length;i++) {
currentParameters[i] = (relaxation)*previousParameters[1][i] + (1-relaxation)*((2*previousParameters[1][i]) - previousParameters[0][i]);
//currentParameters[i] = (3*previousParameters[2][i]) - (3*previousParameters[1][i]) + previousParameters[0][i];
}
}
}
// change translation, rotation and scale parameters
rotation = halfPI - Math.atan((currentParameters[0]+1)/currentParameters[1]);
if (rotation > halfPI) {
rotation -= Math.PI;
}
scaling = currentParameters[1] / Math.sin(rotation);
translateX = currentParameters[2];
translateY = currentParameters[3];
}
// copy canvas to a new dirty canvas
sketchCC.save();
// clear canvas
sketchCC.clearRect(0, 0, sketchW, sketchH);
sketchCC.scale(1/scaling, 1/scaling);
sketchCC.rotate(-rotation);
sketchCC.translate(-translateX, -translateY);
sketchCC.drawImage(element, 0, 0, element.width, element.height);
sketchCC.restore();
// get cropped images around new points based on model parameters (not scaled and translated)
var patchPositions = calculatePositions(currentParameters, false);
// check whether tracking is ok
if (scoringWeights && (facecheck_count % 10 == 0)) {
if (!checkTracking()) {
// reset all parameters
resetParameters();
// send event to signal that tracking was lost
emitEvent('clmtrackrLost', params.eventDispatcher);
return false;
}
}
var pdata, pmatrix, grayscaleColor;
for (var i = 0; i < numPatches; i++) {
px = patchPositions[i][0]-(pw/2);
py = patchPositions[i][1]-(pl/2);
ptch = sketchCC.getImageData(Math.round(px), Math.round(py), pw, pl);
pdata = ptch.data;
// convert to grayscale
pmatrix = patches[i];
for (var j = 0;j < pdataLength;j++) {
grayscaleColor = pdata[j*4]*0.3 + pdata[(j*4)+1]*0.59 + pdata[(j*4)+2]*0.11;
pmatrix[j] = grayscaleColor;
}
}
// draw weights for debugging
//drawPatches(sketchCC, weights, patchSize, patchPositions, function(x) {return x*2000+127});
// draw patches for debugging
//drawPatches(sketchCC, patches, pw, patchPositions, false, [27,32,44,50]);
if (patchType == 'SVM') {
if (typeof(webglFi) !== 'undefined') {
responses = getWebGLResponses(patches);
} else if (typeof(svmFi) !== 'undefined') {
responses = svmFi.getResponses(patches);
} else {
throw new Error('SVM-filters do not seem to be initiated properly.');
}
} else if (patchType == 'MOSSE') {
responses = mosseCalc.getResponses(patches);
}
// option to increase sharpness of responses
if (params.sharpenResponse) {
for (var i = 0;i < numPatches;i++) {
for (var j = 0;j < responses[i].length;j++) {
responses[i][j] = Math.pow(responses[i][j], params.sharpenResponse);
}
}
}
// draw responses for debugging
//drawPatches(sketchCC, responses, searchWindow, patchPositions, function(x) {return x*255});
// iterate until convergence or max 10, 20 iterations?:
var originalPositions = currentPositions;
var jac;
var meanshiftVectors = [];
for (var i = 0; i < varianceSeq.length; i++) {
// calculate jacobian
jac = createJacobian(currentParameters, eigenVectors);
// for debugging
//var debugMVs = [];
var opj0, opj1;
for (var j = 0;j < numPatches;j++) {
opj0 = originalPositions[j][0]-((searchWindow-1)*scaling/2);
opj1 = originalPositions[j][1]-((searchWindow-1)*scaling/2);
// calculate PI x gaussians
var vpsum = gpopt(searchWindow, currentPositions[j], updatePosition, vecProbs, responses, opj0, opj1, j, varianceSeq[i], scaling);
// calculate meanshift-vector
gpopt2(searchWindow, vecpos, updatePosition, vecProbs, vpsum, opj0, opj1, scaling);
//var debugMatrixMV = gpopt2(searchWindow, vecpos, updatePosition, vecProbs, vpsum, opj0, opj1);
meanshiftVectors[j] = [vecpos[0] - currentPositions[j][0], vecpos[1] - currentPositions[j][1]];
//debugMVs[j] = debugMatrixMV;
}
// draw meanshiftVector for debugging
//drawPatches(sketchCC, debugMVs, searchWindow, patchPositions, function(x) {return x*255*500});
var meanShiftVector = numeric1_2_6.rep([numPatches*2, 1],0.0);
for (var k = 0;k < numPatches;k++) {
meanShiftVector[k*2][0] = meanshiftVectors[k][0];
meanShiftVector[(k*2)+1][0] = meanshiftVectors[k][1];
}
// compute pdm parameter update
//var prior = numeric.mul(gaussianPD, PDMVariance);
var prior = numeric1_2_6.mul(gaussianPD, varianceSeq[i]);
var jtj;
if (params.weightPoints) {
jtj = numeric1_2_6.dot(numeric1_2_6.transpose(jac), numeric1_2_6.dot(pointWeights, jac));
} else {
jtj = numeric1_2_6.dot(numeric1_2_6.transpose(jac), jac);
}
var cpMatrix = numeric1_2_6.rep([numParameters+4, 1],0.0);
for (var l = 0;l < (numParameters+4);l++) {
cpMatrix[l][0] = currentParameters[l];
}
var priorP = numeric1_2_6.dot(prior, cpMatrix);
var jtv;
if (params.weightPoints) {
jtv = numeric1_2_6.dot(numeric1_2_6.transpose(jac), numeric1_2_6.dot(pointWeights, meanShiftVector));
} else {
jtv = numeric1_2_6.dot(numeric1_2_6.transpose(jac), meanShiftVector);
}
var paramUpdateLeft = numeric1_2_6.add(prior, jtj);
var paramUpdateRight = numeric1_2_6.sub(priorP, jtv);
var paramUpdate = numeric1_2_6.dot(numeric1_2_6.inv(paramUpdateLeft), paramUpdateRight);
//var paramUpdate = numeric.solve(paramUpdateLeft, paramUpdateRight, true);
var oldPositions = currentPositions;
// update estimated parameters
for (var k = 0;k < numParameters+4;k++) {
currentParameters[k] -= paramUpdate[k];
}
// clipping of parameters if they're too high
var clip;
for (var k = 0;k < numParameters;k++) {
clip = Math.abs(3*Math.sqrt(eigenValues[k]));
if (Math.abs(currentParameters[k+4]) > clip) {
if (currentParameters[k+4] > 0) {
currentParameters[k+4] = clip;
} else {
currentParameters[k+4] = -clip;
}
}
}
// update current coordinates
currentPositions = calculatePositions(currentParameters, true);
// check if converged
// calculate norm of parameterdifference
var positionNorm = 0;
var pnsq_x, pnsq_y;
for (var k = 0;k < currentPositions.length;k++) {
pnsq_x = (currentPositions[k][0]-oldPositions[k][0]);
pnsq_y = (currentPositions[k][1]-oldPositions[k][1]);
positionNorm += ((pnsq_x*pnsq_x) + (pnsq_y*pnsq_y));
}
// if norm < limit, then break
if (positionNorm < convergenceLimit) {
break;
}
}
if (params.constantVelocity) {
// add current parameter to array of previous parameters
previousParameters.push(currentParameters.slice());
if (previousParameters.length == 3) {
previousParameters.shift();
}
}
// store positions, for checking convergence
if (previousPositions.length == 10) {
previousPositions.shift();
}
previousPositions.push(currentPositions.slice(0));
// send an event on each iteration
emitEvent('clmtrackrIteration', params.eventDispatcher);
// we must get a score before we can say we've converged
if (scoringHistory.length >= 5 && this.getConvergence() < convergenceThreshold) {
if (params.stopOnConvergence) {
this.stop();
}
emitEvent('clmtrackrConverged', params.eventDispatcher);
}
// return new points
return currentPositions;
};
function resetParameters() {
first = true;
scoringHistory = [];
previousParameters = [];
currentPositions = [];
previousPositions = [];
for (var i = 0;i < currentParameters.length;i++) {
currentParameters[i] = 0;
}
}
/*
* reset tracking, so that track() will start a new detection
*/
this.reset = function() {
resetParameters();
runnerElement = undefined;
runnerBox = undefined;
};
/*
* draw model on given canvas
*/
this.draw = function(canvas, pv, path) {
// if no previous points, just draw in the middle of canvas
var params;
if (pv === undefined) {
params = currentParameters.slice(0);
} else {
params = pv.slice(0);
}
var cc = canvas.getContext('2d');
cc.fillStyle = 'rgb(200,200,200)';
cc.strokeStyle = 'rgb(130,255,50)';
//cc.lineWidth = 1;
var paths;
if (path === undefined) {
paths = model.path.normal;
} else {
paths = model.path[path];
}
for (var i = 0;i < paths.length;i++) {
if (typeof(paths[i]) == 'number') {
drawPoint(cc, paths[i], params);
} else {
drawPath(cc, paths[i], params);
}
}
};
/*
* get the score of the current model fit
* (based on svm of face according to current model)
*/
this.getScore = function() {
return meanscore;
};
/*
* calculate positions based on parameters
*/
this.calculatePositions = function(parameters) {
return calculatePositions(parameters, true);
};
/*
* get coordinates of current model fit
*/
this.getCurrentPosition = function() {
if (first) {
return false;
} else {
return currentPositions;
}
};
/*
* get parameters of current model fit
*/
this.getCurrentParameters = function() {
return currentParameters;
};
/*
* Get the average of recent model movements
* Used for checking whether model fit has converged
*/
this.getConvergence = function() {
if (previousPositions.length < 10) return 999999;
var prevX = 0.0;
var prevY = 0.0;
var currX = 0.0;
var currY = 0.0;
// average 5 previous positions
for (var i = 0;i < 5;i++) {
for (var j = 0;j < numPatches;j++) {
prevX += previousPositions[i][j][0];
prevY += previousPositions[i][j][1];
}
}
prevX /= 5;
prevY /= 5;
// average 5 positions before that
for (var i = 5;i < 10;i++) {
for (var j = 0;j < numPatches;j++) {
currX += previousPositions[i][j][0];
currY += previousPositions[i][j][1];
}
}
currX /= 5;
currY /= 5;
// calculate difference
var diffX = currX-prevX;
var diffY = currY-prevY;
var msavg = ((diffX*diffX) + (diffY*diffY));
msavg /= previousPositions.length;
return msavg;
};
/*
* Set response mode (only useful if webGL is available)
* mode : either "single", "blend" or "cycle"
* list : array of values "raw", "sobel", "lbp"
*/
this.setResponseMode = function(mode, list) {
// clmtrackr must be initialized with model first
if (typeof(model) === 'undefined') {
console.log('Clmtrackr has not been initialized with a model yet. No changes made.');
return;
}
// must check whether webGL or not
if (typeof(webglFi) === 'undefined') {
console.log('Responsemodes are only allowed when using webGL. In pure JS, only "raw" mode is available.');
return;
}
if (['single', 'blend', 'cycle'].indexOf(mode) < 0) {
console.log('Tried to set an unknown responsemode : "'+mode+'". No changes made.');
return;
}
if (!(list instanceof Array)) {
console.log('List in setResponseMode must be an array of strings! No changes made.');
return;
} else {
for (var i = 0;i < list.length;i++) {
if (['raw', 'sobel', 'lbp'].indexOf(list[i]) < 0) {
console.log('Unknown element in responsemode list : "'+list[i]+'". No changes made.');
}
// check whether filters are initialized
if (list[i] == 'sobel' && sobelInit == false) {
console.log('The sobel filters have not been initialized! No changes made.');
}
if (list[i] == 'lbp' && lbpInit == false) {
console.log('The LBP filters have not been initialized! No changes made.');
}
}
}
// reset index
responseIndex = 0;
responseMode = mode;
responseList = list;
};
var getWebGLResponsesType = function(type, patches) {
if (type == 'lbp') {
return webglFi.getLBPResponses(patches);
} else if (type == 'raw') {
return webglFi.getRawResponses(patches);
} else if (type == 'sobel') {
return webglFi.getSobelResponses(patches);
}
};
var getWebGLResponses = function(patches) {
if (responseMode == 'single') {
return getWebGLResponsesType(responseList[0], patches);
} else if (responseMode == 'cycle') {
var response = getWebGLResponsesType(responseList[responseIndex], patches);
responseIndex++;
if (responseIndex >= responseList.length) responseIndex = 0;
return response;
} else {
// blend
var responses = [];
for (var i = 0;i < responseList.length;i++) {
responses[i] = getWebGLResponsesType(responseList[i], patches);
}
var blendedResponses = [];
var searchWindowSize = searchWindow * searchWindow;
for (var i = 0;i < numPatches;i++) {
var response = Array(searchWindowSize);
for (var k = 0;k < searchWindowSize;k++) response[k] = 0;
for (var j = 0;j < responseList.length;j++) {
for (var k = 0;k < searchWindowSize;k++) {
response[k] += (responses[j][i][k]/responseList.length);
}
}
blendedResponses[i] = response;
}
return blendedResponses;
}
};
// generates the jacobian matrix used for optimization calculations
var createJacobian = function(parameters, eigenVectors) {
var jacobian = numeric1_2_6.rep([2*numPatches, numParameters+4],0.0);
var j0,j1;
for (var i = 0;i < numPatches;i ++) {
// 1
j0 = meanShape[i][0];
j1 = meanShape[i][1];
for (var p = 0;p < numParameters;p++) {
j0 += parameters[p+4]*eigenVectors[i*2][p];
j1 += parameters[p+4]*eigenVectors[(i*2)+1][p];
}
jacobian[i*2][0] = j0;
jacobian[(i*2)+1][0] = j1;
// 2
j0 = meanShape[i][1];
j1 = meanShape[i][0];
for (var p = 0;p < numParameters;p++) {
j0 += parameters[p+4]*eigenVectors[(i*2)+1][p];
j1 += parameters[p+4]*eigenVectors[i*2][p];
}
jacobian[i*2][1] = -j0;
jacobian[(i*2)+1][1] = j1;
// 3
jacobian[i*2][2] = 1;
jacobian[(i*2)+1][2] = 0;
// 4
jacobian[i*2][3] = 0;
jacobian[(i*2)+1][3] = 1;
// the rest
for (var j = 0;j < numParameters;j++) {
j0 = parameters[0]*eigenVectors[i*2][j] - parameters[1]*eigenVectors[(i*2)+1][j] + eigenVectors[i*2][j];
j1 = parameters[0]*eigenVectors[(i*2)+1][j] + parameters[1]*eigenVectors[i*2][j] + eigenVectors[(i*2)+1][j];
jacobian[i*2][j+4] = j0;
jacobian[(i*2)+1][j+4] = j1;
}
}
return jacobian;
};
// calculate positions from parameters
var calculatePositions = function(parameters, useTransforms) {
var x, y, a, b;
var numParameters = parameters.length;
var positions = [];
for (var i = 0;i < numPatches;i++) {
x = meanShape[i][0];
y = meanShape[i][1];
for (var j = 0;j < numParameters-4;j++) {
x += model.shapeModel.eigenVectors[(i*2)][j]*parameters[j+4];
y += model.shapeModel.eigenVectors[(i*2)+1][j]*parameters[j+4];
}
if (useTransforms) {
a = parameters[0]*x - parameters[1]*y + parameters[2];
b = parameters[0]*y + parameters[1]*x + parameters[3];
x += a;
y += b;
}
positions[i] = [x,y];
}
return positions;
};
// part one of meanshift calculation
var gpopt = function(responseWidth, currentPositionsj, updatePosition, vecProbs, responses, opj0, opj1, j, variance, scaling) {
var pos_idx = 0;
var vpsum = 0;
var dx, dy;
for (var k = 0;k < responseWidth;k++) {
updatePosition[1] = opj1+(k*scaling);
for (var l = 0;l < responseWidth;l++) {
updatePosition[0] = opj0+(l*scaling);
dx = currentPositionsj[0] - updatePosition[0];
dy = currentPositionsj[1] - updatePosition[1];
vecProbs[pos_idx] = responses[j][pos_idx] * Math.exp(-0.5*((dx*dx)+(dy*dy))/(variance*scaling));
vpsum += vecProbs[pos_idx];
pos_idx++;
}
}
return vpsum;
};
// part two of meanshift calculation
var gpopt2 = function(responseWidth, vecpos, updatePosition, vecProbs, vpsum, opj0, opj1, scaling) {
//for debugging
//var vecmatrix = [];
var pos_idx = 0;
var vecsum = 0;
vecpos[0] = 0;
vecpos[1] = 0;
for (var k = 0;k < responseWidth;k++) {
updatePosition[1] = opj1+(k*scaling);
for (var l = 0;l < responseWidth;l++) {
updatePosition[0] = opj0+(l*scaling);
vecsum = vecProbs[pos_idx]/vpsum;
//vecmatrix[k*responseWidth + l] = vecsum;
vecpos[0] += vecsum*updatePosition[0];
vecpos[1] += vecsum*updatePosition[1];
pos_idx++;
}
}
//return vecmatrix;
};
// calculate score of current fit
var checkTracking = function() {
var trackingImgW = 20;
var trackingImgH = 22;
scoringContext.drawImage(sketchCanvas, Math.round(msxmin+(msmodelwidth/4.5)), Math.round(msymin-(msmodelheight/12)), Math.round(msmodelwidth-(msmodelwidth*2/4.5)), Math.round(msmodelheight-(msmodelheight/12)), 0, 0, trackingImgW, trackingImgH);
// getImageData of canvas
var imgData = scoringContext.getImageData(0,0,trackingImgW,trackingImgH);
// convert data to grayscale
var trackingImgSize = trackingImgW * trackingImgH;
var scoringData = new Array(trackingImgSize);
var scdata = imgData.data;
var scmax = 0;
for (var i = 0;i < trackingImgSize;i++) {
scoringData[i] = scdata[i*4]*0.3 + scdata[(i*4)+1]*0.59 + scdata[(i*4)+2]*0.11;
scoringData[i] = Math.log(scoringData[i]+1);
if (scoringData[i] > scmax) scmax = scoringData[i];
}
if (scmax > 0) {
// normalize & multiply by svmFilter
var mean = 0;
for (var i = 0;i < trackingImgSize;i++) {
mean += scoringData[i];
}
mean /= trackingImgSize;
var sd = 0;
for (var i = 0;i < trackingImgSize;i++) {
sd += (scoringData[i]-mean)*(scoringData[i]-mean);
}
sd /= trackingImgSize;
sd = Math.sqrt(sd);
var score = 0;
for (var i = 0;i < trackingImgSize;i++) {
scoringData[i] = (scoringData[i]-mean)/sd;
score += (scoringData[i])*scoringWeights[i];
}
score += scoringBias;
score = 1/(1+Math.exp(-score));
if (scoringHistory.length == 5) {
scoringHistory.shift();
}
scoringHistory.push(score);
if (scoringHistory.length > 4) {
// get average
meanscore = 0;
for (var i = 0;i < 5;i++) {
meanscore += scoringHistory[i];
}
meanscore /= 5;
// if below threshold, then reset (return false)
if (meanscore < params.scoreThreshold) return false;
}
}
return true;
};
// draw a parametrized line on a canvas
var drawPath = function(canvasContext, path, dp) {
canvasContext.beginPath();
var i, x, y, a, b;
for (var p = 0;p < path.length;p++) {
i = path[p]*2;
x = meanShape[i/2][0];
y = meanShape[i/2][1];
for (var j = 0;j < numParameters;j++) {
x += model.shapeModel.eigenVectors[i][j]*dp[j+4];
y += model.shapeModel.eigenVectors[i+1][j]*dp[j+4];
}
a = dp[0]*x - dp[1]*y + dp[2];
b = dp[0]*y + dp[1]*x + dp[3];
x += a;
y += b;
if (i == 0) {
canvasContext.moveTo(x,y);
} else {
canvasContext.lineTo(x,y);
}
}
canvasContext.moveTo(0,0);
canvasContext.closePath();
canvasContext.stroke();
};
// draw a point on a canvas
function drawPoint(canvasContext, point, dp) {
var i, x, y, a, b;
i = point*2;
x = meanShape[i/2][0];
y = meanShape[i/2][1];
for (var j = 0;j < numParameters;j++) {
x += model.shapeModel.eigenVectors[i][j]*dp[j+4];
y += model.shapeModel.eigenVectors[i+1][j]*dp[j+4];
}
a = dp[0]*x - dp[1]*y + dp[2];
b = dp[0]*y + dp[1]*x + dp[3];
x += a;
y += b;
canvasContext.beginPath();
canvasContext.arc(x, y, 1, 0, Math.PI*2, true);
canvasContext.closePath();
canvasContext.fill();
}
return true;
},
version : version
};
return clm;
})));