From 7952ec984f809c9bf0651eeed3c4aaec037e6c7c Mon Sep 17 00:00:00 2001 From: Pierce Stegman Date: Sat, 9 Nov 2019 13:49:48 -0600 Subject: [PATCH] Published v1.6.5 --- browser.js | 2 +- dist/bci.js | 4 ++-- dist/bci.min.js | 2 +- docs/docs/index.js.html | 2 +- index.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/browser.js b/browser.js index 80223f2..090ac92 100644 --- a/browser.js +++ b/browser.js @@ -1,5 +1,5 @@ // This file was auto generated, changes will be overwritten -// Created on Sat Nov 09 2019 13:41:27 GMT-0600 (Central Standard Time) +// Created on Sat Nov 09 2019 13:46:57 GMT-0600 (Central Standard Time) // This module excludes Node.js specific methods so it can be used in the browser /** @module bcijs */ module.exports.csp = require('./lib/compat/csp.js'); diff --git a/dist/bci.js b/dist/bci.js index ef7bfb9..e486d37 100644 --- a/dist/bci.js +++ b/dist/bci.js @@ -3,14 +3,14 @@ * /~https://github.com/pwstegman/bci.js * * License: MIT - * Generated 2019-11-09T19:41:27Z + * Generated 2019-11-09T19:46:57Z */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.bci = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i=this.size&&(this.callback(this.channels),this.clear())},u.prototype.clear=function(){this.length=0;for(var r=0;r1?i-1:0),a=1;a1?t-1:0),i=1;i1?e-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:"python";t=t.split(" ");var o=[];return t.forEach(function(t){t.indexOf(":");var e=t.split(":");e.length>2||""==t?console.error("Invalid subscript string"):(""==e[1]&&(e[1]=r.length),e=e.map(Number),"matlab"!=i&&"mat"!=i||(e[0]>0&&(e[0]-=1),-1==e[1]&&(e[1]=r.length),e[1]<0&&(e[1]+=1)),1==e.length&&e.push(e[0]+1),o.push(r.slice.apply(r,n(e))))}),(e=[]).concat.apply(e,o)}(t,i.shift(),"matlab");if(0!=i.length)for(var u=0;u3&&void 0!==arguments[3]?arguments[3]:-1,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];-1==n&&(n=e);for(var o=[],a=0;a3&&void 0!==arguments[3]?arguments[3]:null,a=new Array(e.length),u=0;u1&&void 0!==arguments[1]?arguments[1]:null;if(null==t)return n.log(n.var(r));if(-1==["rows","cols","columns"].indexOf(t))throw"Invalid dimension";return"cols"!=t&&"columns"!=t||(r=i(r)),r.map(function(r){return n.log(n.var(r))})},t.exports.variance=function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null==t)return n.log(n.var(r));if(-1==["rows","cols","columns"].indexOf(t))throw"Invalid dimension";return"cols"!=t&&"columns"!=t||(r=i(r)),r.map(function(r){return n.var(r)})},t.exports.rootMeanSquare=function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null==t)return n.sqrt(n.mean(n.square(r)));if(-1==["rows","cols","columns"].indexOf(t))throw"Invalid dimension";return"cols"!=t&&"columns"!=t||(r=i(r)),r.map(function(r){return n.sqrt(n.mean(n.square(r)))})}},{"./signalBandPower.js":24,"./transpose.js":25,"mathjs/core":47,"mathjs/lib/function/arithmetic":71,"mathjs/lib/function/matrix":98,"mathjs/lib/function/statistics":131,"mathjs/lib/type/matrix":197}],17:[function(r,t,e){"use strict";var n=r("mathjs/core").create();n.import(r("mathjs/lib/type/matrix")),n.import(r("mathjs/lib/type/bignumber")),n.import(r("mathjs/lib/function/arithmetic")),n.import(r("mathjs/lib/function/matrix")),n.import(r("mathjs/lib/function/trigonometry")),t.exports=function(r,t,e,i){for(var o=n.range(0,i,1/e),a=n.zeros(o.size()[0]),u=0;u3&&void 0!==arguments[3]?arguments[3]:null;null===i&&(i=Math.pow(2,n(r.length))),("string"==typeof e||e instanceof String)&&(e={delta:[1,3],theta:[4,7],alpha:[8,12],beta:[13,30],gamma:[31,50]}[e]);for(var o=Math.floor(e[0]/t*i),a=Math.min(Math.ceil(e[1]/t*i),r.length-1),u=0,s=o;s<~]))"].join("|");return new RegExp(r,"g")}},{}],36:[function(r,t,e){"use strict";e.byteLength=function(r){var t=c(r),e=t[0],n=t[1];return 3*(e+n)/4-n},e.toByteArray=function(r){var t,e,n=c(r),a=n[0],u=n[1],s=new o(function(r,t,e){return 3*(t+e)/4-e}(0,a,u)),f=0,l=u>0?a-4:a;for(e=0;e>16&255,s[f++]=t>>8&255,s[f++]=255&t;2===u&&(t=i[r.charCodeAt(e)]<<2|i[r.charCodeAt(e+1)]>>4,s[f++]=255&t);1===u&&(t=i[r.charCodeAt(e)]<<10|i[r.charCodeAt(e+1)]<<4|i[r.charCodeAt(e+2)]>>2,s[f++]=t>>8&255,s[f++]=255&t);return s},e.fromByteArray=function(r){for(var t,e=r.length,i=e%3,o=[],a=0,u=e-i;au?u:a+16383));1===i?(t=r[e-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(r[e-2]<<8)+r[e-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function f(r,t,e){for(var i,o,a=[],u=t;u>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],37:[function(r,t,e){(function(t){"use strict";function n(r){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var i=r("base64-js"),o=r("ieee754"),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=t,e.SlowBuffer=function(r){+r!=r&&(r=0);return t.alloc(+r)},e.INSPECT_MAX_BYTES=50;var u=2147483647;function s(r){if(r>u)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,t.prototype),e}function t(r,t,e){if("number"==typeof r){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(r)}return c(r,t,e)}function c(r,e,i){if("string"==typeof r)return function(r,e){"string"==typeof e&&""!==e||(e="utf8");if(!t.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|p(r,e),i=s(n),o=i.write(r,e);o!==n&&(i=i.slice(0,o));return i}(r,e);if(ArrayBuffer.isView(r))return m(r);if(null==r)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(r));if(D(r,ArrayBuffer)||r&&D(r.buffer,ArrayBuffer))return function(r,e,n){if(e<0||r.byteLength=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return 0|r}function p(r,e){if(t.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||D(r,ArrayBuffer))return r.byteLength;if("string"!=typeof r)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+n(r));var i=r.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===i)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return F(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return q(r).length;default:if(a)return o?-1:F(r).length;e=(""+e).toLowerCase(),a=!0}}function g(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function y(r,e,n,i,o){if(0===r.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),R(n=+n)&&(n=o?0:r.length-1),n<0&&(n=r.length+n),n>=r.length){if(o)return-1;n=r.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=t.from(e,i)),t.isBuffer(e))return 0===e.length?-1:d(r,e,n,i,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(r,e,n):Uint8Array.prototype.lastIndexOf.call(r,e,n):d(r,[e],n,i,o);throw new TypeError("val must be string, number or Buffer")}function d(r,t,e,n,i){var o,a=1,u=r.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(r.length<2||t.length<2)return-1;a=2,u/=2,s/=2,e/=2}function c(r,t){return 1===a?r[t]:r.readUInt16BE(t*a)}if(i){var f=-1;for(o=e;ou&&(e=u-s),o=e;o>=0;o--){for(var l=!0,m=0;mi&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a>8,i=e%256,o.push(i),o.push(n);return o}(t,r.length-e),r,e,n)}function N(r,t,e){return 0===t&&e===r.length?i.fromByteArray(r):i.fromByteArray(r.slice(t,e))}function _(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+l<=e)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=r[i+1]))&&(s=(31&c)<<6|63&o)>127&&(f=s);break;case 3:o=r[i+1],a=r[i+2],128==(192&o)&&128==(192&a)&&(s=(15&c)<<12|(63&o)<<6|63&a)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:o=r[i+1],a=r[i+2],u=r[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(s=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(r){var t=r.length;if(t<=E)return String.fromCharCode.apply(String,r);var e="",n=0;for(;nthis.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(t>>>=0))return"";for(r||(r="utf8");;)switch(r){case"hex":return B(this,t,e);case"utf8":case"utf-8":return _(this,t,e);case"ascii":return S(this,t,e);case"latin1":case"binary":return j(this,t,e);case"base64":return N(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(r){if(!t.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r||0===t.compare(this,r)},t.prototype.inspect=function(){var r="",t=e.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),""},a&&(t.prototype[a]=t.prototype.inspect),t.prototype.compare=function(r,e,i,o,a){if(D(r,Uint8Array)&&(r=t.from(r,r.offset,r.byteLength)),!t.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+n(r));if(void 0===e&&(e=0),void 0===i&&(i=r?r.length:0),void 0===o&&(o=0),void 0===a&&(a=this.length),e<0||i>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=i)return 0;if(o>=a)return-1;if(e>=i)return 1;if(this===r)return 0;for(var u=(a>>>=0)-(o>>>=0),s=(i>>>=0)-(e>>>=0),c=Math.min(u,s),f=this.slice(o,a),l=r.slice(e,i),m=0;m>>=0,isFinite(e)?(e>>>=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-t;if((void 0===e||e>i)&&(e=i),r.length>0&&(e<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,r,t,e);case"utf8":case"utf-8":return x(this,r,t,e);case"ascii":return b(this,r,t,e);case"latin1":case"binary":return w(this,r,t,e);case"base64":return M(this,r,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,r,t,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function S(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;in)&&(e=n);for(var i="",o=t;oe)throw new RangeError("Trying to access beyond buffer length")}function C(r,e,n,i,o,a){if(!t.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||er.length)throw new RangeError("Index out of range")}function O(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function k(r,t,e,n,i){return t=+t,e>>>=0,i||O(r,0,e,4),o.write(r,t,e,n,23,4),e+4}function I(r,t,e,n,i){return t=+t,e>>>=0,i||O(r,0,e,8),o.write(r,t,e,n,52,8),e+8}t.prototype.slice=function(r,e){var n=this.length;(r=~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,t>>>=0,e||z(r,t,this.length);for(var n=this[r],i=1,o=0;++o>>=0,t>>>=0,e||z(r,t,this.length);for(var n=this[r+--t],i=1;t>0&&(i*=256);)n+=this[r+--t]*i;return n},t.prototype.readUInt8=function(r,t){return r>>>=0,t||z(r,1,this.length),this[r]},t.prototype.readUInt16LE=function(r,t){return r>>>=0,t||z(r,2,this.length),this[r]|this[r+1]<<8},t.prototype.readUInt16BE=function(r,t){return r>>>=0,t||z(r,2,this.length),this[r]<<8|this[r+1]},t.prototype.readUInt32LE=function(r,t){return r>>>=0,t||z(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},t.prototype.readUInt32BE=function(r,t){return r>>>=0,t||z(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},t.prototype.readIntLE=function(r,t,e){r>>>=0,t>>>=0,e||z(r,t,this.length);for(var n=this[r],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},t.prototype.readIntBE=function(r,t,e){r>>>=0,t>>>=0,e||z(r,t,this.length);for(var n=t,i=1,o=this[r+--n];n>0&&(i*=256);)o+=this[r+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},t.prototype.readInt8=function(r,t){return r>>>=0,t||z(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},t.prototype.readInt16LE=function(r,t){r>>>=0,t||z(r,2,this.length);var e=this[r]|this[r+1]<<8;return 32768&e?4294901760|e:e},t.prototype.readInt16BE=function(r,t){r>>>=0,t||z(r,2,this.length);var e=this[r+1]|this[r]<<8;return 32768&e?4294901760|e:e},t.prototype.readInt32LE=function(r,t){return r>>>=0,t||z(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},t.prototype.readInt32BE=function(r,t){return r>>>=0,t||z(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},t.prototype.readFloatLE=function(r,t){return r>>>=0,t||z(r,4,this.length),o.read(this,r,!0,23,4)},t.prototype.readFloatBE=function(r,t){return r>>>=0,t||z(r,4,this.length),o.read(this,r,!1,23,4)},t.prototype.readDoubleLE=function(r,t){return r>>>=0,t||z(r,8,this.length),o.read(this,r,!0,52,8)},t.prototype.readDoubleBE=function(r,t){return r>>>=0,t||z(r,8,this.length),o.read(this,r,!1,52,8)},t.prototype.writeUIntLE=function(r,t,e,n){(r=+r,t>>>=0,e>>>=0,n)||C(this,r,t,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[t]=255&r;++o>>=0,e>>>=0,n)||C(this,r,t,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[t+i]=255&r;--i>=0&&(o*=256);)this[t+i]=r/o&255;return t+e},t.prototype.writeUInt8=function(r,t,e){return r=+r,t>>>=0,e||C(this,r,t,1,255,0),this[t]=255&r,t+1},t.prototype.writeUInt16LE=function(r,t,e){return r=+r,t>>>=0,e||C(this,r,t,2,65535,0),this[t]=255&r,this[t+1]=r>>>8,t+2},t.prototype.writeUInt16BE=function(r,t,e){return r=+r,t>>>=0,e||C(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=255&r,t+2},t.prototype.writeUInt32LE=function(r,t,e){return r=+r,t>>>=0,e||C(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=255&r,t+4},t.prototype.writeUInt32BE=function(r,t,e){return r=+r,t>>>=0,e||C(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=255&r,t+4},t.prototype.writeIntLE=function(r,t,e,n){if(r=+r,t>>>=0,!n){var i=Math.pow(2,8*e-1);C(this,r,t,e,i-1,-i)}var o=0,a=1,u=0;for(this[t]=255&r;++o>0)-u&255;return t+e},t.prototype.writeIntBE=function(r,t,e,n){if(r=+r,t>>>=0,!n){var i=Math.pow(2,8*e-1);C(this,r,t,e,i-1,-i)}var o=e-1,a=1,u=0;for(this[t+o]=255&r;--o>=0&&(a*=256);)r<0&&0===u&&0!==this[t+o+1]&&(u=1),this[t+o]=(r/a>>0)-u&255;return t+e},t.prototype.writeInt8=function(r,t,e){return r=+r,t>>>=0,e||C(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=255&r,t+1},t.prototype.writeInt16LE=function(r,t,e){return r=+r,t>>>=0,e||C(this,r,t,2,32767,-32768),this[t]=255&r,this[t+1]=r>>>8,t+2},t.prototype.writeInt16BE=function(r,t,e){return r=+r,t>>>=0,e||C(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=255&r,t+2},t.prototype.writeInt32LE=function(r,t,e){return r=+r,t>>>=0,e||C(this,r,t,4,2147483647,-2147483648),this[t]=255&r,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4},t.prototype.writeInt32BE=function(r,t,e){return r=+r,t>>>=0,e||C(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=255&r,t+4},t.prototype.writeFloatLE=function(r,t,e){return k(this,r,t,!0,e)},t.prototype.writeFloatBE=function(r,t,e){return k(this,r,t,!1,e)},t.prototype.writeDoubleLE=function(r,t,e){return I(this,r,t,!0,e)},t.prototype.writeDoubleBE=function(r,t,e){return I(this,r,t,!1,e)},t.prototype.copy=function(r,e,n,i){if(!t.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e=0;--a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,i),e);return o},t.prototype.fill=function(r,e,n,i){if("string"==typeof r){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===r.length){var o=r.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(r=o)}}else"number"==typeof r?r&=255:"boolean"==typeof r&&(r=Number(r));if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,r||(r=0),"number"==typeof r)for(a=e;a55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function q(r){return i.toByteArray(function(r){if((r=(r=r.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;r.length%4!=0;)r+="=";return r}(r))}function U(r,t,e,n){for(var i=0;i=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function D(r,t){return r instanceof t||null!=r&&null!=r.constructor&&null!=r.constructor.name&&r.constructor.name===t.name}function R(r){return r!=r}var L=function(){for(var r=new Array(256),t=0;t<16;++t)for(var e=16*t,n=0;n<16;++n)r[e+n]="0123456789abcdef"[t]+"0123456789abcdef"[n];return r}()}).call(this,r("buffer").Buffer)},{"base64-js":36,buffer:37,ieee754:45}],38:[function(r,t,e){(function(r){"use strict";function e(r){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var n=function(){function t(n,o,a,u){"object"===e(o)&&(a=o.depth,u=o.prototype,o.filter,o=o.circular);var s=[],c=[],f=void 0!==r;return void 0===o&&(o=!0),void 0===a&&(a=1/0),function n(a,l){if(null===a)return null;if(0==l)return a;var m,h;if("object"!=e(a))return a;if(t.__isArray(a))m=[];else if(t.__isRegExp(a))m=new RegExp(a.source,i(a)),a.lastIndex&&(m.lastIndex=a.lastIndex);else if(t.__isDate(a))m=new Date(a.getTime());else{if(f&&r.isBuffer(a))return m=r.allocUnsafe?r.allocUnsafe(a.length):new r(a.length),a.copy(m),m;void 0===u?(h=Object.getPrototypeOf(a),m=Object.create(h)):(m=Object.create(u),h=u)}if(o){var p=s.indexOf(a);if(-1!=p)return c[p];s.push(a),c.push(m)}for(var g in a){var y;h&&(y=Object.getOwnPropertyDescriptor(h,g)),y&&null==y.set||(m[g]=n(a[g],l-1))}return m}(n,a)}function n(r){return Object.prototype.toString.call(r)}function i(r){var t="";return r.global&&(t+="g"),r.ignoreCase&&(t+="i"),r.multiline&&(t+="m"),t}return t.clonePrototype=function(r){if(null===r)return null;var t=function(){};return t.prototype=r,new t},t.__objToStr=n,t.__isDate=function(r){return"object"===e(r)&&"[object Date]"===n(r)},t.__isArray=function(r){return"object"===e(r)&&"[object Array]"===n(r)},t.__isRegExp=function(r){return"object"===e(r)&&"[object RegExp]"===n(r)},t.__getRegExpFlags=i,t}();"object"===(void 0===t?"undefined":e(t))&&t.exports&&(t.exports=n)}).call(this,r("buffer").Buffer)},{buffer:37}],39:[function(r,t,e){"use strict";function n(r){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}!function(r){var i={re:0,im:0},o=function(r){return.5*(Math.exp(r)+Math.exp(-r))},a=function(r){return.5*(Math.exp(r)-Math.exp(-r))},u=function(){throw SyntaxError("Invalid Param")};function s(r,t){var e=Math.abs(r),n=Math.abs(t);return 0===r?Math.log(n):0===t?Math.log(e):e<3e3&&n<3e3?.5*Math.log(r*r+t*t):Math.log(r/Math.cos(Math.atan2(t,r)))}var c=function(r,t){if(null==r)i.re=i.im=0;else if(void 0!==t)i.re=r,i.im=t;else switch(n(r)){case"object":"im"in r&&"re"in r?(i.re=r.re,i.im=r.im):"abs"in r&&"arg"in r?(i.re=r.abs*Math.cos(r.arg),i.im=r.abs*Math.sin(r.arg)):"r"in r&&"phi"in r?(i.re=r.r*Math.cos(r.phi),i.im=r.r*Math.sin(r.phi)):2===r.length?(i.re=r[0],i.im=r[1]):u();break;case"string":i.im=i.re=0;var e=r.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),o=1,a=0;null===e&&u();for(var s=0;s0&&u();break;case"number":i.im=0,i.re=r;break;default:u()}isNaN(i.re)||isNaN(i.im)};function f(r,t){if(!(this instanceof f))return new f(r,t);c(r,t),this.re=i.re,this.im=i.im}f.prototype={re:0,im:0,sign:function(){var r=this.abs();return new f(this.re/r,this.im/r)},add:function(r,t){return c(r,t),new f(this.re+i.re,this.im+i.im)},sub:function(r,t){return c(r,t),new f(this.re-i.re,this.im-i.im)},mul:function(r,t){return c(r,t),0===i.im&&0===this.im?new f(this.re*i.re,0):new f(this.re*i.re-this.im*i.im,this.re*i.im+this.im*i.re)},div:function(r,t){c(r,t),r=this.re,t=this.im;var e,n,o=i.re,a=i.im;return 0===a?0===o?new f(0!==r?r/0:0,0!==t?t/0:0):new f(r/o,t/o):Math.abs(o)=0)return new f(Math.pow(r,i.re),0);if(0===r)switch((i.re%4+4)%4){case 0:return new f(Math.pow(t,i.re),0);case 1:return new f(0,Math.pow(t,i.re));case 2:return new f(-Math.pow(t,i.re),0);case 3:return new f(0,-Math.pow(t,i.re))}}var e=Math.atan2(t,r),n=s(r,t);return r=Math.exp(i.re*n-i.im*e),t=i.im*n+i.re*e,new f(r*Math.cos(t),r*Math.sin(t))},sqrt:function(){var r,t,e=this.re,n=this.im,i=this.abs();if(e>=0){if(0===n)return new f(Math.sqrt(e),0);r=.5*Math.sqrt(2*(i+e))}else r=Math.abs(n)/Math.sqrt(2*(i-e));return t=e<=0?.5*Math.sqrt(2*(i-e)):Math.abs(n)/Math.sqrt(2*(i+e)),new f(r,n<0?-t:t)},exp:function(){var r=Math.exp(this.re);return this.im,new f(r*Math.cos(this.im),r*Math.sin(this.im))},log:function(){var r=this.re,t=this.im;return new f(s(r,t),Math.atan2(t,r))},abs:function(){return r=this.re,t=this.im,e=Math.abs(r),n=Math.abs(t),e<3e3&&n<3e3?Math.sqrt(e*e+n*n):(e1&&0===t,n=1-r,i=1+r,o=n*n+t*t,a=0!==o?new f((i*n-t*t)/o,(t*n+i*t)/o):new f(-1!==r?r/0:0,0!==t?t/0:0),u=a.re;return a.re=s(a.re,a.im)/2,a.im=Math.atan2(a.im,u)/2,e&&(a.im=-a.im),a},acoth:function(){var r=this.re,t=this.im;if(0===r&&0===t)return new f(0,Math.PI/2);var e=r*r+t*t;return 0!==e?new f(r/e,-t/e).atanh():new f(0!==r?r/0:0,0!==t?-t/0:0).atanh()},acsch:function(){var r=this.re,t=this.im;if(0===t)return new f(0!==r?Math.log(r+Math.sqrt(r*r+1)):1/0,0);var e=r*r+t*t;return 0!==e?new f(r/e,-t/e).asinh():new f(0!==r?r/0:0,0!==t?-t/0:0).asinh()},asech:function(){var r=this.re,t=this.im;if(0===r&&0===t)return new f(1/0,0);var e=r*r+t*t;return 0!==e?new f(r/e,-t/e).acosh():new f(0!==r?r/0:0,0!==t?-t/0:0).acosh()},inverse:function(){var r=this.re,t=this.im,e=r*r+t*t;return new f(0!==r?r/e:0,0!==t?-t/e:0)},conjugate:function(){return new f(this.re,-this.im)},neg:function(){return new f(-this.re,-this.im)},ceil:function(r){return r=Math.pow(10,r||0),new f(Math.ceil(this.re*r)/r,Math.ceil(this.im*r)/r)},floor:function(r){return r=Math.pow(10,r||0),new f(Math.floor(this.re*r)/r,Math.floor(this.im*r)/r)},round:function(r){return r=Math.pow(10,r||0),new f(Math.round(this.re*r)/r,Math.round(this.im*r)/r)},equals:function(r,t){return c(r,t),Math.abs(i.re-this.re)<=f.EPSILON&&Math.abs(i.im-this.im)<=f.EPSILON},clone:function(){return new f(this.re,this.im)},toString:function(){var r=this.re,t=this.im,e="";return isNaN(r)||isNaN(t)?"NaN":(0!==r&&(e+=r),0!==t&&(0!==r?e+=t<0?" - ":" + ":t<0&&(e+="-"),1!==(t=Math.abs(t))&&(e+=t),e+="i"),e||"0")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(r){function t(){return r.apply(this,arguments)}return t.toString=function(){return r.toString()},t}(function(){return isNaN(this.re)||isNaN(this.im)}),isFinite:function(r){function t(){return r.apply(this,arguments)}return t.toString=function(){return r.toString()},t}(function(){return isFinite(this.re)&&isFinite(this.im)})},f.ZERO=new f(0,0),f.ONE=new f(1,0),f.I=new f(0,1),f.PI=new f(Math.PI,0),f.E=new f(Math.E,0),f.EPSILON=1e-16,"function"==typeof define&&define.amd?define([],function(){return f}):"object"===(void 0===e?"undefined":n(e))?t.exports=f:(void 0).Complex=f}()},{}],40:[function(r,t,e){"use strict";function n(r){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}!function(r){var e,i,o,a,u=9e15,s=1e9,c="0123456789abcdef",f="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",l="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",m={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-u,maxE:u,crypto:!1},h=!0,p="[DecimalError] ",g=p+"Invalid argument: ",y=p+"Precision limit exceeded",d=p+"crypto unavailable",v=Math.floor,x=Math.pow,b=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,w=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,M=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,A=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,N=1e7,_=7,E=f.length-1,S=l.length-1,j={name:"[object Decimal]"};function B(r){var t,e,n,i=r.length-1,o="",a=r[0];if(i>0){for(o+=a,t=1;te)throw Error(g+r)}function z(r,t,e,n){var i,o,a,u;for(o=r[0];o>=10;o/=10)--t;return--t<0?(t+=_,i=0):(i=Math.ceil((t+1)/_),t%=_),o=x(10,_-t),u=r[i]%o|0,null==n?t<3?(0==t?u=u/100|0:1==t&&(u=u/10|0),a=e<4&&99999==u||e>3&&49999==u||5e4==u||0==u):a=(e<4&&u+1==o||e>3&&u+1==o/2)&&(r[i+1]/o/100|0)==x(10,t-2)-1||(u==o/2||0==u)&&0==(r[i+1]/o/100|0):t<4?(0==t?u=u/1e3|0:1==t?u=u/100|0:2==t&&(u=u/10|0),a=(n||e<4)&&9999==u||!n&&e>3&&4999==u):a=((n||e<4)&&u+1==o||!n&&e>3&&u+1==o/2)&&(r[i+1]/o/1e3|0)==x(10,t-3)-1,a}function C(r,t,e){for(var n,i,o=[0],a=0,u=r.length;ae-1&&(void 0===o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/e|0,o[n]%=e)}return o.reverse()}j.absoluteValue=j.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),k(r)},j.ceil=function(){return k(new this.constructor(this),this.e+1,2)},j.comparedTo=j.cmp=function(r){var t,e,n,i,o=this,a=o.d,u=(r=new o.constructor(r)).d,s=o.s,c=r.s;if(!a||!u)return s&&c?s!==c?s:a===u?0:!a^s<0?1:-1:NaN;if(!a[0]||!u[0])return a[0]?s:u[0]?-c:0;if(s!==c)return s;if(o.e!==r.e)return o.e>r.e^s<0?1:-1;for(t=0,e=(n=a.length)<(i=u.length)?n:i;tu[t]^s<0?1:-1;return n===i?0:n>i^s<0?1:-1},j.cosine=j.cos=function(){var r,t,e=this,n=e.constructor;return e.d?e.d[0]?(r=n.precision,t=n.rounding,n.precision=r+Math.max(e.e,e.sd())+_,n.rounding=1,e=function(r,t){var e,n,i=t.d.length;i<32?(e=Math.ceil(i/3),n=Math.pow(4,-e).toString()):(e=16,n="2.3283064365386962890625e-10");r.precision+=e,t=J(r,1,t.times(n),new r(1));for(var o=e;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return r.precision-=e,t}(n,G(n,e)),n.precision=r,n.rounding=t,k(2==a||3==a?e.neg():e,r,t,!0)):new n(1):new n(NaN)},j.cubeRoot=j.cbrt=function(){var r,t,e,n,i,o,a,u,s,c,f=this,l=f.constructor;if(!f.isFinite()||f.isZero())return new l(f);for(h=!1,(o=f.s*Math.pow(f.s*f,1/3))&&Math.abs(o)!=1/0?n=new l(o.toString()):(e=B(f.d),(o=((r=f.e)-e.length+1)%3)&&(e+=1==o||-2==o?"0":"00"),o=Math.pow(e,1/3),r=v((r+1)/3)-(r%3==(r<0?-1:2)),(n=new l(e=o==1/0?"5e"+r:(e=o.toExponential()).slice(0,e.indexOf("e")+1)+r)).s=f.s),a=(r=l.precision)+3;;)if(c=(s=(u=n).times(u).times(u)).plus(f),n=O(c.plus(f).times(u),c.plus(s),a+2,1),B(u.d).slice(0,a)===(e=B(n.d)).slice(0,a)){if("9999"!=(e=e.slice(a-3,a+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(k(n,r+1,1),t=!n.times(n).times(n).eq(f));break}if(!i&&(k(u,r+1,0),u.times(u).times(u).eq(f))){n=u;break}a+=4,i=1}return h=!0,k(n,r,l.rounding,t)},j.decimalPlaces=j.dp=function(){var r,t=this.d,e=NaN;if(t){if(e=((r=t.length-1)-v(this.e/_))*_,r=t[r])for(;r%10==0;r/=10)e--;e<0&&(e=0)}return e},j.dividedBy=j.div=function(r){return O(this,new this.constructor(r))},j.dividedToIntegerBy=j.divToInt=function(r){var t=this.constructor;return k(O(this,new t(r),0,1,1),t.precision,t.rounding)},j.equals=j.eq=function(r){return 0===this.cmp(r)},j.floor=function(){return k(new this.constructor(this),this.e+1,3)},j.greaterThan=j.gt=function(r){return this.cmp(r)>0},j.greaterThanOrEqualTo=j.gte=function(r){var t=this.cmp(r);return 1==t||0===t},j.hyperbolicCosine=j.cosh=function(){var r,t,e,n,i,o=this,a=o.constructor,u=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return u;e=a.precision,n=a.rounding,a.precision=e+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?(r=Math.ceil(i/3),t=Math.pow(4,-r).toString()):(r=16,t="2.3283064365386962890625e-10"),o=J(a,1,o.times(t),new a(1),!0);for(var s,c=r,f=new a(8);c--;)s=o.times(o),o=u.minus(s.times(f.minus(s.times(f))));return k(o,a.precision=e,a.rounding=n,!0)},j.hyperbolicSine=j.sinh=function(){var r,t,e,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,e=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=J(o,2,i,i,!0);else{r=(r=1.4*Math.sqrt(n))>16?16:0|r,i=J(o,2,i=i.times(Math.pow(5,-r)),i,!0);for(var a,u=new o(5),s=new o(16),c=new o(20);r--;)a=i.times(i),i=i.times(u.plus(a.times(s.times(a).plus(c))))}return o.precision=t,o.rounding=e,k(i,t,e,!0)},j.hyperbolicTangent=j.tanh=function(){var r,t,e=this,n=e.constructor;return e.isFinite()?e.isZero()?new n(e):(r=n.precision,t=n.rounding,n.precision=r+7,n.rounding=1,O(e.sinh(),e.cosh(),n.precision=r,n.rounding=t)):new n(e.s)},j.inverseCosine=j.acos=function(){var r,t=this,e=t.constructor,n=t.abs().cmp(1),i=e.precision,o=e.rounding;return-1!==n?0===n?t.isNeg()?q(e,i,o):new e(0):new e(NaN):t.isZero()?q(e,i+4,o).times(.5):(e.precision=i+6,e.rounding=1,t=t.asin(),r=q(e,i+4,o).times(.5),e.precision=i,e.rounding=o,r.minus(t))},j.inverseHyperbolicCosine=j.acosh=function(){var r,t,e=this,n=e.constructor;return e.lte(1)?new n(e.eq(1)?0:NaN):e.isFinite()?(r=n.precision,t=n.rounding,n.precision=r+Math.max(Math.abs(e.e),e.sd())+4,n.rounding=1,h=!1,e=e.times(e).minus(1).sqrt().plus(e),h=!0,n.precision=r,n.rounding=t,e.ln()):new n(e)},j.inverseHyperbolicSine=j.asinh=function(){var r,t,e=this,n=e.constructor;return!e.isFinite()||e.isZero()?new n(e):(r=n.precision,t=n.rounding,n.precision=r+2*Math.max(Math.abs(e.e),e.sd())+6,n.rounding=1,h=!1,e=e.times(e).plus(1).sqrt().plus(e),h=!0,n.precision=r,n.rounding=t,e.ln())},j.inverseHyperbolicTangent=j.atanh=function(){var r,t,e,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(r=o.precision,t=o.rounding,n=i.sd(),Math.max(n,r)<2*-i.e-1?k(new o(i),r,t,!0):(o.precision=e=n-i.e,i=O(i.plus(1),new o(1).minus(i),e+r,1),o.precision=r+4,o.rounding=1,i=i.ln(),o.precision=r,o.rounding=t,i.times(.5))):new o(NaN)},j.inverseSine=j.asin=function(){var r,t,e,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),e=o.precision,n=o.rounding,-1!==t?0===t?((r=q(o,e+4,n).times(.5)).s=i.s,r):new o(NaN):(o.precision=e+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=e,o.rounding=n,i.times(2)))},j.inverseTangent=j.atan=function(){var r,t,e,n,i,o,a,u,s,c=this,f=c.constructor,l=f.precision,m=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&l+4<=S)return(a=q(f,l+4,m).times(.25)).s=c.s,a}else{if(!c.s)return new f(NaN);if(l+4<=S)return(a=q(f,l+4,m).times(.5)).s=c.s,a}for(f.precision=u=l+10,f.rounding=1,r=e=Math.min(28,u/_+2|0);r;--r)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(h=!1,t=Math.ceil(u/_),n=1,s=c.times(c),a=new f(c),i=c;-1!==r;)if(i=i.times(s),o=a.minus(i.div(n+=2)),i=i.times(s),void 0!==(a=o.plus(i.div(n+=2))).d[t])for(r=t;a.d[r]===o.d[r]&&r--;);return e&&(a=a.times(2<this.d.length-2},j.isNaN=function(){return!this.s},j.isNegative=j.isNeg=function(){return this.s<0},j.isPositive=j.isPos=function(){return this.s>0},j.isZero=function(){return!!this.d&&0===this.d[0]},j.lessThan=j.lt=function(r){return this.cmp(r)<0},j.lessThanOrEqualTo=j.lte=function(r){return this.cmp(r)<1},j.logarithm=j.log=function(r){var t,e,n,i,o,a,u,s,c=this.constructor,f=c.precision,l=c.rounding;if(null==r)r=new c(10),t=!0;else{if(e=(r=new c(r)).d,r.s<0||!e||!e[0]||r.eq(1))return new c(NaN);t=r.eq(10)}if(e=this.d,this.s<0||!e||!e[0]||this.eq(1))return new c(e&&!e[0]?-1/0:1!=this.s?NaN:e?0:1/0);if(t)if(e.length>1)o=!0;else{for(i=e[0];i%10==0;)i/=10;o=1!==i}if(h=!1,a=Z(this,u=f+5),n=t?F(c,u+10):Z(r,u),z((s=O(a,n,u,1)).d,i=f,l))do{if(a=Z(this,u+=10),n=t?F(c,u+10):Z(r,u),s=O(a,n,u,1),!o){+B(s.d).slice(i+1,i+15)+1==1e14&&(s=k(s,f+1,0));break}}while(z(s.d,i+=10,l));return h=!0,k(s,f,l)},j.minus=j.sub=function(r){var t,e,n,i,o,a,u,s,c,f,l,m,p=this,g=p.constructor;if(r=new g(r),!p.d||!r.d)return p.s&&r.s?p.d?r.s=-r.s:r=new g(r.d||p.s!==r.s?p:NaN):r=new g(NaN),r;if(p.s!=r.s)return r.s=-r.s,p.plus(r);if(c=p.d,m=r.d,u=g.precision,s=g.rounding,!c[0]||!m[0]){if(m[0])r.s=-r.s;else{if(!c[0])return new g(3===s?-0:0);r=new g(p)}return h?k(r,u,s):r}if(e=v(r.e/_),f=v(p.e/_),c=c.slice(),o=f-e){for((l=o<0)?(t=c,o=-o,a=m.length):(t=m,e=f,a=c.length),o>(n=Math.max(Math.ceil(u/_),a)+2)&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for((l=(n=c.length)<(a=m.length))&&(a=n),n=0;n0;--n)c[a++]=0;for(n=m.length;n>o;){if(c[--n](a=(o=Math.ceil(u/_))>a?o+1:a+1)&&(i=a,e.length=1),e.reverse();i--;)e.push(0);e.reverse()}for((a=c.length)-(i=f.length)<0&&(i=a,e=f,f=c,c=e),t=0;i;)t=(c[--i]=c[i]+f[i]+t)/N|0,c[i]%=N;for(t&&(c.unshift(t),++n),a=c.length;0==c[--a];)c.pop();return r.d=c,r.e=P(c,n),h?k(r,u,s):r},j.precision=j.sd=function(r){var t,e=this;if(void 0!==r&&r!==!!r&&1!==r&&0!==r)throw Error(g+r);return e.d?(t=U(e.d),r&&e.e+1>t&&(t=e.e+1)):t=NaN,t},j.round=function(){var r=this,t=r.constructor;return k(new t(r),r.e+1,t.rounding)},j.sine=j.sin=function(){var r,t,e=this,n=e.constructor;return e.isFinite()?e.isZero()?new n(e):(r=n.precision,t=n.rounding,n.precision=r+Math.max(e.e,e.sd())+_,n.rounding=1,e=function(r,t){var e,n=t.d.length;if(n<3)return J(r,2,t,t);e=(e=1.4*Math.sqrt(n))>16?16:0|e,t=t.times(Math.pow(5,-e)),t=J(r,2,t,t);for(var i,o=new r(5),a=new r(16),u=new r(20);e--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(u))));return t}(n,G(n,e)),n.precision=r,n.rounding=t,k(a>2?e.neg():e,r,t,!0)):new n(NaN)},j.squareRoot=j.sqrt=function(){var r,t,e,n,i,o,a=this,u=a.d,s=a.e,c=a.s,f=a.constructor;if(1!==c||!u||!u[0])return new f(!c||c<0&&(!u||u[0])?NaN:u?a:1/0);for(h=!1,0==(c=Math.sqrt(+a))||c==1/0?(((t=B(u)).length+s)%2==0&&(t+="0"),c=Math.sqrt(t),s=v((s+1)/2)-(s<0||s%2),n=new f(t=c==1/0?"1e"+s:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new f(c.toString()),e=(s=f.precision)+3;;)if(n=(o=n).plus(O(a,o,e+2,1)).times(.5),B(o.d).slice(0,e)===(t=B(n.d)).slice(0,e)){if("9999"!=(t=t.slice(e-3,e+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(k(n,s+1,1),r=!n.times(n).eq(a));break}if(!i&&(k(o,s+1,0),o.times(o).eq(a))){n=o;break}e+=4,i=1}return h=!0,k(n,s,f.rounding,r)},j.tangent=j.tan=function(){var r,t,e=this,n=e.constructor;return e.isFinite()?e.isZero()?new n(e):(r=n.precision,t=n.rounding,n.precision=r+10,n.rounding=1,(e=e.sin()).s=1,e=O(e,new n(1).minus(e.times(e)).sqrt(),r+10,0),n.precision=r,n.rounding=t,k(2==a||4==a?e.neg():e,r,t,!0)):new n(NaN)},j.times=j.mul=function(r){var t,e,n,i,o,a,u,s,c,f=this,l=f.constructor,m=f.d,p=(r=new l(r)).d;if(r.s*=f.s,!(m&&m[0]&&p&&p[0]))return new l(!r.s||m&&!m[0]&&!p||p&&!p[0]&&!m?NaN:m&&p?0*r.s:r.s/0);for(e=v(f.e/_)+v(r.e/_),(s=m.length)<(c=p.length)&&(o=m,m=p,p=o,a=s,s=c,c=a),o=[],n=a=s+c;n--;)o.push(0);for(n=c;--n>=0;){for(t=0,i=s+n;i>n;)u=o[i]+p[n]*m[i-n-1]+t,o[i--]=u%N|0,t=u/N|0;o[i]=(o[i]+t)%N|0}for(;!o[--a];)o.pop();return t?++e:o.shift(),r.d=o,r.e=P(o,e),h?k(r,l.precision,l.rounding):r},j.toBinary=function(r,t){return W(this,2,r,t)},j.toDecimalPlaces=j.toDP=function(r,t){var e=this,n=e.constructor;return e=new n(e),void 0===r?e:(T(r,0,s),void 0===t?t=n.rounding:T(t,0,8),k(e,r+e.e+1,t))},j.toExponential=function(r,t){var e,n=this,i=n.constructor;return void 0===r?e=I(n,!0):(T(r,0,s),void 0===t?t=i.rounding:T(t,0,8),e=I(n=k(new i(n),r+1,t),!0,r+1)),n.isNeg()&&!n.isZero()?"-"+e:e},j.toFixed=function(r,t){var e,n,i=this,o=i.constructor;return void 0===r?e=I(i):(T(r,0,s),void 0===t?t=o.rounding:T(t,0,8),e=I(n=k(new o(i),r+i.e+1,t),!1,r+n.e+1)),i.isNeg()&&!i.isZero()?"-"+e:e},j.toFraction=function(r){var t,e,n,i,o,a,u,s,c,f,l,m,p=this,y=p.d,d=p.constructor;if(!y)return new d(p);if(c=e=new d(1),n=s=new d(0),a=(o=(t=new d(n)).e=U(y)-p.e-1)%_,t.d[0]=x(10,a<0?_+a:a),null==r)r=o>0?t:c;else{if(!(u=new d(r)).isInt()||u.lt(c))throw Error(g+u);r=u.gt(t)?o>0?t:c:u}for(h=!1,u=new d(B(y)),f=d.precision,d.precision=o=y.length*_*2;l=O(u,t,0,1,1),1!=(i=e.plus(l.times(n))).cmp(r);)e=n,n=i,i=c,c=s.plus(l.times(i)),s=i,i=t,t=u.minus(l.times(i)),u=i;return i=O(r.minus(e),n,0,1,1),s=s.plus(i.times(c)),e=e.plus(i.times(n)),s.s=c.s=p.s,m=O(c,n,o,1).minus(p).abs().cmp(O(s,e,o,1).minus(p).abs())<1?[c,n]:[s,e],d.precision=f,h=!0,m},j.toHexadecimal=j.toHex=function(r,t){return W(this,16,r,t)},j.toNearest=function(r,t){var e=this,n=e.constructor;if(e=new n(e),null==r){if(!e.d)return e;r=new n(1),t=n.rounding}else{if(r=new n(r),void 0!==t&&T(t,0,8),!e.d)return r.s?e:r;if(!r.d)return r.s&&(r.s=e.s),r}return r.d[0]?(h=!1,t<4&&(t=[4,5,7,8][t]),e=O(e,r,0,t,1).times(r),h=!0,k(e)):(r.s=e.s,e=r),e},j.toNumber=function(){return+this},j.toOctal=function(r,t){return W(this,8,r,t)},j.toPower=j.pow=function(r){var t,e,n,i,o,a,u=this,s=u.constructor,c=+(r=new s(r));if(!(u.d&&r.d&&u.d[0]&&r.d[0]))return new s(x(+u,c));if((u=new s(u)).eq(1))return u;if(n=s.precision,o=s.rounding,r.eq(1))return k(u,n,o);if((t=v(r.e/_))>=r.d.length-1&&(e=c<0?-c:c)<=9007199254740991)return i=R(s,u,e,n),r.s<0?new s(1).div(i):k(i,n,o);if((a=u.s)<0){if(ts.maxE+1||t0?a/0:0):(h=!1,s.rounding=u.s=1,e=Math.min(12,(t+"").length),(i=V(r.times(Z(u,n+e)),n)).d&&z((i=k(i,n+5,1)).d,n,o)&&(t=n+10,+B((i=k(V(r.times(Z(u,t+e)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=k(i,n+1,0))),i.s=a,h=!0,s.rounding=o,k(i,n,o))},j.toPrecision=function(r,t){var e,n=this,i=n.constructor;return void 0===r?e=I(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(T(r,1,s),void 0===t?t=i.rounding:T(t,0,8),e=I(n=k(new i(n),r,t),r<=n.e||n.e<=i.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+e:e},j.toSignificantDigits=j.toSD=function(r,t){var e=this.constructor;return void 0===r?(r=e.precision,t=e.rounding):(T(r,1,s),void 0===t?t=e.rounding:T(t,0,8)),k(new e(this),r,t)},j.toString=function(){var r=this,t=r.constructor,e=I(r,r.e<=t.toExpNeg||r.e>=t.toExpPos);return r.isNeg()&&!r.isZero()?"-"+e:e},j.truncated=j.trunc=function(){return k(new this.constructor(this),this.e+1,1)},j.valueOf=j.toJSON=function(){var r=this,t=r.constructor,e=I(r,r.e<=t.toExpNeg||r.e>=t.toExpPos);return r.isNeg()?"-"+e:e};var O=function(){function r(r,t,e){var n,i=0,o=r.length;for(r=r.slice();o--;)n=r[o]*t+i,r[o]=n%e|0,i=n/e|0;return i&&r.unshift(i),r}function t(r,t,e,n){var i,o;if(e!=n)o=e>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function e(r,t,e,n){for(var i=0;e--;)r[e]-=i,i=r[e]1;)r.shift()}return function(n,o,a,u,s,c){var f,l,m,h,p,g,y,d,x,b,w,M,A,E,S,j,B,T,z,C,O=n.constructor,I=n.s==o.s?1:-1,P=n.d,F=o.d;if(!(P&&P[0]&&F&&F[0]))return new O(n.s&&o.s&&(P?!F||P[0]!=F[0]:F)?P&&0==P[0]||!F?0*I:I/0:NaN);for(c?(p=1,l=n.e-o.e):(c=N,p=_,l=v(n.e/p)-v(o.e/p)),z=F.length,B=P.length,b=(x=new O(I)).d=[],m=0;F[m]==(P[m]||0);m++);if(F[m]>(P[m]||0)&&l--,null==a?(E=a=O.precision,u=O.rounding):E=s?a+(n.e-o.e)+1:a,E<0)b.push(1),g=!0;else{if(E=E/p+2|0,m=0,1==z){for(h=0,F=F[0],E++;(m1&&(F=r(F,h,c),P=r(P,h,c),z=F.length,B=P.length),j=z,M=(w=P.slice(0,z)).length;M=c/2&&++T;do{h=0,(f=t(F,w,z,M))<0?(A=w[0],z!=M&&(A=A*c+(w[1]||0)),(h=A/T|0)>1?(h>=c&&(h=c-1),1==(f=t(y=r(F,h,c),w,d=y.length,M=w.length))&&(h--,e(y,z=10;h/=10)m++;x.e=m+l*p-1,k(x,s?a+x.e+1:a,u,g)}return x}}();function k(r,t,e,n){var i,o,a,u,s,c,f,l,m,p=r.constructor;r:if(null!=t){if(!(l=r.d))return r;for(i=1,u=l[0];u>=10;u/=10)i++;if((o=t-i)<0)o+=_,a=t,s=(f=l[m=0])/x(10,i-a-1)%10|0;else if((m=Math.ceil((o+1)/_))>=(u=l.length)){if(!n)break r;for(;u++<=m;)l.push(0);f=s=0,i=1,a=(o%=_)-_+1}else{for(f=u=l[m],i=1;u>=10;u/=10)i++;s=(a=(o%=_)-_+i)<0?0:f/x(10,i-a-1)%10|0}if(n=n||t<0||void 0!==l[m+1]||(a<0?f:f%x(10,i-a-1)),c=e<4?(s||n)&&(0==e||e==(r.s<0?3:2)):s>5||5==s&&(4==e||n||6==e&&(o>0?a>0?f/x(10,i-a):0:l[m-1])%10&1||e==(r.s<0?8:7)),t<1||!l[0])return l.length=0,c?(t-=r.e+1,l[0]=x(10,(_-t%_)%_),r.e=-t||0):l[0]=r.e=0,r;if(0==o?(l.length=m,u=1,m--):(l.length=m+1,u=x(10,_-o),l[m]=a>0?(f/x(10,i-a)%x(10,a)|0)*u:0),c)for(;;){if(0==m){for(o=1,a=l[0];a>=10;a/=10)o++;for(a=l[0]+=u,u=1;a>=10;a/=10)u++;o!=u&&(r.e++,l[0]==N&&(l[0]=1));break}if(l[m]+=u,l[m]!=N)break;l[m--]=0,u=1}for(o=l.length;0===l[--o];)l.pop()}return h&&(r.e>p.maxE?(r.d=null,r.e=NaN):r.e0?o=o.charAt(0)+"."+o.slice(1)+D(n):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(r.e<0?"e":"e+")+r.e):i<0?(o="0."+D(-i-1)+o,e&&(n=e-a)>0&&(o+=D(n))):i>=a?(o+=D(i+1-a),e&&(n=e-i-1)>0&&(o=o+"."+D(n))):((n=i+1)0&&(i+1===a&&(o+="."),o+=D(n))),o}function P(r,t){var e=r[0];for(t*=_;e>=10;e/=10)t++;return t}function F(r,t,e){if(t>E)throw h=!0,e&&(r.precision=e),Error(y);return k(new r(f),t,1,!0)}function q(r,t,e){if(t>S)throw Error(y);return k(new r(l),t,e,!0)}function U(r){var t=r.length-1,e=t*_+1;if(t=r[t]){for(;t%10==0;t/=10)e--;for(t=r[0];t>=10;t/=10)e++}return e}function D(r){for(var t="";r--;)t+="0";return t}function R(r,t,e,n){var i,o=new r(1),a=Math.ceil(n/_+4);for(h=!1;;){if(e%2&&Q((o=o.times(t)).d,a)&&(i=!0),0===(e=v(e/2))){e=o.d.length-1,i&&0===o.d[e]&&++o.d[e];break}Q((t=t.times(t)).d,a)}return h=!0,o}function L(r){return 1&r.d[r.d.length-1]}function $(r,t,e){for(var n,i=new r(t[0]),o=0;++o17)return new m(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(null==t?(h=!1,s=g):s=t,u=new m(.03125);r.e>-2;)r=r.times(u),l+=5;for(s+=n=Math.log(x(2,l))/Math.LN10*2+5|0,e=o=a=new m(1),m.precision=s;;){if(o=k(o.times(r),s,1),e=e.times(++f),B((u=a.plus(O(o,e,s,1))).d).slice(0,s)===B(a.d).slice(0,s)){for(i=l;i--;)a=k(a.times(a),s,1);if(null!=t)return m.precision=g,a;if(!(c<3&&z(a.d,s-n,p,c)))return k(a,m.precision=g,p,h=!0);m.precision=s+=10,e=o=u=new m(1),f=0,c++}a=u}}function Z(r,t){var e,n,i,o,a,u,s,c,f,l,m,p=1,g=r,y=g.d,d=g.constructor,v=d.rounding,x=d.precision;if(g.s<0||!y||!y[0]||!g.e&&1==y[0]&&1==y.length)return new d(y&&!y[0]?-1/0:1!=g.s?NaN:y?0:g);if(null==t?(h=!1,f=x):f=t,d.precision=f+=10,n=(e=B(y)).charAt(0),!(Math.abs(o=g.e)<15e14))return c=F(d,f+2,x).times(o+""),g=Z(new d(n+"."+e.slice(1)),f-10).plus(c),d.precision=x,null==t?k(g,x,v,h=!0):g;for(;n<7&&1!=n||1==n&&e.charAt(1)>3;)n=(e=B((g=g.times(r)).d)).charAt(0),p++;for(o=g.e,n>1?(g=new d("0."+e),o++):g=new d(n+"."+e.slice(1)),l=g,s=a=g=O(g.minus(1),g.plus(1),f,1),m=k(g.times(g),f,1),i=3;;){if(a=k(a.times(m),f,1),B((c=s.plus(O(a,new d(i),f,1))).d).slice(0,f)===B(s.d).slice(0,f)){if(s=s.times(2),0!==o&&(s=s.plus(F(d,f+2,x).times(o+""))),s=O(s,new d(p),f,1),null!=t)return d.precision=x,s;if(!z(s.d,f-10,v,u))return k(s,d.precision=x,v,h=!0);d.precision=f+=10,c=a=g=O(l.minus(1),l.plus(1),f,1),m=k(g.times(g),f,1),i=u=1}s=c,i+=2}}function X(r){return String(r.s*r.s/0)}function H(r,t){var e,n,i;for((e=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(e<0&&(e=n),e+=+t.slice(n+1),t=t.substring(0,n)):e<0&&(e=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,r.e=e=e-n-1,r.d=[],n=(e+1)%_,e<0&&(n+=_),nr.constructor.maxE?(r.d=null,r.e=NaN):r.e0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),u=(a=t.indexOf("."))>=0,i=r.constructor,u&&(a=(s=(t=t.replace(".","")).length)-a,o=R(i,new i(n),a,2*a)),a=l=(f=C(t,n,N)).length-1;0===f[a];--a)f.pop();return a<0?new i(0*r.s):(r.e=P(f,l),r.d=f,h=!1,u&&(r=O(r,o,4*s)),c&&(r=r.times(Math.abs(c)<54?Math.pow(2,c):e.pow(2,c))),h=!0,r)}function J(r,t,e,n,i){var o,a,u,s,c=r.precision,f=Math.ceil(c/_);for(h=!1,s=e.times(e),u=new r(n);;){if(a=O(u.times(s),new r(t++*t++),c,1),u=i?n.plus(a):n.minus(a),n=O(a.times(s),new r(t++*t++),c,1),void 0!==(a=u.plus(n)).d[f]){for(o=f;a.d[o]===u.d[o]&&o--;);if(-1==o)break}o=u,u=n,n=a,a=o,0}return h=!0,a.d.length=f+1,a}function G(r,t){var e,n=t.s<0,i=q(r,r.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return a=n?4:1,t;if((e=t.divToInt(i)).isZero())a=n?3:2;else{if((t=t.minus(e.times(i))).lte(o))return a=L(e)?n?2:3:n?4:1,t;a=L(e)?n?1:4:n?3:2}return t.minus(i).abs()}function W(r,t,e,n){var o,a,u,f,l,m,h,p,g,y=r.constructor,d=void 0!==e;if(d?(T(e,1,s),void 0===n?n=y.rounding:T(n,0,8)):(e=y.precision,n=y.rounding),r.isFinite()){for(d?(o=2,16==t?e=4*e-3:8==t&&(e=3*e-2)):o=t,(u=(h=I(r)).indexOf("."))>=0&&(h=h.replace(".",""),(g=new y(1)).e=h.length-u,g.d=C(I(g),10,o),g.e=g.d.length),a=l=(p=C(h,10,o)).length;0==p[--l];)p.pop();if(p[0]){if(u<0?a--:((r=new y(r)).d=p,r.e=a,p=(r=O(r,g,e,n,0,o)).d,a=r.e,m=i),u=p[e],f=o/2,m=m||void 0!==p[e+1],m=n<4?(void 0!==u||m)&&(0===n||n===(r.s<0?3:2)):u>f||u===f&&(4===n||m||6===n&&1&p[e-1]||n===(r.s<0?8:7)),p.length=e,m)for(;++p[--e]>o-1;)p[e]=0,e||(++a,p.unshift(1));for(l=p.length;!p[l-1];--l);for(u=0,h="";u1)if(16==t||8==t){for(u=16==t?4:3,--l;l%u;l++)h+="0";for(l=(p=C(h,o,t)).length;!p[l-1];--l);for(u=1,h="1.";ul)for(a-=l;a--;)h+="0";else at)return r.length=t,!0}function K(r){return new this(r).abs()}function rr(r){return new this(r).acos()}function tr(r){return new this(r).acosh()}function er(r,t){return new this(r).plus(t)}function nr(r){return new this(r).asin()}function ir(r){return new this(r).asinh()}function or(r){return new this(r).atan()}function ar(r){return new this(r).atanh()}function ur(r,t){r=new this(r),t=new this(t);var e,n=this.precision,i=this.rounding,o=n+4;return r.s&&t.s?r.d||t.d?!t.d||r.isZero()?(e=t.s<0?q(this,n,i):new this(0)).s=r.s:!r.d||t.isZero()?(e=q(this,o,1).times(.5)).s=r.s:t.s<0?(this.precision=o,this.rounding=1,e=this.atan(O(r,t,o,1)),t=q(this,o,1),this.precision=n,this.rounding=i,e=r.s<0?e.minus(t):e.plus(t)):e=this.atan(O(r,t,o,1)):(e=q(this,o,1).times(t.s>0?.25:.75)).s=r.s:e=new this(NaN),e}function sr(r){return new this(r).cbrt()}function cr(r){return k(r=new this(r),r.e+1,2)}function fr(r){if(!r||"object"!==n(r))throw Error(p+"Object expected");var t,e,i,o=!0===r.defaults,a=["precision",1,s,"rounding",0,8,"toExpNeg",-u,0,"toExpPos",0,u,"maxE",0,u,"minE",-u,0,"modulo",0,9];for(t=0;t=a[t+1]&&i<=a[t+2]))throw Error(g+e+": "+i);this[e]=i}if(e="crypto",o&&(this[e]=m[e]),void 0!==(i=r[e])){if(!0!==i&&!1!==i&&0!==i&&1!==i)throw Error(g+e+": "+i);if(i){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(d);this[e]=!0}else this[e]=!1}return this}function lr(r){return new this(r).cos()}function mr(r){return new this(r).cosh()}function hr(r,t){return new this(r).div(t)}function pr(r){return new this(r).exp()}function gr(r){return k(r=new this(r),r.e+1,3)}function yr(){var r,t,e=new this(0);for(h=!1,r=0;r=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:u[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(d);for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(u.push(i%1e7),o+=4);o=n/4}else for(;o=10;i/=10)n++;n<_&&(e-=_-n)}return a.e=e,a.d=u,a}function jr(r){return k(r=new this(r),r.e+1,this.rounding)}function Br(r){return(r=new this(r)).d?r.d[0]?r.s:0*r.s:r.s||NaN}function Tr(r){return new this(r).sin()}function zr(r){return new this(r).sinh()}function Cr(r){return new this(r).sqrt()}function Or(r,t){return new this(r).sub(t)}function kr(r){return new this(r).tan()}function Ir(r){return new this(r).tanh()}function Pr(r){return k(r=new this(r),r.e+1,1)}(e=function r(t){var e,i,o;function a(r){var t,e,i,o=this;if(!(o instanceof a))return new a(r);if(o.constructor=a,r instanceof a)return o.s=r.s,o.e=r.e,void(o.d=(r=r.d)?r.slice():r);if("number"===(i=n(r))){if(0===r)return o.s=1/r<0?-1:1,o.e=0,void(o.d=[0]);if(r<0?(r=-r,o.s=-1):o.s=1,r===~~r&&r<1e7){for(t=0,e=r;e>=10;e/=10)t++;return o.e=t,void(o.d=[r])}return 0*r!=0?(r||(o.s=NaN),o.e=NaN,void(o.d=null)):H(o,r.toString())}if("string"!==i)throw Error(g+r);return 45===r.charCodeAt(0)?(r=r.slice(1),o.s=-1):o.s=1,A.test(r)?H(o,r):Y(o,r)}if(a.prototype=j,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.EUCLID=9,a.config=a.set=fr,a.clone=r,a.isDecimal=dr,a.abs=K,a.acos=rr,a.acosh=tr,a.add=er,a.asin=nr,a.asinh=ir,a.atan=or,a.atanh=ar,a.atan2=ur,a.cbrt=sr,a.ceil=cr,a.cos=lr,a.cosh=mr,a.div=hr,a.exp=pr,a.floor=gr,a.hypot=yr,a.ln=vr,a.log=xr,a.log10=wr,a.log2=br,a.max=Mr,a.min=Ar,a.mod=Nr,a.mul=_r,a.pow=Er,a.random=Sr,a.round=jr,a.sign=Br,a.sin=Tr,a.sinh=zr,a.sqrt=Cr,a.sub=Or,a.tan=kr,a.tanh=Ir,a.trunc=Pr,void 0===t&&(t={}),t&&!0!==t.defaults)for(o=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;ei?Array(e-i+1).join(r):"")+n}}t.exports=o,o.prototype.newRow=function(){return this.rows.push(this.row),this.row={__printers:{}},this},o.prototype.cell=function(r,t,e){return this.row[r]=t,this.row.__printers[r]=e||a,this},o.prototype.separator=" ",o.string=a,o.leftPadder=s;var c=o.padLeft=s(" ");function f(r){return function(t,e){var n=a(t),i=u(n);return n+(e>i?Array(e-i+1).join(r):"")}}o.rightPadder=f;var l=f(" ");function m(r,t){for(var e in r)"__printers"!=e&&t(e,r[e])}function h(r,t){return r===t?0:void 0===r?1:void 0===t?-1:null===r?1:null===t?-1:r>t?1:r1&&void 0!==arguments[1]?arguments[1]:{},e=t.preserveFormatting,u=void 0!==e&&e,s=t.escapeMapFn,c=void 0===s?a:s,f=String(r),l="",m=c(n({},i),u?n({},o):{}),h=Object.keys(m),p=function(){var r=!1;h.forEach(function(t,e){r||f.length>=t.length&&f.slice(0,t.length)===t&&(l+=m[h[e]],f=f.slice(t.length,f.length),r=!0)}),r||(l+=f.slice(0,1),f=f.slice(1,f.length))};f;)p();return l}},{}],44:[function(r,t,e){"use strict";function n(r){if(this.size=0|r,this.size<=1||0!=(this.size&this.size-1))throw new Error("FFT size must be a power of two and bigger than 1");this._csize=r<<1;for(var t=new Array(2*this.size),e=0;eo;o<<=1)i++;this._width=i%2==0?i-1:i,this._bitrev=new Array(1<>>u&3)<>>1),n=0;n>>1]=r[n];return e},n.prototype.createComplexArray=function(){for(var r=new Array(this._csize),t=0;t>>1],e[n+1]=0;return e},n.prototype.completeSpectrum=function(r){for(var t=this._csize,e=t>>>1,n=2;n>=2;i>=2;i>>=2){var l=(o=n/i<<1)>>>2;for(r=0;r>>1,i>>>1)}else for(r=0,t=0;r>>1,i>>>1)}var c=this._inv?-1:1,f=this.table;for(i>>=2;i>=2;i>>=2){var l=(o=n/i<<1)>>>1,m=l>>>1,h=m>>>1;for(r=0;r>1,f=-7,l=e?i-1:0,m=e?-1:1,h=r[t+l];for(l+=m,o=h&(1<<-f)-1,h>>=-f,f+=u;f>0;o=256*o+r[t+l],l+=m,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+r[t+l],l+=m,f-=8);if(0===o)o=1-c;else{if(o===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},e.write=function(r,t,e,n,i,o){var a,u,s,c=8*o-i-1,f=(1<>1,m=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+l>=1?m/s:m*Math.pow(2,1-l))*s>=2&&(a++,s/=2),a+l>=f?(u=0,a=f):a+l>=1?(u=(t*s-1)*Math.pow(2,i),a+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;r[e+h]=255&u,h+=p,u/=256,i-=8);for(a=a<0;r[e+h]=255&a,h+=p,a/=256,c-=8);r[e+h-p]|=128*g}},{}],46:[function(r,t,e){"use strict";function n(r){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}t.exports=function r(t,e){var i,o,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,u=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,f=/^0/,l=function(t){return r.insensitive&&(""+t).toLowerCase()||""+t},m=l(t).replace(u,"")||"",h=l(e).replace(u,"")||"",p=m.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),g=h.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),y=parseInt(m.match(c),16)||1!==p.length&&m.match(s)&&Date.parse(m),d=parseInt(h.match(c),16)||y&&h.match(s)&&Date.parse(h)||null;if(d){if(yd)return 1}for(var v=0,x=Math.max(p.length,g.length);vo)return 1}return 0}},{}],47:[function(r,t,e){"use strict";t.exports=r("./lib/core/core")},{"./lib/core/core":48}],48:[function(r,t,e){"use strict";var n=r("./../utils/object").isFactory,i=r("./typed"),o=r("./../utils/emitter"),a=r("./function/import"),u=r("./function/config");e.create=function(r){if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var t=[],e=[],s=o.mixin({});s.type={},s.expression={transform:{},mathWithTransform:{}},s.typed=i.create(s.type);var c={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function f(r){if(!n(r))throw new Error("Factory object with properties `type`, `name`, and `factory` expected");var i,o=t.indexOf(r);return-1===o?(i=!0===r.math?r.factory(s.type,c,f,s.typed,s):r.factory(s.type,c,f,s.typed),t.push(r),e.push(i)):i=e[o],i}return s.import=f(a),s.config=f(u),s.expression.mathWithTransform.config=s.config,r&&s.config(r),s}},{"./../utils/emitter":225,"./../utils/object":230,"./function/config":49,"./function/import":50,"./typed":51}],49:[function(r,t,e){"use strict";var n=r("../../utils/object");function i(r,t,e){if(void 0!==r[t]&&(i=e,o=r[t],-1===i.indexOf(o))){var n=function(r,t){return r.map(function(r){return r.toLowerCase()}).indexOf(t.toLowerCase())}(e,r[t]);-1!==n?(console.warn('Warning: Wrong casing for configuration option "'+t+'", should be "'+e[n]+'" instead of "'+r[t]+'".'),r[t]=e[n]):console.warn('Warning: Unknown value "'+r[t]+'" for configuration option "'+t+'". Available options: '+e.map(JSON.stringify).join(", ")+".")}var i,o}e.name="config",e.math=!0,e.factory=function(r,t,e,o,a){var u=["Matrix","Array"],s=["number","BigNumber","Fraction"];function c(r){if(r){var e=n.map(t,n.clone);i(r,"matrix",u),i(r,"number",s),n.deepExtend(t,r);var o=n.map(t,n.clone),c=n.map(r,n.clone);return a.emit("config",o,e,c),o}return n.map(t,n.clone)}return c.MATRIX=u,c.NUMBER=s,c}},{"../../utils/object":230}],50:[function(r,t,e){"use strict";function n(r){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var i=r("../../utils/object").lazy,o=r("../../utils/object").isFactory,a=r("../../utils/object").traverse,u=r("../../error/ArgumentsError");e.math=!0,e.name="import",e.factory=function(r,t,e,s,c){function f(r,t,e){if(e.wrap&&"function"==typeof t&&(i=function(){for(var r=[],t=0,e=arguments.length;t15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+t+"). Use function bignumber(x) to convert to BigNumber.");return new r.BigNumber(t)}},{from:"number",to:"Complex",convert:function(t){return new r.Complex(t,0)}},{from:"number",to:"string",convert:function(r){return r+""}},{from:"BigNumber",to:"Complex",convert:function(t){return new r.Complex(t.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(r){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(t){return new r.Complex(t.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(t){if(new r.Fraction(t).valueOf()!==t)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+t+"). Use function fraction(x) to convert to Fraction.");return new r.Fraction(t)}},{from:"string",to:"number",convert:function(r){var t=Number(r);if(isNaN(t))throw new Error('Cannot convert "'+r+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(t){try{return new r.BigNumber(t)}catch(r){throw new Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){try{return new r.Fraction(t)}catch(r){throw new Error('Cannot convert "'+t+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t){try{return new r.Complex(t)}catch(r){throw new Error('Cannot convert "'+t+'" to Complex')}}},{from:"boolean",to:"number",convert:function(r){return+r}},{from:"boolean",to:"BigNumber",convert:function(t){return new r.BigNumber(+t)}},{from:"boolean",to:"Fraction",convert:function(t){return new r.Fraction(+t)}},{from:"boolean",to:"string",convert:function(r){return+r}},{from:"null",to:"number",convert:function(){return 0}},{from:"null",to:"string",convert:function(){return"null"}},{from:"null",to:"BigNumber",convert:function(){return new r.BigNumber(0)}},{from:"null",to:"Fraction",convert:function(){return new r.Fraction(0)}},{from:"Array",to:"Matrix",convert:function(t){return new r.DenseMatrix(t)}},{from:"Matrix",to:"Array",convert:function(r){return r.valueOf()}}],t}},{"./../utils/bignumber/isBigNumber":214,"./../utils/collection/isMatrix":221,"./../utils/number":229,"typed-function":239}],52:[function(r,t,e){"use strict";function n(r,t,e,i){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.fn=r,this.count=t,this.min=e,this.max=i,this.message="Wrong number of arguments in function "+r+" ("+t+" provided, "+e+(null!=i?"-"+i:"")+" expected)",this.stack=(new Error).stack}n.prototype=new Error,n.prototype.constructor=Error,n.prototype.name="ArgumentsError",n.prototype.isArgumentsError=!0,t.exports=n},{}],53:[function(r,t,e){"use strict";function n(r,t,e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.actual=r,this.expected=t,this.relation=e,this.message="Dimension mismatch ("+(Array.isArray(r)?"["+r.join(", ")+"]":r)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}n.prototype=new RangeError,n.prototype.constructor=RangeError,n.prototype.name="DimensionError",n.prototype.isDimensionError=!0,t.exports=n},{}],54:[function(r,t,e){"use strict";function n(r,t,e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.index=r,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=e),void 0!==this.min&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}n.prototype=new RangeError,n.prototype.constructor=RangeError,n.prototype.name="IndexError",n.prototype.isIndexError=!0,t.exports=n},{}],55:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="abs",e.factory=function(r,t,e,i){var o=i("abs",{number:Math.abs,Complex:function(r){return r.abs()},BigNumber:function(r){return r.abs()},Fraction:function(r){return r.abs()},"Array | Matrix":function(r){return n(r,o,!0)},Unit:function(r){return r.abs()}});return o.toTex={1:"\\left|${args[0]}\\right|"},o}},{"../../utils/collection/deepMap":219}],56:[function(r,t,e){"use strict";var n=r("../../utils/object").extend;e.name="add",e.factory=function(t,e,i,o){var a=i(r("../../type/matrix/function/matrix")),u=i(r("./addScalar")),s=r("../../utils/latex.js"),c=i(r("../../type/matrix/utils/algorithm01")),f=i(r("../../type/matrix/utils/algorithm04")),l=i(r("../../type/matrix/utils/algorithm10")),m=i(r("../../type/matrix/utils/algorithm13")),h=i(r("../../type/matrix/utils/algorithm14")),p=o("add",n({"Matrix, Matrix":function(r,t){var e;switch(r.storage()){case"sparse":switch(t.storage()){case"sparse":e=f(r,t,u);break;default:e=c(t,r,u,!0)}break;default:switch(t.storage()){case"sparse":e=c(r,t,u,!1);break;default:e=m(r,t,u)}}return e},"Array, Array":function(r,t){return p(a(r),a(t)).valueOf()},"Array, Matrix":function(r,t){return p(a(r),t)},"Matrix, Array":function(r,t){return p(r,a(t))},"Matrix, any":function(r,t){var e;switch(r.storage()){case"sparse":e=l(r,t,u,!1);break;default:e=h(r,t,u,!1)}return e},"any, Matrix":function(r,t){var e;switch(t.storage()){case"sparse":e=l(t,r,u,!0);break;default:e=h(t,r,u,!0)}return e},"Array, any":function(r,t){return h(a(r),t,u,!1).valueOf()},"any, Array":function(r,t){return h(a(t),r,u,!0).valueOf()},"any, any":u,"Array | Matrix | any, Array | Matrix | any, ...any":function(r,t,e){for(var n=p(r,t),i=0;i0?Math.floor(r):Math.ceil(r)},Complex:function(t){return new r.Complex(t.re>0?Math.floor(t.re):Math.ceil(t.re),t.im>0?Math.floor(t.im):Math.ceil(t.im))},BigNumber:function(r){return r.isNegative()?r.ceil():r.floor()},Fraction:function(r){return r.s<0?r.ceil():r.floor()},"Array | Matrix":function(r){return n(r,o,!0)}});return o.toTex={1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],68:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="floor",e.factory=function(r,t,e,i){var o=i("floor",{number:Math.floor,Complex:function(r){return r.floor()},BigNumber:function(r){return r.floor()},Fraction:function(r){return r.floor()},"Array | Matrix":function(r){return n(r,o,!0)}});return o.toTex={1:"\\left\\lfloor${args[0]}\\right\\rfloor"},o}},{"../../utils/collection/deepMap":219}],69:[function(r,t,e){"use strict";var n=r("../../utils/number").isInteger;function i(r,t){if(!n(r)||!n(t))throw new Error("Parameters in function gcd must be integer numbers");for(var e;0!=t;)e=r%t,r=t,t=e;return r<0?-r:r}e.name="gcd",e.factory=function(t,e,n,o){var a=n(r("../../type/matrix/function/matrix")),u=n(r("../../type/matrix/utils/algorithm01")),s=n(r("../../type/matrix/utils/algorithm04")),c=n(r("../../type/matrix/utils/algorithm10")),f=n(r("../../type/matrix/utils/algorithm13")),l=n(r("../../type/matrix/utils/algorithm14")),m=o("gcd",{"number, number":i,"BigNumber, BigNumber":function(r,e){if(!r.isInt()||!e.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var n=new t.BigNumber(0);!e.isZero();){var i=r.mod(e);r=e,e=i}return r.lt(n)?r.neg():r},"Fraction, Fraction":function(r,t){return r.gcd(t)},"Matrix, Matrix":function(r,t){var e;switch(r.storage()){case"sparse":switch(t.storage()){case"sparse":e=s(r,t,m);break;default:e=u(t,r,m,!0)}break;default:switch(t.storage()){case"sparse":e=u(r,t,m,!1);break;default:e=f(r,t,m)}}return e},"Array, Array":function(r,t){return m(a(r),a(t)).valueOf()},"Array, Matrix":function(r,t){return m(a(r),t)},"Matrix, Array":function(r,t){return m(r,a(t))},"Matrix, number | BigNumber":function(r,t){var e;switch(r.storage()){case"sparse":e=c(r,t,m,!1);break;default:e=l(r,t,m,!1)}return e},"number | BigNumber, Matrix":function(r,t){var e;switch(t.storage()){case"sparse":e=c(t,r,m,!0);break;default:e=l(t,r,m,!0)}return e},"Array, number | BigNumber":function(r,t){return l(a(r),t,m,!1).valueOf()},"number | BigNumber, Array":function(r,t){return l(a(t),r,m,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(r,t,e){for(var n=m(r,t),i=0;i=0||e.predictable?Math.log(r):new t.Complex(r,0).log()},Complex:function(r){return r.log()},BigNumber:function(r){return!r.isNegative()||e.predictable?r.ln():new t.Complex(r.toNumber(),0).log()},"Array | Matrix":function(r){return n(r,u)},"any, any":function(r,t){return a(u(r),u(t))}});return u.toTex={1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},u}},{"../../utils/collection/deepMap":219,"./divideScalar":62}],74:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");var i=Math.log10||function(r){return Math.log(r)/Math.LN10};e.name="log10",e.factory=function(r,t,e,o){var a=o("log10",{number:function(e){return e>=0||t.predictable?i(e):new r.Complex(e,0).log().div(Math.LN10)},Complex:function(t){return new r.Complex(t).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||t.predictable?e.log():new r.Complex(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":function(r){return n(r,a)}});return a.toTex={1:"\\log_{10}\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219}],75:[function(r,t,e){"use strict";e.name="mod",e.factory=function(t,e,n,i){var o=n(r("../../type/matrix/function/matrix")),a=r("../../utils/latex"),u=n(r("../../type/matrix/utils/algorithm02")),s=n(r("../../type/matrix/utils/algorithm03")),c=n(r("../../type/matrix/utils/algorithm05")),f=n(r("../../type/matrix/utils/algorithm11")),l=n(r("../../type/matrix/utils/algorithm12")),m=n(r("../../type/matrix/utils/algorithm13")),h=n(r("../../type/matrix/utils/algorithm14")),p=i("mod",{"number, number":function(r,t){if(t>0)return r-t*Math.floor(r/t);if(0===t)return r;throw new Error("Cannot calculate mod for a negative divisor")},"BigNumber, BigNumber":function(r,t){return t.isZero()?r:r.mod(t)},"Fraction, Fraction":function(r,t){return r.mod(t)},"Matrix, Matrix":function(r,t){var e;switch(r.storage()){case"sparse":switch(t.storage()){case"sparse":e=c(r,t,p,!1);break;default:e=u(t,r,p,!0)}break;default:switch(t.storage()){case"sparse":e=s(r,t,p,!1);break;default:e=m(r,t,p)}}return e},"Array, Array":function(r,t){return p(o(r),o(t)).valueOf()},"Array, Matrix":function(r,t){return p(o(r),t)},"Matrix, Array":function(r,t){return p(r,o(t))},"Matrix, any":function(r,t){var e;switch(r.storage()){case"sparse":e=f(r,t,p,!1);break;default:e=h(r,t,p,!1)}return e},"any, Matrix":function(r,t){var e;switch(t.storage()){case"sparse":e=l(t,r,p,!0);break;default:e=h(t,r,p,!0)}return e},"Array, any":function(r,t){return h(o(r),t,p,!1).valueOf()},"any, Array":function(r,t){return h(o(t),r,p,!0).valueOf()}});return p.toTex={2:"\\left(${args[0]}"+a.operators.mod+"${args[1]}\\right)"},p}},{"../../type/matrix/function/matrix":195,"../../type/matrix/utils/algorithm02":199,"../../type/matrix/utils/algorithm03":200,"../../type/matrix/utils/algorithm05":202,"../../type/matrix/utils/algorithm11":207,"../../type/matrix/utils/algorithm12":208,"../../type/matrix/utils/algorithm13":209,"../../type/matrix/utils/algorithm14":210,"../../utils/latex":228}],76:[function(r,t,e){"use strict";var n=r("../../utils/object").extend,i=r("../../utils/array");e.name="multiply",e.factory=function(t,e,o,a){var u=r("../../utils/latex"),s=o(r("../../type/matrix/function/matrix")),c=o(r("./addScalar")),f=o(r("./multiplyScalar")),l=o(r("../relational/equalScalar")),m=o(r("../../type/matrix/utils/algorithm11")),h=o(r("../../type/matrix/utils/algorithm14")),p=t.DenseMatrix,g=t.SparseMatrix,y=a("multiply",n({"Array, Array":function(r,e){d(i.size(r),i.size(e));var n=y(s(r),s(e));return t.isMatrix(n)?n.valueOf():n},"Matrix, Matrix":function(r,t){var e=r.size(),n=t.size();return d(e,n),1===e.length?1===n.length?v(r,t,e[0]):x(r,t):1===n.length?w(r,t):M(r,t)},"Matrix, Array":function(r,t){return y(r,s(t))},"Array, Matrix":function(r,t){return y(s(r,t.storage()),t)},"Matrix, any":function(r,t){var e;switch(r.storage()){case"sparse":e=m(r,t,f,!1);break;case"dense":e=h(r,t,f,!1)}return e},"any, Matrix":function(r,t){var e;switch(t.storage()){case"sparse":e=m(t,r,f,!0);break;case"dense":e=h(t,r,f,!0)}return e},"Array, any":function(r,t){return h(s(r),t,f,!1).valueOf()},"any, Array":function(r,t){return h(s(t),r,f,!0).valueOf()},"any, any":f,"Array | Matrix | any, Array | Matrix | any, ...any":function(r,t,e){for(var n=y(r,t),i=0;iS)for(var B=0,T=0;T=0||e.predictable?r.pow(n):new t.Complex(r.toNumber(),0).pow(n.toNumber(),0)},"Fraction, Fraction":function(r,t){if(1!==t.d){if(e.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return p(r.valueOf(),t.valueOf())}return r.pow(t)},"Array, number":g,"Array, BigNumber":function(r,t){return g(r,t.toNumber())},"Matrix, number":y,"Matrix, BigNumber":function(r,t){return y(r,t.toNumber())},"Unit, number":function(r,t){return r.pow(t)}});function p(r,i){if(e.predictable&&!n(i)&&r<0)try{var o=l(i),a=m(o);if((i===a||Math.abs((i-a)/i)<1e-14)&&o.d%2==1)return(o.n%2==0?1:-1)*Math.pow(-r,i)}catch(r){}return r*r<1&&i===1/0||r*r>1&&i===-1/0?0:e.predictable&&(r<-1&&i===1/0||r>-1&&r<0&&i===-1/0)?NaN:n(i)||r>=0||e.predictable?Math.pow(r,i):new t.Complex(r,0).pow(i,0)}function g(r,t){if(!n(t)||t<0)throw new TypeError("For A^b, b must be a positive integer (value is "+t+")");var e=i(r);if(2!=e.length)throw new Error("For A^b, A must be 2 dimensional (A has "+e.length+" dimensions)");if(e[0]!=e[1])throw new Error("For A^b, A must be square (size is "+e[0]+"x"+e[1]+")");for(var o=s(e[0]).valueOf(),a=r;t>=1;)1==(1&t)&&(o=c(a,o)),t>>=1,a=c(a,a);return o}function y(r,t){return f(g(r.valueOf(),t))}return h.toTex={2:"\\left(${args[0]}\\right)"+u.operators.pow+"{${args[1]}}"},h}},{"../../type/fraction/function/fraction":185,"../../type/matrix/function/matrix":195,"../../type/number":211,"../../utils/array":212,"../../utils/latex":228,"../../utils/number":229,"../matrix/eye":94,"./multiply":76}],81:[function(r,t,e){"use strict";var n=r("../../utils/number").isInteger,i=r("../../utils/number").toFixed,o=r("../../utils/collection/deepMap"),a="Number of decimals in function round must be an integer";e.name="round",e.factory=function(t,e,u,s){var c=u(r("../../type/matrix/function/matrix")),f=u(r("../relational/equalScalar")),l=u(r("../matrix/zeros")),m=u(r("../../type/matrix/utils/algorithm11")),h=u(r("../../type/matrix/utils/algorithm12")),p=u(r("../../type/matrix/utils/algorithm14")),g=s("round",{number:Math.round,"number, number":function(r,t){if(!n(t))throw new TypeError(a);if(t<0||t>15)throw new Error("Number of decimals in function round must be in te range of 0-15");return parseFloat(i(r,t))},Complex:function(r){return r.round()},"Complex, number":function(r,t){if(t%1)throw new TypeError(a);return r.round(t)},"Complex, BigNumber":function(r,t){if(!t.isInteger())throw new TypeError(a);var e=t.toNumber();return r.round(e)},"number, BigNumber":function(r,e){if(!e.isInteger())throw new TypeError(a);return new t.BigNumber(r).toDecimalPlaces(e.toNumber())},BigNumber:function(r){return r.toDecimalPlaces(0)},"BigNumber, BigNumber":function(r,t){if(!t.isInteger())throw new TypeError(a);return r.toDecimalPlaces(t.toNumber())},Fraction:function(r){return r.round()},"Fraction, number":function(r,t){if(t%1)throw new TypeError(a);return r.round(t)},"Array | Matrix":function(r){return o(r,g,!0)},"Matrix, number | BigNumber":function(r,t){var e;switch(r.storage()){case"sparse":e=m(r,t,g,!1);break;default:e=p(r,t,g,!1)}return e},"number | Complex | BigNumber, Matrix":function(r,t){if(!f(r,0)){var e;switch(t.storage()){case"sparse":e=h(t,r,g,!0);break;default:e=p(t,r,g,!0)}return e}return l(t.size(),t.storage())},"Array, number | BigNumber":function(r,t){return p(c(r),t,g,!1).valueOf()},"number | Complex | BigNumber, Array":function(r,t){return p(c(t),r,g,!0).valueOf()}});return g.toTex={1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},g}},{"../../type/matrix/function/matrix":195,"../../type/matrix/utils/algorithm11":207,"../../type/matrix/utils/algorithm12":208,"../../type/matrix/utils/algorithm14":210,"../../utils/collection/deepMap":219,"../../utils/number":229,"../matrix/zeros":113,"../relational/equalScalar":128}],82:[function(r,t,e){"use strict";var n=r("../../utils/number"),i=r("../../utils/collection/deepMap");e.name="sign",e.factory=function(r,t,e,o){var a=o("sign",{number:n.sign,Complex:function(r){return r.sign()},BigNumber:function(t){return new r.BigNumber(t.cmp(0))},Fraction:function(t){return new r.Fraction(t.s,1)},"Array | Matrix":function(r){return i(r,a,!0)},Unit:function(r){return a(r.value)}});return a.toTex={1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219,"../../utils/number":229}],83:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="sqrt",e.factory=function(r,t,e,i){var o=i("sqrt",{number:a,Complex:function(r){return r.sqrt()},BigNumber:function(r){return!r.isNegative()||t.predictable?r.sqrt():a(r.toNumber())},"Array | Matrix":function(r){return n(r,o,!0)},Unit:function(r){return r.pow(.5)}});function a(e){return e>=0||t.predictable?Math.sqrt(e):new r.Complex(e,0).sqrt()}return o.toTex={1:"\\sqrt{${args[0]}}"},o}},{"../../utils/collection/deepMap":219}],84:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="square",e.factory=function(r,t,e,i){var o=i("square",{number:function(r){return r*r},Complex:function(r){return r.mul(r)},BigNumber:function(r){return r.times(r)},Fraction:function(r){return r.mul(r)},"Array | Matrix":function(r){return n(r,o,!0)},Unit:function(r){return r.pow(2)}});return o.toTex={1:"\\left(${args[0]}\\right)^2"},o}},{"../../utils/collection/deepMap":219}],85:[function(r,t,e){"use strict";var n=r("../../error/DimensionError");e.name="subtract",e.factory=function(t,e,i,o){var a=r("../../utils/latex"),u=i(r("../../type/matrix/function/matrix")),s=i(r("./addScalar")),c=i(r("./unaryMinus")),f=i(r("../../type/matrix/utils/algorithm01")),l=i(r("../../type/matrix/utils/algorithm03")),m=i(r("../../type/matrix/utils/algorithm05")),h=i(r("../../type/matrix/utils/algorithm10")),p=i(r("../../type/matrix/utils/algorithm13")),g=i(r("../../type/matrix/utils/algorithm14")),y=o("subtract",{"number, number":function(r,t){return r-t},"Complex, Complex":function(r,t){return r.sub(t)},"BigNumber, BigNumber":function(r,t){return r.minus(t)},"Fraction, Fraction":function(r,t){return r.sub(t)},"Unit, Unit":function(r,t){if(null==r.value)throw new Error("Parameter x contains a unit with undefined value");if(null==t.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(t))throw new Error("Units do not match");var e=r.clone();return e.value=y(e.value,t.value),e.fixPrefix=!1,e},"Matrix, Matrix":function(r,t){var e,i=r.size(),o=t.size();if(i.length!==o.length)throw new n(i.length,o.length);switch(r.storage()){case"sparse":switch(t.storage()){case"sparse":e=m(r,t,y);break;default:e=l(t,r,y,!0)}break;default:switch(t.storage()){case"sparse":e=f(r,t,y,!1);break;default:e=p(r,t,y)}}return e},"Array, Array":function(r,t){return y(u(r),u(t)).valueOf()},"Array, Matrix":function(r,t){return y(u(r),t)},"Matrix, Array":function(r,t){return y(r,u(t))},"Matrix, any":function(r,t){var e;switch(r.storage()){case"sparse":e=h(r,c(t),s);break;default:e=g(r,t,y)}return e},"any, Matrix":function(r,t){var e;switch(t.storage()){case"sparse":e=h(t,r,y,!0);break;default:e=g(t,r,y,!0)}return e},"Array, any":function(r,t){return g(u(r),t,y,!1).valueOf()},"any, Array":function(r,t){return g(u(t),r,y,!0).valueOf()}});return y.toTex={2:"\\left(${args[0]}"+a.operators.subtract+"${args[1]}\\right)"},y}},{"../../error/DimensionError":53,"../../type/matrix/function/matrix":195,"../../type/matrix/utils/algorithm01":198,"../../type/matrix/utils/algorithm03":200,"../../type/matrix/utils/algorithm05":202,"../../type/matrix/utils/algorithm10":206,"../../type/matrix/utils/algorithm13":209,"../../type/matrix/utils/algorithm14":210,"../../utils/latex":228,"./addScalar":57,"./unaryMinus":86}],86:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="unaryMinus",e.factory=function(t,e,i,o){var a=r("../../utils/latex"),u=o("unaryMinus",{number:function(r){return-r},Complex:function(r){return r.neg()},BigNumber:function(r){return r.neg()},Fraction:function(r){return r.neg()},Unit:function(r){var t=r.clone();return t.value=u(r.value),t},"Array | Matrix":function(r){return n(r,u,!0)}});return u.toTex={1:a.operators.unaryMinus+"\\left(${args[0]}\\right)"},u}},{"../../utils/collection/deepMap":219,"../../utils/latex":228}],87:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="unaryPlus",e.factory=function(t,e,i,o){var a=r("../../utils/latex"),u=o("unaryPlus",{number:function(r){return r},Complex:function(r){return r},BigNumber:function(r){return r},Fraction:function(r){return r},Unit:function(r){return r.clone()},"Array | Matrix":function(r){return n(r,u,!0)},"boolean | string | null":function(r){return"BigNumber"==e.number?new t.BigNumber(+r):+r}});return u.toTex={1:a.operators.unaryPlus+"\\left(${args[0]}\\right)"},u}},{"../../utils/collection/deepMap":219,"../../utils/latex":228}],88:[function(r,t,e){"use strict";var n=r("../../utils/number").isInteger;e.name="xgcd",e.factory=function(t,e,i,o){var a=i(r("../../type/matrix/function/matrix")),u=o("xgcd",{"number, number":function(r,t){var i,o,u,s,c=0,f=1,l=1,m=0;if(!n(r)||!n(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)o=Math.floor(r/t),u=r-o*t,i=c,c=f-o*c,f=i,i=l,l=m-o*l,m=i,r=t,t=u;return s=r<0?[-r,-f,-m]:[r,r?f:0,m],"Array"===e.matrix?s:a(s)},"BigNumber, BigNumber":function(r,n){var i,o,u,s,c=new t.BigNumber(0),f=new t.BigNumber(1),l=c,m=f,h=f,p=c;if(!r.isInt()||!n.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!n.isZero();)o=r.div(n).floor(),u=r.mod(n),i=l,l=m.minus(o.times(l)),m=i,i=h,h=p.minus(o.times(h)),p=i,r=n,n=u;return s=r.lt(c)?[r.neg(),m.neg(),p.neg()]:[r,r.isZero()?0:m,p],"Array"===e.matrix?s:a(s)}});return u.toTex=void 0,u}},{"../../type/matrix/function/matrix":195,"../../utils/number":229}],89:[function(r,t,e){"use strict";var n=r("../../utils/object").clone,i=r("../../utils/number").isInteger,o=r("../../utils/array"),a=r("../../error/IndexError"),u=r("../../error/DimensionError");function s(r,t,e,n){if(n0&&m>c)throw new a(m,c+1)}else{var y=n(g).valueOf(),d=o.size(y);if(p[e]=y,c=m,m=d.length-1,e>0&&m!=c)throw new u(c+1,m+1)}}if(0==p.length)throw new SyntaxError("At least one matrix expected");for(var v=p.shift();p.length;)v=s(v,p.shift(),m,0);return h?l(v):v},"...string":function(r){return r.join("")}});return m.toTex=void 0,m}},{"../../error/DimensionError":53,"../../error/IndexError":54,"../../type/matrix/function/matrix":195,"../../utils/array":212,"../../utils/number":229,"../../utils/object":230}],90:[function(r,t,e){"use strict";var n=r("../../utils/array");e.name="cross",e.factory=function(t,e,i,o){var a=i(r("../../type/matrix/function/matrix")),u=i(r("../arithmetic/subtract")),s=i(r("../arithmetic/multiply")),c=o("cross",{"Matrix, Matrix":function(r,t){return a(f(r.toArray(),t.toArray()))},"Matrix, Array":function(r,t){return a(f(r.toArray(),t))},"Array, Matrix":function(r,t){return a(f(r,t.toArray()))},"Array, Array":f});return c.toTex={2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},c;function f(r,t){var e=Math.max(n.size(r).length,n.size(t).length);r=n.squeeze(r),t=n.squeeze(t);var i=n.size(r),o=n.size(t);if(1!=i.length||1!=o.length||3!=i[0]||3!=o[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+i.join(", ")+"], B = ["+o.join(", ")+"])");var a=[u(s(r[1],t[2]),s(r[2],t[1])),u(s(r[2],t[0]),s(r[0],t[2])),u(s(r[0],t[1]),s(r[1],t[0]))];return e>1?[a]:a}}},{"../../type/matrix/function/matrix":195,"../../utils/array":212,"../arithmetic/multiply":76,"../arithmetic/subtract":85}],91:[function(r,t,e){"use strict";var n=r("../../utils/index"),i=n.object,o=n.string;e.name="det",e.factory=function(t,e,n,a){var u=n(r("../../type/matrix/function/matrix")),s=n(r("../arithmetic/add")),c=n(r("../arithmetic/subtract")),f=n(r("../arithmetic/multiply")),l=n(r("../arithmetic/unaryMinus")),m=a("det",{any:function(r){return i.clone(r)},"Array | Matrix":function(r){var e;switch((e=t.isMatrix(r)?r.size():Array.isArray(r)?(r=u(r)).size():[]).length){case 0:return i.clone(r);case 1:if(1==e[0])return i.clone(r.valueOf()[0]);throw new RangeError("Matrix must be square (size: "+o.format(e)+")");case 2:var n=e[0],a=e[1];if(n==a)return function(r,t,e){if(1==t)return i.clone(r[0][0]);if(2==t)return c(f(r[0][0],r[1][1]),f(r[1][0],r[0][1]));for(var n=function(r){var t,e,n=new Array(r.length),i=0;for(t=1;t0?e:0,s=e<0?-e:0;switch(n.length){case 1:return function(r,e,n,i,o,a){var u=[i+o,i+a],s=t.Matrix.storage(n||"dense").diagonal(u,r,e);return null!==n?s:s.valueOf()}(r,e,o,n[0],s,a);case 2:return function(r,e,n,i,o,a){if(t.isMatrix(r)){var s=r.diagonal(e);return null!==n?n!==s.storage()?u(s,n):s:s.valueOf()}for(var c=Math.min(i[0]-o,i[1]-a),f=[],l=0;l2||n(t).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(r.length)+", y = "+JSON.stringify(t.length)+")");var e=[],i=[];return r.map(function(r){return t.map(function(t){return r.map(function(r){return t.map(function(t){return i.push(u(r,t))})},e.push(i=[]))})},e=[])&&e}}},{"../../type/matrix/function/matrix":195,"../../utils/array":212,"../arithmetic/multiplyScalar":77}],101:[function(r,t,e){"use strict";var n=r("../../utils/function").maxArgumentCount;function i(r,t){var e=n(t);return function n(i,o){return Array.isArray(i)?i.map(function(r,t){return n(r,o.concat(t))}):1===e?t(i):2===e?t(i,o):t(i,o,r)}(r,[])}e.name="map",e.factory=function(r,t,e,n){var o=n("map",{"Array, function":i,"Matrix, function":function(r,t){return r.map(t)}});return o.toTex=void 0,o}},{"../../utils/function":226}],102:[function(r,t,e){"use strict";var n=r("../../utils/number").isInteger,i=r("../../utils/array").resize;e.name="ones",e.factory=function(t,e,o,a){var u=o(r("../../type/matrix/function/matrix")),s=a("ones",{"":function(){return"Array"===e.matrix?c([]):c([],"default")},"...number | BigNumber | string":function(r){if("string"==typeof r[r.length-1]){var t=r.pop();return c(r,t)}return"Array"===e.matrix?c(r):c(r,"default")},Array:c,Matrix:function(r){var t=r.storage();return c(r.valueOf(),t)},"Array | Matrix, string":function(r,t){return c(r.valueOf(),t)}});return s.toTex=void 0,s;function c(r,e){var o=function(r){var e=!1;return r.forEach(function(r,n,i){t.isBigNumber(r)&&(e=!0,i[n]=r.toNumber())}),e}(r)?new t.BigNumber(1):1;if(function(r){r.forEach(function(r){if("number"!=typeof r||!n(r)||r<0)throw new Error("Parameters in function ones must be positive integers")})}(r),e){var a=u(e);return r.length>0?a.resize(r,o):a}var s=[];return r.length>0?i(s,r,o):s}}},{"../../type/matrix/function/matrix":195,"../../utils/array":212,"../../utils/number":229}],103:[function(r,t,e){"use strict";var n=r("../../utils/number").isInteger;e.name="partitionSelect",e.factory=function(t,e,i,o){var a=i(r("../relational/compare"));function u(r,t){return-a(r,t)}return o("partitionSelect",{"Array | Matrix, number":function(r,t){return s(r,t,a)},"Array | Matrix, number, string":function(r,t,e){if("asc"===e)return s(r,t,a);if("desc"===e)return s(r,t,u);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":s});function s(r,e,i){if(!n(e)||e<0)throw new Error("k must be a non-negative integer");if(t.isMatrix(r)){if(r.size().length>1)throw new Error("Only one dimensional matrices supported");return c(r.valueOf(),e,i)}if(Array.isArray(r))return c(r,e,i)}function c(r,t,e){if(t>=r.length)throw new Error("k out of bounds");for(var n=0,i=r.length-1;n=0){var s=r[a];r[a]=r[o],r[o]=s,--a}else++o;e(r[o],u)>0&&--o,t<=o?i=o:n=o+1}return r[t]}}},{"../../utils/number":229,"../relational/compare":126}],104:[function(r,t,e){"use strict";e.name="range",e.factory=function(t,e,n,i){var o=n(r("../../type/matrix/function/matrix")),a=new t.BigNumber(0),u=new t.BigNumber(1),s=i("range",{string:f,"string, boolean":f,"number, number":function(r,t){return c(l(r,t,1))},"number, number, number":function(r,t,e){return c(l(r,t,e))},"number, number, boolean":function(r,t,e){return c(e?m(r,t,1):l(r,t,1))},"number, number, number, boolean":function(r,t,e,n){return c(n?m(r,t,e):l(r,t,e))},"BigNumber, BigNumber":function(r,t){return c(h(r,t,u))},"BigNumber, BigNumber, BigNumber":function(r,t,e){return c(h(r,t,e))},"BigNumber, BigNumber, boolean":function(r,t,e){return c(e?p(r,t,u):h(r,t,u))},"BigNumber, BigNumber, BigNumber, boolean":function(r,t,e,n){return c(n?p(r,t,e):h(r,t,e))}});return s.toTex=void 0,s;function c(r){return"Array"===e.matrix?r:o(r)}function f(r,n){var i=function(r){var t=r.split(":").map(function(r){return Number(r)});if(t.some(function(r){return isNaN(r)}))return null;switch(t.length){case 2:return{start:t[0],end:t[1],step:1};case 3:return{start:t[0],end:t[2],step:t[1]};default:return null}}(r);if(!i)throw new SyntaxError('String "'+r+'" is no valid range');return"BigNumber"===e.number?c((n?p:h)(new t.BigNumber(i.start),new t.BigNumber(i.end),new t.BigNumber(i.step))):c((n?m:l)(i.start,i.end,i.step))}function l(r,t,e){var n=[],i=r;if(e>0)for(;it;)n.push(i),i+=e;return n}function m(r,t,e){var n=[],i=r;if(e>0)for(;i<=t;)n.push(i),i+=e;else if(e<0)for(;i>=t;)n.push(i),i+=e;return n}function h(r,t,e){var n=[],i=r;if(e.gt(a))for(;i.lt(t);)n.push(i),i=i.plus(e);else if(e.lt(a))for(;i.gt(t);)n.push(i),i=i.plus(e);return n}function p(r,t,e){var n=[],i=r;if(e.gt(a))for(;i.lte(t);)n.push(i),i=i.plus(e);else if(e.lt(a))for(;i.gte(t);)n.push(i),i=i.plus(e);return n}}},{"../../type/matrix/function/matrix":195}],105:[function(r,t,e){"use strict";r("../../error/DimensionError");var n=r("../../utils/number").isInteger,i=r("../../utils/array");e.name="reshape",e.factory=function(t,e,o,a){var u=o(r("../../type/matrix/function/matrix")),s=a("reshape",{"Matrix, Array":function(r,t){return r.reshape?r.reshape(t):u(i.reshape(r.valueOf(),t))},"Array, Array":function(r,t){return t.forEach(function(r){if(!n(r))throw new TypeError("Invalid size for dimension: "+r)}),i.reshape(r,t)}});return s.toTex=void 0,s}},{"../../error/DimensionError":53,"../../type/matrix/function/matrix":195,"../../utils/array":212,"../../utils/number":229}],106:[function(r,t,e){"use strict";var n=r("../../error/DimensionError"),i=r("../../error/ArgumentsError"),o=r("../../utils/number").isInteger,a=r("../../utils/string").format,u=r("../../utils/object").clone,s=r("../../utils/array");e.name="resize",e.factory=function(t,e,c,f){var l=c(r("../../type/matrix/function/matrix")),m=function(r,c,f){if(2!=arguments.length&&3!=arguments.length)throw new i("resize",arguments.length,2,3);if(t.isMatrix(c)&&(c=c.valueOf()),t.isBigNumber(c[0])&&(c=c.map(function(r){return t.isBigNumber(r)?r.toNumber():r})),t.isMatrix(r))return r.resize(c,f,!0);if("string"==typeof r)return function(r,t,e){if(void 0!==e){if("string"!=typeof e||1!==e.length)throw new TypeError("Single character expected as defaultValue")}else e=" ";if(1!==t.length)throw new n(t.length,1);var i=t[0];if("number"!=typeof i||!o(i))throw new TypeError("Invalid size, must contain positive integers (size: "+a(t)+")");if(r.length>i)return r.substring(0,i);if(r.lengths)for(f=s-1,a=c.length;f0)for(var f=0;ff)break}return c}throw new RangeError("Matrix must be square (size: "+i(o)+")")};return c.toTex={1:"\\mathrm{tr}\\left(${args[0]}\\right)"},c}},{"../../type/matrix/function/matrix":195,"../../utils/object":230,"../../utils/string":231,"../arithmetic/add":56}],112:[function(r,t,e){"use strict";var n=r("../../utils/object").clone,i=r("../../utils/string").format;e.name="transpose",e.factory=function(t,e,o,a){var u=r("../../utils/latex"),s=o(r("../../type/matrix/function/matrix")),c=t.DenseMatrix,f=t.SparseMatrix,l=a("transpose",{Array:function(r){return l(s(r)).valueOf()},Matrix:function(r){var t,e=r.size();switch(e.length){case 1:t=r.clone();break;case 2:var n=e[0],o=e[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+i(e)+")");switch(r.storage()){case"dense":t=m(r,n,o);break;case"sparse":t=h(r,n,o)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+i(this._size)+")")}return t},any:function(r){return n(r)}}),m=function(r,t,e){for(var i,o=r._data,a=[],u=0;u0?a.resize(r,o):a}var s=[];return r.length>0?i(s,r,o):s}}},{"../../type/matrix/function/matrix":195,"../../utils/array":212,"../../utils/number":229}],114:[function(r,t,e){"use strict";var n=r("../../utils/number").isInteger;function i(r){return r.isInteger()&&r.gte(0)}e.name="combinations",e.factory=function(r,t,e,o){var a=o("combinations",{"number, number":function(r,t){var e,i,o;if(!n(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(!n(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>r)throw new TypeError("k must be less than or equal to n");for(e=Math.max(t,r-t),i=1,o=1;o<=r-e;o++)i=i*(e+o)/o;return i},"BigNumber, BigNumber":function(t,e){var n,o,a,u,s=new r.BigNumber(1);if(!i(t)||!i(e))throw new TypeError("Positive integer value expected in function combinations");if(e.gt(t))throw new TypeError("k must be less than n in function combinations");for(n=t.minus(e),e.lt(n)&&(n=e),o=s,a=s,u=t.minus(n);a.lte(u);a=a.plus(1))o=o.times(n.plus(a)).dividedBy(a);return o}});return a.toTex={2:"\\binom{${args[0]}}{${args[1]}}"},a}},{"../../utils/number":229}],115:[function(r,t,e){"use strict";var n=r("../../error/ArgumentsError"),i=r("../../utils/collection/isCollection"),o=r("../../utils/number").isNumber;e.name="distribution",e.factory=function(t,e,a,u,s){var c=a(r("../../type/matrix/function/matrix")),f=r("../../utils/array"),l=a(r("./seededRNG"));function m(r){if(!h.hasOwnProperty(r))throw new Error("Unknown distribution "+r);var e=Array.prototype.slice.call(arguments,1);return function(r){var e={random:function(r,e,a){var u,f,l;if(arguments.length>3)throw new n("random",arguments.length,0,3);if(1===arguments.length?i(r)?u=r:l=r:2===arguments.length?i(r)?(u=r,l=e):(f=r,l=e):(u=r,f=e,l=a),void 0!==f&&!o(f)||void 0!==l&&!o(l))throw new TypeError("Invalid argument in function random");if(void 0===l&&(l=1),void 0===f&&(f=0),void 0!==u){var m=h(u.valueOf(),f,l,s);return t.isMatrix(u)?c(m):m}return s(f,l)},randomInt:u({"number | Array":function(r){if(i(r)){var e=r,n=1,o=h(e.valueOf(),0,n,m);return t.isMatrix(e)?c(o):o}return m(0,n=r)},"number | Array, number":function(r,e){if(i(r)){var n=r,o=e,a=0,u=h(n.valueOf(),a,o,m);return t.isMatrix(n)?c(u):u}return m(a=r,o=e)},"Array, number, number":function(r,t,e){var n=h(r.valueOf(),t,e,m);return r&&!0===r.isMatrix?c(n):n}}),pickRandom:u({Array:function(r){return a(r)},"Array, number | Array":function(r,t){var e,n;if(Array.isArray(t))n=t;else{if(!o(t))throw new TypeError("Invalid argument in function pickRandom");e=t}return a(r,e,n)},"Array, number | Array, Array | number":function(r,t,e){var n,i;if(Array.isArray(t)?(i=t,n=e):(i=e,n=t),!Array.isArray(i)||!o(n))throw new TypeError("Invalid argument in function pickRandom");return a(r,n,i)}})},a=function(r,e,n){var i=void 0===e;if(i&&(e=1),t.isMatrix(r))r=r.valueOf();else if(!Array.isArray(r))throw new TypeError("Unsupported type of value in function pickRandom");if(f.size(r).length>1)throw new Error("Only one dimensional vectors supported");if(void 0!==n){if(n.length!=r.length)throw new Error("Weights must have the same length as possibles");for(var a=0,u=0,s=n.length;u=c)return e>1?r:r[0];for(var m,h=[];h.length1)for(var a=0,u=t.shift();a1;)r=l(),t=l(),e=1/6*Math.pow(-2*Math.log(r),.5)*Math.cos(2*Math.PI*t)+.5;return e}}};return m.toTex=void 0,m}},{"../../error/ArgumentsError":52,"../../type/matrix/function/matrix":195,"../../utils/array":212,"../../utils/collection/isCollection":220,"../../utils/number":229,"./seededRNG":125}],116:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="factorial",e.factory=function(t,e,i,o){var a=i(r("./gamma")),u=r("../../utils/latex"),s=o("factorial",{number:function(r){if(r<0)throw new Error("Value must be non-negative");return a(r+1)},BigNumber:function(r){if(r.isNegative())throw new Error("Value must be non-negative");return a(r.plus(1))},"Array | Matrix":function(r){return n(r,s)}});return s.toTex={1:"\\left(${args[0]}\\right)"+u.operators.factorial},s}},{"../../utils/collection/deepMap":219,"../../utils/latex":228,"./gamma":117}],117:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap"),i=r("../../utils/number").isInteger;var o=4.7421875,a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.name="gamma",e.factory=function(t,e,u,s){var c=u(r("../arithmetic/multiply")),f=u(r("../arithmetic/pow")),l=s("gamma",{number:function(r){var t,e;if(i(r)){if(r<=0)return isFinite(r)?1/0:NaN;if(r>171)return 1/0;for(var n=r-2,u=r-1;n>1;)u*=n,n--;return 0==u&&(u=1),u}if(r<.5)return Math.PI/(Math.sin(Math.PI*r)*l(1-r));if(r>=171.35)return 1/0;if(r>85){var s=r*r,c=s*r,f=c*r,m=f*r;return Math.sqrt(2*Math.PI/r)*Math.pow(r/Math.E,r)*(1+1/(12*r)+1/(288*s)-139/(51840*c)-571/(2488320*f)+163879/(209018880*m)+5246819/(75246796800*m*r))}--r,e=a[0];for(var h=1;h1;)i=i.times(o),o--;return new t.BigNumber(i.toPrecision(t.BigNumber.precision))}(r.minus(1));if(!r.isFinite())return new t.BigNumber(r.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")},"Array | Matrix":function(r){return n(r,l)}});return l.toTex={1:"\\Gamma\\left(${args[0]}\\right)"},l}},{"../../utils/collection/deepMap":219,"../../utils/number":229,"../arithmetic/multiply":76,"../arithmetic/pow":80}],118:[function(r,t,e){"use strict";t.exports=[r("./combinations"),r("./factorial"),r("./gamma"),r("./kldivergence"),r("./multinomial"),r("./permutations"),r("./pickRandom"),r("./random"),r("./randomInt")]},{"./combinations":114,"./factorial":116,"./gamma":117,"./kldivergence":119,"./multinomial":120,"./permutations":121,"./pickRandom":122,"./random":123,"./randomInt":124}],119:[function(r,t,e){"use strict";e.name="kldivergence",e.factory=function(t,e,n,i){var o=n(r("../../type/matrix/function/matrix")),a=n(r("../arithmetic/divide")),u=n(r("../statistics/sum")),s=n(r("../arithmetic/multiply")),c=n(r("../arithmetic/dotDivide")),f=n(r("../arithmetic/log")),l=n(r("../utils/isNumeric"));function m(r,t){var e=t.size().length,n=r.size().length;if(e>1)throw new Error("first object must be one dimensional");if(n>1)throw new Error("second object must be one dimensional");if(e!==n)throw new Error("Length of two vectors must be equal");if(0===u(r))throw new Error("Sum of elements in first object must be non zero");if(0===u(t))throw new Error("Sum of elements in second object must be non zero");var i=a(r,u(r)),o=a(t,u(t)),m=u(s(i,f(c(i,o))));return l(m)?m:Number.NaN}return i("kldivergence",{"Array, Array":function(r,t){return m(o(r),o(t))},"Matrix, Array":function(r,t){return m(r,o(t))},"Array, Matrix":function(r,t){return m(o(r),t)},"Matrix, Matrix":function(r,t){return m(r,t)}})}},{"../../type/matrix/function/matrix":195,"../arithmetic/divide":61,"../arithmetic/dotDivide":63,"../arithmetic/log":73,"../arithmetic/multiply":76,"../statistics/sum":141,"../utils/isNumeric":174}],120:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepForEach");e.name="multinomial",e.factory=function(t,e,i,o){var a=i(r("../arithmetic/add")),u=i(r("../arithmetic/multiply")),s=i(r("../arithmetic/divide")),c=i(r("../probability/factorial")),f=i(r("../utils/isInteger")),l=i(r("../utils/isPositive"));return o("multinomial",{"Array | Matrix":function(r){var t=0,e=1;return n(r,function(r){if(!f(r)||!l(r))throw new TypeError("Positive integer value expected in function multinomial");t=a(t,r),e=u(e,c(r))}),s(c(t),e)}})}},{"../../utils/collection/deepForEach":218,"../arithmetic/add":56,"../arithmetic/divide":61,"../arithmetic/multiply":76,"../probability/factorial":116,"../utils/isInteger":171,"../utils/isPositive":175}],121:[function(r,t,e){"use strict";var n=r("../../utils/number").isInteger;function i(r){return r.isInteger()&&r.gte(0)}e.name="permutations",e.factory=function(t,e,o,a){var u=a("permutations",{"number | BigNumber":o(r("./factorial")),"number, number":function(r,t){var e,i;if(!n(r)||r<0)throw new TypeError("Positive integer value expected in function permutations");if(!n(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>r)throw new TypeError("second argument k must be less than or equal to first argument n");for(e=1,i=r-t+1;i<=r;i++)e*=i;return e},"BigNumber, BigNumber":function(r,e){var n,o;if(!i(r)||!i(e))throw new TypeError("Positive integer value expected in function permutations");if(e.gt(r))throw new TypeError("second argument k must be less than or equal to first argument n");for(n=new t.BigNumber(1),o=r.minus(e).plus(1);o.lte(r);o=o.plus(1))n=n.times(o);return n}});return u.toTex=void 0,u}},{"../../utils/number":229,"./factorial":116}],122:[function(r,t,e){"use strict";e.name="pickRandom",e.factory=function(t,e,n,i){var o=n(r("./distribution"))("uniform").pickRandom;return o.toTex=void 0,o}},{"./distribution":115}],123:[function(r,t,e){"use strict";e.name="random",e.factory=function(t,e,n,i){var o=n(r("./distribution"))("uniform").random;return o.toTex=void 0,o}},{"./distribution":115}],124:[function(r,t,e){"use strict";e.name="randomInt",e.factory=function(t,e,n,i){var o=n(r("./distribution"))("uniform").randomInt;return o.toTex=void 0,o}},{"./distribution":115}],125:[function(r,t,e){"use strict";var n=r("seed-random"),i=n();e.factory=function(r,t,e,o,a){var u;function s(r){u=null===r?i:n(String(r))}return s(t.randomSeed),a.on("config",function(r,t,e){void 0!==e.randomSeed&&s(r.randomSeed)}),function(){return u()}},e.math=!0},{"seed-random":237}],126:[function(r,t,e){"use strict";var n=r("../../utils/number").nearlyEqual,i=r("../../utils/bignumber/nearlyEqual");e.name="compare",e.factory=function(t,e,o,a){var u=o(r("../../type/matrix/function/matrix")),s=o(r("../../type/matrix/utils/algorithm03")),c=o(r("../../type/matrix/utils/algorithm05")),f=o(r("../../type/matrix/utils/algorithm12")),l=o(r("../../type/matrix/utils/algorithm13")),m=o(r("../../type/matrix/utils/algorithm14")),h=a("compare",{"boolean, boolean":function(r,t){return r===t?0:r>t?1:-1},"number, number":function(r,t){return r===t||n(r,t,e.epsilon)?0:r>t?1:-1},"BigNumber, BigNumber":function(r,n){return r.eq(n)||i(r,n,e.epsilon)?new t.BigNumber(0):new t.BigNumber(r.cmp(n))},"Fraction, Fraction":function(r,e){return new t.Fraction(r.compare(e))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(r,t){if(!r.equalBase(t))throw new Error("Cannot compare units with different base");return h(r.value,t.value)},"string, string":function(r,t){return r===t?0:r>t?1:-1},"Matrix, Matrix":function(r,t){var e;switch(r.storage()){case"sparse":switch(t.storage()){case"sparse":e=c(r,t,h);break;default:e=s(t,r,h,!0)}break;default:switch(t.storage()){case"sparse":e=s(r,t,h,!1);break;default:e=l(r,t,h)}}return e},"Array, Array":function(r,t){return h(u(r),u(t)).valueOf()},"Array, Matrix":function(r,t){return h(u(r),t)},"Matrix, Array":function(r,t){return h(r,u(t))},"Matrix, any":function(r,t){var e;switch(r.storage()){case"sparse":e=f(r,t,h,!1);break;default:e=m(r,t,h,!1)}return e},"any, Matrix":function(r,t){var e;switch(t.storage()){case"sparse":e=f(t,r,h,!0);break;default:e=m(t,r,h,!0)}return e},"Array, any":function(r,t){return m(u(r),t,h,!1).valueOf()},"any, Array":function(r,t){return m(u(t),r,h,!0).valueOf()}});return h.toTex=void 0,h}},{"../../type/matrix/function/matrix":195,"../../type/matrix/utils/algorithm03":200,"../../type/matrix/utils/algorithm05":202,"../../type/matrix/utils/algorithm12":208,"../../type/matrix/utils/algorithm13":209,"../../type/matrix/utils/algorithm14":210,"../../utils/bignumber/nearlyEqual":215,"../../utils/number":229}],127:[function(r,t,e){"use strict";var n=r("javascript-natural-sort");e.name="compareNatural",e.factory=function(t,e,i,o){var a=i(r("../utils/typeof")),u=(i(r("../../type/matrix/function/matrix")),i(r("./compare"))),s=u.signatures["boolean,boolean"],c=o("compareNatural",{"any, any":function(r,e){var i,o=a(r),l=a(e);if(!("number"!==o&&"BigNumber"!==o&&"Fraction"!==o||"number"!==l&&"BigNumber"!==l&&"Fraction"!==l))return"0"!==(i=u(r,e)).toString()?i>0?1:-1:n(o,l);if("Array"===o||"Matrix"===o||"Array"===l||"Matrix"===l)return 0!==(i=function r(e,n){return t.isSparseMatrix(e)&&t.isSparseMatrix(n)?f(e.toJSON().values,n.toJSON().values):t.isSparseMatrix(e)?r(e.toArray(),n):t.isSparseMatrix(n)?r(e,n.toArray()):t.isDenseMatrix(e)?r(e.toJSON().data,n):t.isDenseMatrix(n)?r(e,n.toJSON().data):Array.isArray(e)?Array.isArray(n)?f(e,n):r(e,[n]):r([e],n)}(r,e))?i:n(o,l);if(o!==l)return n(o,l);if("Complex"===o)return function(r,t){return r.re>t.re?1:r.ret.im?1:r.imt.length?1:r.lengtht},"number, number":function(r,t){return r>t&&!n(r,t,e.epsilon)},"BigNumber, BigNumber":function(r,t){return r.gt(t)&&!i(r,t,e.epsilon)},"Fraction, Fraction":function(r,t){return 1===r.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(r,t){if(!r.equalBase(t))throw new Error("Cannot compare units with different base");return p(r.value,t.value)},"string, string":function(r,t){return r>t},"Matrix, Matrix":function(r,t){var e;switch(r.storage()){case"sparse":switch(t.storage()){case"sparse":e=c(r,t,p);break;default:e=s(t,r,p,!0)}break;default:switch(t.storage()){case"sparse":e=s(r,t,p,!1);break;default:e=l(r,t,p)}}return e},"Array, Array":function(r,t){return p(u(r),u(t)).valueOf()},"Array, Matrix":function(r,t){return p(u(r),t)},"Matrix, Array":function(r,t){return p(r,u(t))},"Matrix, any":function(r,t){var e;switch(r.storage()){case"sparse":e=f(r,t,p,!1);break;default:e=m(r,t,p,!1)}return e},"any, Matrix":function(r,t){var e;switch(t.storage()){case"sparse":e=f(t,r,p,!0);break;default:e=m(t,r,p,!0)}return e},"Array, any":function(r,t){return m(u(r),t,p,!1).valueOf()},"any, Array":function(r,t){return m(u(t),r,p,!0).valueOf()}});return p.toTex={2:"\\left(${args[0]}"+h.operators.larger+"${args[1]}\\right)"},p}},{"../../type/matrix/function/matrix":195,"../../type/matrix/utils/algorithm03":200,"../../type/matrix/utils/algorithm07":204,"../../type/matrix/utils/algorithm12":208,"../../type/matrix/utils/algorithm13":209,"../../type/matrix/utils/algorithm14":210,"../../utils/bignumber/nearlyEqual":215,"../../utils/latex":228,"../../utils/number":229}],130:[function(r,t,e){"use strict";var n=r("../../utils/number").nearlyEqual,i=r("../../utils/bignumber/nearlyEqual");e.name="smaller",e.factory=function(t,e,o,a){var u=o(r("../../type/matrix/function/matrix")),s=o(r("../../type/matrix/utils/algorithm03")),c=o(r("../../type/matrix/utils/algorithm07")),f=o(r("../../type/matrix/utils/algorithm12")),l=o(r("../../type/matrix/utils/algorithm13")),m=o(r("../../type/matrix/utils/algorithm14")),h=r("../../utils/latex"),p=a("smaller",{"boolean, boolean":function(r,t){return r0&&(o=r[a]);return p(o,i)}var u=f(r,(t-1)/2);return h(u)}var h=a({"number | BigNumber | Complex | Unit":function(r){return r}}),p=a({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(r,t){return s(u(r,t),2)}});return l.toTex=void 0,l}},{"../../utils/array":212,"../../utils/collection/containsCollections":217,"../../utils/collection/reduce":222,"../arithmetic/addScalar":57,"../arithmetic/divideScalar":62,"../matrix/partitionSelect":103,"../relational/compare":126}],136:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepForEach"),i=r("../../utils/collection/reduce"),o=r("../../utils/collection/containsCollections");e.name="min",e.factory=function(t,e,a,u){var s=a(r("../relational/smaller")),c=u("min",{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(r,t){return i(r,t.valueOf(),f)},"...":function(r){if(o(r))throw new TypeError("Scalar values expected in function min");return l(r)}});return c.toTex="\\min\\left(${args}\\right)",c;function f(r,t){return s(r,t)?r:t}function l(r){var t=void 0;if(n(r,function(r){(void 0===t||s(r,t))&&(t=r)}),void 0===t)throw new Error("Cannot calculate min of an empty array");return t}}},{"../../utils/collection/containsCollections":217,"../../utils/collection/deepForEach":218,"../../utils/collection/reduce":222,"../relational/smaller":130}],137:[function(r,t,e){"use strict";var n=r("../../utils/array").flatten;e.name="mode",e.factory=function(r,t,e,i){return i("mode",{"Array | Matrix":o,"...":function(r){return o(r)}});function o(r){if(0==(r=n(r.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");var t={},e=[],i=0;for(var o in r)r[o]in t||(t[r[o]]=0),t[r[o]]++,t[r[o]]==i?e.push(r[o]):t[r[o]]>i&&(i=t[r[o]],e=[r[o]]);return e}}},{"../../utils/array":212}],138:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepForEach");e.name="prod",e.factory=function(t,e,i,o){var a=i(r("../arithmetic/multiplyScalar")),u=o("prod",{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(r,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(r){return s(r)}});return u.toTex=void 0,u;function s(r){var t=void 0;if(n(r,function(r){t=void 0===t?r:a(t,r)}),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}}},{"../../utils/collection/deepForEach":218,"../arithmetic/multiplyScalar":77}],139:[function(r,t,e){"use strict";var n=r("../../utils/number").isInteger,i=r("../../utils/number").isNumber,o=r("../../utils/array").flatten,a=r("../../utils/collection/isCollection");e.name="quantileSeq",e.factory=function(t,e,u,s){var c=u(r("../arithmetic/add")),f=u(r("../arithmetic/multiply")),l=u(r("../matrix/partitionSelect")),m=u(r("../relational/compare"));function h(r,t,e){var n=o(r),a=n.length;if(0===a)throw new Error("Cannot calculate quantile of an empty sequence");if(i(t)){var u;if(0==(v=(u=t*(a-1))%1)){var s=e?n[u]:l(n,u);return p(s),s}var h=Math.floor(u);if(e)y=n[h],d=n[h+1];else{d=l(n,h+1),y=n[h];for(var g=0;g0&&(y=n[g])}return p(y),p(d),c(f(y,1-v),f(d,v))}if((u=t.times(a-1)).isInteger())return u=u.toNumber(),s=e?n[u]:l(n,u),p(s),s;h=u.floor();var y,d,v=u.minus(h),x=h.toNumber();if(e)y=n[x],d=n[x+1];else for(d=l(n,x+1),y=n[x],g=0;g0&&(y=n[g]);p(y),p(d);var b=new v.constructor(1);return c(f(y,b.minus(v)),f(d,v))}var p=s({"number | BigNumber | Unit":function(r){return r}});return function(r,e,o){var u,s,c;if(arguments.length<2||arguments.length>3)throw new SyntaxError("Function quantileSeq requires two or three parameters");if(a(r)){if("boolean"==typeof(o=o||!1)){if(s=r.valueOf(),i(e)){if(e<0)throw new Error("N/prob must be non-negative");if(e<=1)return h(s,e,o);if(e>1){if(!n(e))throw new Error("N must be a positive integer");var f=e+1;u=new Array(e);for(var l=0;l4294967295)throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");for(f=new t.BigNumber(m+1),u=new Array(m),l=0;l1)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!t.isBigNumber(p))throw new TypeError("Unexpected type of argument in function quantileSeq");if(c=new p.constructor(1),p.isNegative()||p.gt(c))throw new Error("Probability must be between 0 and 1, inclusive")}u[l]=h(s,p,o)}return u}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}}},{"../../utils/array":212,"../../utils/collection/isCollection":220,"../../utils/number":229,"../arithmetic/add":56,"../arithmetic/multiply":76,"../matrix/partitionSelect":103,"../relational/compare":126}],140:[function(r,t,e){"use strict";e.name="std",e.factory=function(t,e,n,i){var o=n(r("../arithmetic/sqrt")),a=n(r("../statistics/var")),u=i("std",{"Array | Matrix":s,"Array | Matrix, string":s,"...":function(r){return s(r)}});return u.toTex=void 0,u;function s(r,t){if(0==r.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");return o(a.apply(null,arguments))}}},{"../arithmetic/sqrt":83,"../statistics/var":142}],141:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepForEach");e.name="sum",e.factory=function(t,e,i,o){var a=i(r("../arithmetic/addScalar")),u=o("sum",{"Array | Matrix":function(r){return s(r)},"Array | Matrix, number | BigNumber":function(){throw new Error("sum(A, dim) is not yet supported")},"...":function(r){return s(r)}});return u.toTex=void 0,u;function s(r){var i=void 0;if(n(r,function(r){i=void 0===i?r:a(i,r)}),void 0===i)switch(e.number){case"number":return 0;case"BigNumber":return new t.BigNumber(0);case"Fraction":return new t.Fraction(0);default:return 0}return i}}},{"../../utils/collection/deepForEach":218,"../arithmetic/addScalar":57}],142:[function(r,t,e){"use strict";var n="unbiased",i=r("../../utils/collection/deepForEach");e.name="var",e.factory=function(t,e,o,a){var u=o(r("../arithmetic/addScalar")),s=o(r("../arithmetic/subtract")),c=o(r("../arithmetic/multiplyScalar")),f=o(r("../arithmetic/divideScalar")),l=a("variance",{"Array | Matrix":function(r){return m(r,n)},"Array | Matrix, string":m,"...":function(r){return m(r,n)}});return l.toTex="\\mathrm{Var}\\left(${args}\\right)",l;function m(r,e){var n=0,o=0;if(0==r.length)throw new SyntaxError("Function var requires one or more parameters (0 provided)");if(i(r,function(r){n=u(n,r),o++}),0===o)throw new Error("Cannot calculate var of an empty array");var a=f(n,o);switch(n=0,i(r,function(r){var t=s(r,a);n=u(n,c(t,t))}),e){case"uncorrected":return f(n,o);case"biased":return f(n,o+1);case"unbiased":var l=t.isBigNumber(n)?new t.BigNumber(0):0;return 1==o?l:f(n,o-1);default:throw new Error('Unknown normalization "'+e+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}}},{"../../utils/collection/deepForEach":218,"../arithmetic/addScalar":57,"../arithmetic/divideScalar":62,"../arithmetic/multiplyScalar":77,"../arithmetic/subtract":85}],143:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="acos",e.factory=function(r,t,e,i){var o=i("acos",{number:function(e){return e>=-1&&e<=1||t.predictable?Math.acos(e):new r.Complex(e,0).acos()},Complex:function(r){return r.acos()},BigNumber:function(r){return r.acos()},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={1:"\\cos^{-1}\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],144:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");var i=Math.acosh||function(r){return Math.log(Math.sqrt(r*r-1)+r)};e.name="acosh",e.factory=function(r,t,e,o){var a=o("acosh",{number:function(e){return e>=1||t.predictable?i(e):e<=-1?new r.Complex(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new r.Complex(e,0).acosh()},Complex:function(r){return r.acosh()},BigNumber:function(r){return r.acosh()},"Array | Matrix":function(r){return n(r,a)}});return a.toTex={1:"\\cosh^{-1}\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219}],145:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="acot",e.factory=function(r,t,e,i){var o=i("acot",{number:function(r){return Math.atan(1/r)},Complex:function(r){return r.acot()},BigNumber:function(t){return new r.BigNumber(1).div(t).atan()},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={1:"\\cot^{-1}\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],146:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="acoth",e.factory=function(r,t,e,i){var o=i("acoth",{number:function(e){return e>=1||e<=-1||t.predictable?isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0:new r.Complex(e,0).acoth()},Complex:function(r){return r.acoth()},BigNumber:function(t){return new r.BigNumber(1).div(t).atanh()},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={1:"\\coth^{-1}\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],147:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="acsc",e.factory=function(r,t,e,i){var o=i("acsc",{number:function(e){return e<=-1||e>=1||t.predictable?Math.asin(1/e):new r.Complex(e,0).acsc()},Complex:function(r){return r.acsc()},BigNumber:function(t){return new r.BigNumber(1).div(t).asin()},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={1:"\\csc^{-1}\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],148:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="acsch",e.factory=function(r,t,e,i){var o=i("acsch",{number:function(r){return r=1/r,Math.log(r+Math.sqrt(r*r+1))},Complex:function(r){return r.acsch()},BigNumber:function(t){return new r.BigNumber(1).div(t).asinh()},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],149:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="asec",e.factory=function(r,t,e,i){var o=i("asec",{number:function(e){return e<=-1||e>=1||t.predictable?Math.acos(1/e):new r.Complex(e,0).asec()},Complex:function(r){return r.asec()},BigNumber:function(t){return new r.BigNumber(1).div(t).acos()},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={1:"\\sec^{-1}\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],150:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="asech",e.factory=function(t,e,i,o){o.find(i(r("./acosh")),["Complex"]);var a=o("asech",{number:function(r){if(r<=1&&r>=-1||e.predictable){r=1/r;var n=Math.sqrt(r*r-1);return r>0||e.predictable?Math.log(n+r):new t.Complex(Math.log(n-r),Math.PI)}return new t.Complex(r,0).asech()},Complex:function(r){return r.asech()},BigNumber:function(r){return new t.BigNumber(1).div(r).acosh()},"Array | Matrix":function(r){return n(r,a)}});return a.toTex={1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219,"./acosh":144}],151:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="asin",e.factory=function(r,t,e,i){var o=i("asin",{number:function(e){return e>=-1&&e<=1||t.predictable?Math.asin(e):new r.Complex(e,0).asin()},Complex:function(r){return r.asin()},BigNumber:function(r){return r.asin()},"Array | Matrix":function(r){return n(r,o,!0)}});return o.toTex={1:"\\sin^{-1}\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],152:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="asinh",e.factory=function(r,t,e,i){var o=i("asinh",{number:Math.asinh||function(r){return Math.log(Math.sqrt(r*r+1)+r)},Complex:function(r){return r.asinh()},BigNumber:function(r){return r.asinh()},"Array | Matrix":function(r){return n(r,o,!0)}});return o.toTex={1:"\\sinh^{-1}\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],153:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="atan",e.factory=function(r,t,e,i){var o=i("atan",{number:function(r){return Math.atan(r)},Complex:function(r){return r.atan()},BigNumber:function(r){return r.atan()},"Array | Matrix":function(r){return n(r,o,!0)}});return o.toTex={1:"\\tan^{-1}\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],154:[function(r,t,e){"use strict";e.name="atan2",e.factory=function(t,e,n,i){var o=n(r("../../type/matrix/function/matrix")),a=n(r("../../type/matrix/utils/algorithm02")),u=n(r("../../type/matrix/utils/algorithm03")),s=n(r("../../type/matrix/utils/algorithm09")),c=n(r("../../type/matrix/utils/algorithm11")),f=n(r("../../type/matrix/utils/algorithm12")),l=n(r("../../type/matrix/utils/algorithm13")),m=n(r("../../type/matrix/utils/algorithm14")),h=i("atan2",{"number, number":Math.atan2,"BigNumber, BigNumber":function(r,e){return t.BigNumber.atan2(r,e)},"Matrix, Matrix":function(r,t){var e;switch(r.storage()){case"sparse":switch(t.storage()){case"sparse":e=s(r,t,h,!1);break;default:e=a(t,r,h,!0)}break;default:switch(t.storage()){case"sparse":e=u(r,t,h,!1);break;default:e=l(r,t,h)}}return e},"Array, Array":function(r,t){return h(o(r),o(t)).valueOf()},"Array, Matrix":function(r,t){return h(o(r),t)},"Matrix, Array":function(r,t){return h(r,o(t))},"Matrix, number | BigNumber":function(r,t){var e;switch(r.storage()){case"sparse":e=c(r,t,h,!1);break;default:e=m(r,t,h,!1)}return e},"number | BigNumber, Matrix":function(r,t){var e;switch(t.storage()){case"sparse":e=f(t,r,h,!0);break;default:e=m(t,r,h,!0)}return e},"Array, number | BigNumber":function(r,t){return m(o(r),t,h,!1).valueOf()},"number | BigNumber, Array":function(r,t){return m(o(t),r,h,!0).valueOf()}});return h.toTex={2:"\\mathrm{atan2}\\left(${args}\\right)"},h}},{"../../type/matrix/function/matrix":195,"../../type/matrix/utils/algorithm02":199,"../../type/matrix/utils/algorithm03":200,"../../type/matrix/utils/algorithm09":205,"../../type/matrix/utils/algorithm11":207,"../../type/matrix/utils/algorithm12":208,"../../type/matrix/utils/algorithm13":209,"../../type/matrix/utils/algorithm14":210}],155:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");var i=Math.atanh||function(r){return Math.log((1+r)/(1-r))/2};e.name="atanh",e.factory=function(r,t,e,o){var a=o("atanh",{number:function(e){return e<=1&&e>=-1||t.predictable?i(e):new r.Complex(e,0).atanh()},Complex:function(r){return r.atanh()},BigNumber:function(r){return r.atanh()},"Array | Matrix":function(r){return n(r,a,!0)}});return a.toTex={1:"\\tanh^{-1}\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219}],156:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="cos",e.factory=function(r,t,e,i){var o=i("cos",{number:Math.cos,Complex:function(r){return r.cos()},BigNumber:function(r){return r.cos()},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cos is no angle");return o(t.value)},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={1:"\\cos\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],157:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");var i=Math.cosh||function(r){return(Math.exp(r)+Math.exp(-r))/2};e.name="cosh",e.factory=function(r,t,e,o){var a=o("cosh",{number:i,Complex:function(r){return r.cosh()},BigNumber:function(r){return r.cosh()},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cosh is no angle");return a(t.value)},"Array | Matrix":function(r){return n(r,a)}});return a.toTex={1:"\\cosh\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219}],158:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="cot",e.factory=function(r,t,e,i){var o=i("cot",{number:function(r){return 1/Math.tan(r)},Complex:function(r){return r.cot()},BigNumber:function(t){return new r.BigNumber(1).div(t.tan())},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return o(t.value)},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={1:"\\cot\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],159:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");function i(r){var t=Math.exp(2*r);return(t+1)/(t-1)}e.name="coth",e.factory=function(r,t,e,o){var a=o("coth",{number:i,Complex:function(r){return r.coth()},BigNumber:function(t){return new r.BigNumber(1).div(t.tanh())},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function coth is no angle");return a(t.value)},"Array | Matrix":function(r){return n(r,a)}});return a.toTex={1:"\\coth\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219}],160:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="csc",e.factory=function(r,t,e,i){var o=i("csc",{number:function(r){return 1/Math.sin(r)},Complex:function(r){return r.csc()},BigNumber:function(t){return new r.BigNumber(1).div(t.sin())},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csc is no angle");return o(t.value)},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={1:"\\csc\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],161:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap"),i=r("../../utils/number").sign;function o(r){return 0==r?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(r)-Math.exp(-r)))*i(r)}e.name="csch",e.factory=function(r,t,e,i){var a=i("csch",{number:o,Complex:function(r){return r.csch()},BigNumber:function(t){return new r.BigNumber(1).div(t.sinh())},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csch is no angle");return a(t.value)},"Array | Matrix":function(r){return n(r,a)}});return a.toTex={1:"\\mathrm{csch}\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219,"../../utils/number":229}],162:[function(r,t,e){"use strict";t.exports=[r("./acos"),r("./acosh"),r("./acot"),r("./acoth"),r("./acsc"),r("./acsch"),r("./asec"),r("./asech"),r("./asin"),r("./asinh"),r("./atan"),r("./atan2"),r("./atanh"),r("./cos"),r("./cosh"),r("./cot"),r("./coth"),r("./csc"),r("./csch"),r("./sec"),r("./sech"),r("./sin"),r("./sinh"),r("./tan"),r("./tanh")]},{"./acos":143,"./acosh":144,"./acot":145,"./acoth":146,"./acsc":147,"./acsch":148,"./asec":149,"./asech":150,"./asin":151,"./asinh":152,"./atan":153,"./atan2":154,"./atanh":155,"./cos":156,"./cosh":157,"./cot":158,"./coth":159,"./csc":160,"./csch":161,"./sec":163,"./sech":164,"./sin":165,"./sinh":166,"./tan":167,"./tanh":168}],163:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="sec",e.factory=function(r,t,e,i){var o=i("sec",{number:function(r){return 1/Math.cos(r)},Complex:function(r){return r.sec()},BigNumber:function(t){return new r.BigNumber(1).div(t.cos())},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sec is no angle");return o(t.value)},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={1:"\\sec\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],164:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");function i(r){return 2/(Math.exp(r)+Math.exp(-r))}e.name="sech",e.factory=function(r,t,e,o){var a=o("sech",{number:i,Complex:function(r){return r.sech()},BigNumber:function(t){return new r.BigNumber(1).div(t.cosh())},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sech is no angle");return a(t.value)},"Array | Matrix":function(r){return n(r,a)}});return a.toTex={1:"\\mathrm{sech}\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219}],165:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="sin",e.factory=function(r,t,e,i){var o=i("sin",{number:Math.sin,Complex:function(r){return r.sin()},BigNumber:function(r){return r.sin()},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sin is no angle");return o(t.value)},"Array | Matrix":function(r){return n(r,o,!0)}});return o.toTex={1:"\\sin\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],166:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");var i=Math.sinh||function(r){return(Math.exp(r)-Math.exp(-r))/2};e.name="sinh",e.factory=function(r,t,e,o){var a=o("sinh",{number:i,Complex:function(r){return r.sinh()},BigNumber:function(r){return r.sinh()},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sinh is no angle");return a(t.value)},"Array | Matrix":function(r){return n(r,a,!0)}});return a.toTex={1:"\\sinh\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219}],167:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="tan",e.factory=function(r,t,e,i){var o=i("tan",{number:Math.tan,Complex:function(r){return r.tan()},BigNumber:function(r){return r.tan()},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tan is no angle");return o(t.value)},"Array | Matrix":function(r){return n(r,o,!0)}});return o.toTex={1:"\\tan\\left(${args[0]}\\right)"},o}},{"../../utils/collection/deepMap":219}],168:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");var i=Math.tanh||function(r){var t=Math.exp(2*r);return(t-1)/(t+1)};e.name="tanh",e.factory=function(r,t,e,o){var a=o("tanh",{number:i,Complex:function(r){return r.tanh()},BigNumber:function(r){return r.tanh()},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tanh is no angle");return a(t.value)},"Array | Matrix":function(r){return n(r,a,!0)}});return a.toTex={1:"\\tanh\\left(${args[0]}\\right)"},a}},{"../../utils/collection/deepMap":219}],169:[function(r,t,e){"use strict";var n=r("../../utils/object");e.name="clone",e.factory=function(r,t,e,i){var o=i("clone",{any:n.clone});return o.toTex=void 0,o}},{"../../utils/object":230}],170:[function(r,t,e){"use strict";t.exports=[r("./clone"),r("./isInteger"),r("./isNegative"),r("./isNumeric"),r("./isPositive"),r("./isPrime"),r("./isZero"),r("./isNaN"),r("./typeof")]},{"./clone":169,"./isInteger":171,"./isNaN":172,"./isNegative":173,"./isNumeric":174,"./isPositive":175,"./isPrime":176,"./isZero":177,"./typeof":178}],171:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap"),i=r("../../utils/number");e.name="isInteger",e.factory=function(r,t,e,o){var a=o("isInteger",{number:i.isInteger,BigNumber:function(r){return r.isInt()},Fraction:function(r){return 1===r.d&&isFinite(r.n)},"Array | Matrix":function(r){return n(r,a)}});return a}},{"../../utils/collection/deepMap":219,"../../utils/number":229}],172:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");r("../../utils/number");e.name="isNaN",e.factory=function(r,t,e,i){return i("isNaN",{number:function(r){return Number.isNaN(r)},BigNumber:function(r){return r.isNaN()},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":function(r){return n(r,Number.isNaN)}})}},{"../../utils/collection/deepMap":219,"../../utils/number":229}],173:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");r("../../utils/number");e.name="isNegative",e.factory=function(r,t,e,i){var o=i("isNegative",{number:function(r){return r<0},BigNumber:function(r){return r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s<0},Unit:function(r){return o(r.value)},"Array | Matrix":function(r){return n(r,o)}});return o}},{"../../utils/collection/deepMap":219,"../../utils/number":229}],174:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");r("../../utils/number");e.name="isNumeric",e.factory=function(r,t,e,i){var o=i("isNumeric",{"number | BigNumber | Fraction | boolean":function(){return!0},"Complex | Unit | string":function(){return!1},"Array | Matrix":function(r){return n(r,o)}});return o}},{"../../utils/collection/deepMap":219,"../../utils/number":229}],175:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");r("../../utils/number");e.name="isPositive",e.factory=function(r,t,e,i){var o=i("isPositive",{number:function(r){return r>0},BigNumber:function(r){return!r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s>0&&r.n>0},Unit:function(r){return o(r.value)},"Array | Matrix":function(r){return n(r,o)}});return o}},{"../../utils/collection/deepMap":219,"../../utils/number":229}],176:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");e.name="isPrime",e.factory=function(r,t,e,i){var o=i("isPrime",{number:function(r){if(r<2)return!1;if(2==r)return!0;if(r%2==0)return!1;for(var t=3;t*t<=r;t+=2)if(r%t==0)return!1;return!0},BigNumber:function(t){if(t.lt(2))return!1;if(t.equals(2))return!0;if(t.mod(2).isZero())return!1;for(var e=r.BigNumber(3);e.times(e).lte(t);e=e.plus(1))if(t.mod(e).isZero())return!1;return!0},"Array | Matrix":function(r){return n(r,o)}});return o}},{"../../utils/collection/deepMap":219}],177:[function(r,t,e){"use strict";var n=r("../../utils/collection/deepMap");r("../../utils/number");e.name="isZero",e.factory=function(r,t,e,i){var o=i("isZero",{number:function(r){return 0===r},BigNumber:function(r){return r.isZero()},Complex:function(r){return 0===r.re&&0===r.im},Fraction:function(r){return 1===r.d&&0===r.n},Unit:function(r){return o(r.value)},"Array | Matrix":function(r){return n(r,o)}});return o}},{"../../utils/collection/deepMap":219,"../../utils/number":229}],178:[function(r,t,e){"use strict";var n=r("../../utils/types");e.name="typeof",e.factory=function(r,t,e,i){var o=i("_typeof",{any:function(t){var e=n.type(t);if("Object"===e){if(r.isBigNumber(t))return"BigNumber";if(r.isComplex(t))return"Complex";if(r.isFraction(t))return"Fraction";if(r.isMatrix(t))return"Matrix";if(r.isUnit(t))return"Unit";if(r.isIndex(t))return"Index";if(r.isRange(t))return"Range";if(r.isChain(t))return"Chain";if(r.isHelp(t))return"Help"}return e}});return o.toTex=void 0,o}},{"../../utils/types":232}],179:[function(r,t,e){"use strict";var n=r("decimal.js/decimal.js");e.name="BigNumber",e.path="type",e.factory=function(r,t,e,i,o){var a=n.clone({precision:t.precision});return a.prototype.type="BigNumber",a.prototype.isBigNumber=!0,a.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},a.fromJSON=function(r){return new a(r.value)},o.on("config",function(r,t){r.precision!==t.precision&&a.config({precision:r.precision})}),a},e.math=!0},{"decimal.js/decimal.js":40}],180:[function(r,t,e){"use strict";var n=r("../../../utils/collection/deepMap");e.name="bignumber",e.factory=function(r,t,e,i){var o=i("bignumber",{"":function(){return new r.BigNumber(0)},number:function(t){return new r.BigNumber(t+"")},string:function(t){return new r.BigNumber(t)},BigNumber:function(r){return r},Fraction:function(t){return new r.BigNumber(t.n).div(t.d)},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={0:"0",1:"\\left(${args[0]}\\right)"},o}},{"../../../utils/collection/deepMap":219}],181:[function(r,t,e){"use strict";t.exports=[r("./BigNumber"),r("./function/bignumber")]},{"./BigNumber":179,"./function/bignumber":180}],182:[function(r,t,e){"use strict";function n(r){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var i=r("complex.js"),o=r("../../utils/number").format,a=r("../../utils/number").isNumber;e.name="Complex",e.path="type",e.factory=function(r,t,e,u,s){return i.prototype.type="Complex",i.prototype.isComplex=!0,i.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},i.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},i.prototype.format=function(r){var t=this.im,e=this.re,n=o(this.re,r),i=o(this.im,r),u=a(r)?r:r?r.precision:null;if(null!==u){var s=Math.pow(10,-u);Math.abs(e/t)t.re?1:r.ret.im?1:r.im");var p=e.max().map(function(r){return r+1});v(r,p,o);var g=c.length;!function r(t,e,n,i,o){var a=o===i-1,u=e.dimension(o);a?u.forEach(function(r,e){h(r),t[r]=n[e[0]]}):u.forEach(function(a,u){h(a),r(t[a],e,n[u[0]],i,o+1)})}(r._data,e,n,g,0)}return r}(this,r,e,n);default:throw new SyntaxError("Wrong number of arguments")}},y.prototype.get=function(r){if(!c(r))throw new TypeError("Array expected");if(r.length!=this._size.length)throw new i(r.length,this._size.length);for(var t=0;tn[o]&&(n[o]=t[o],i=!0);i&&d(r,n,e)}return y.prototype.reshape=function(r,t){var e=t?this.clone():this;return e._data=a.reshape(e._data,r),e._size=r.slice(0),e},y.prototype.clone=function(){return new y({data:u.clone(this._data),size:u.clone(this._size),datatype:this._datatype})},y.prototype.size=function(){return this._size.slice(0)},y.prototype.map=function(r){var t=this;return new y({data:function e(n,i){return c(n)?n.map(function(r,t){return e(r,i.concat(t))}):r(n,i,t)}(this._data,[]),size:u.clone(this._size),datatype:this._datatype})},y.prototype.forEach=function(r){var t=this;!function e(n,i){c(n)?n.forEach(function(r,t){e(r,i.concat(t))}):r(n,i,t)}(this._data,[])},y.prototype.toArray=function(){return u.clone(this._data)},y.prototype.valueOf=function(){return this._data},y.prototype.format=function(r){return o.format(this._data,r)},y.prototype.toString=function(){return o.format(this._data)},y.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},y.prototype.diagonal=function(r){if(r){if(t.isBigNumber(r)&&(r=r.toNumber()),!f(r)||!l(r))throw new TypeError("The parameter k must be an integer number")}else r=0;for(var e=r>0?r:0,n=r<0?-r:0,i=this._size[0],o=this._size[1],a=Math.min(i-n,o-e),u=[],s=0;s0?n:0,h=n<0?-n:0,g=r[0],d=r[1],v=Math.min(g-h,d-s);if(c(e)){if(e.length!==v)throw new Error("Invalid value array length");u=function(r){return e[r]}}else if(t.isMatrix(e)){var x=e.size();if(1!==x.length||x[0]!==v)throw new Error("Invalid matrix length");u=function(r){return e.get([r])}}else u=function(){return e};i||(i=t.isBigNumber(u(0))?new t.BigNumber(0):0);var b=[];if(r.length>0){b=a.resize(b,r,i);for(var w=0;w0;){var i=n.right;n.left.right=n.right,n.right.left=n.left,n.left=t,n.right=t.right,t.right=n,n.right.left=n,n.parent=null,n=i,e--}return r.left.right=r.right,r.right.left=r.left,r==r.right?t=null:(t=r.right,t=m(t,this._size)),this._size--,this._minimum=t,r},s.prototype.remove=function(r){this._minimum=c(this._minimum,r,-1),this.extractMinimum()};var c=function(r,t,e){t.key=e;var n=t.parent;return n&&o(t.key,n.key)&&(f(r,t,n),l(r,n)),o(t.key,r.key)&&(r=t),r},f=function(r,t,e){t.left.right=t.right,t.right.left=t.left,e.degree--,e.child==t&&(e.child=t.right),0===e.degree&&(e.child=null),t.left=r,t.right=r.right,r.right=t,t.right.left=t,t.parent=null,t.mark=!1},l=function r(t,e){var n=e.parent;n&&(e.mark?(f(t,e,n),r(n)):e.mark=!0)},m=function(r,t){var e,n,i,s=Math.floor(Math.log(t)*u)+1,c=new Array(s),f=0,l=r;if(l)for(f++,l=l.right;l!==r;)f++,l=l.right;for(;f>0;){for(var m=l.degree,h=l.right;e=c[m];){if(a(l.key,e.key)){var p=e;e=l,l=p}i=l,(n=e).left.right=n.right,n.right.left=n.left,n.parent=i,i.child?(n.left=i.child,n.right=i.child.right,i.child.right=n,n.right.left=n):(i.child=n,n.right=n,n.left=n),i.degree++,n.mark=!1,c[m]=null,m++}c[m]=l,l=h,f--}r=null;for(var g=0;g0?this.step>0?this.start:this.start+(r-1)*this.step:void 0},o.prototype.max=function(){var r=this.size()[0];return r>0?this.step>0?this.start+(r-1)*this.step:this.start:void 0},o.prototype.forEach=function(r){var t=this.start,e=this.step,n=this.end,i=0;if(e>0)for(;tn;)r(t,[i],this),t+=e,i++},o.prototype.map=function(r){var t=[];return this.forEach(function(e,n,i){t[n[0]]=r(e,n,i)}),t},o.prototype.toArray=function(){var r=[];return this.forEach(function(t,e){r[e[0]]=t}),r},o.prototype.valueOf=function(){return this.toArray()},o.prototype.format=function(r){var t=n.format(this.start,r);return 1!=this.step&&(t+=":"+n.format(this.step,r)),t+=":"+n.format(this.end,r)},o.prototype.toString=function(){return this.format()},o.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},o.fromJSON=function(r){return new o(r.start,r.end,r.step)},o}},{"../../utils/number":229}],192:[function(r,t,e){"use strict";e.name="Spa",e.path="type",e.factory=function(t,e,n){var i=n(r("../../function/arithmetic/add")),o=n(r("../../function/relational/equalScalar"));function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new t.FibonacciHeap}return a.prototype.type="Spa",a.prototype.isSpa=!0,a.prototype.set=function(r,t){if(this._values[r])this._values[r].value=t;else{var e=this._heap.insert(r,t);this._values[r]=e}},a.prototype.get=function(r){var t=this._values[r];return t?t.value:0},a.prototype.accumulate=function(r,t){var e=this._values[r];e?e.value=i(e.value,t):(e=this._heap.insert(r,t),this._values[r]=e)},a.prototype.forEach=function(r,t,e){var n=this._heap,i=this._values,a=[],u=n.extractMinimum();for(u&&a.push(u);u&&u.key<=t;)u.key>=r&&(o(u.value,0)||e(u.key,u.value,this)),(u=n.extractMinimum())&&a.push(u);for(var s=0;s0){var u=0;do{r._ptr.push(r._index.length);for(var s=0;s");for(var h=e.min()[0],p=e.min()[1],g=s[0],y=s[1],d=0;da-1||o>u-1)&&(E(this,Math.max(n+1,a),Math.max(o+1,u),e),a=this._size[0],u=this._size[1]),h(n,a),h(o,u);var l=A(n,this._ptr[o],this._ptr[o+1],this._index);return lh){for(s=h;sl){if(f){var p=0;for(s=0;st-1&&(r._values.splice(c,1),r._index.splice(c,1),v++)}r._ptr[s]=r._values.length}return r._size[0]=t,r._size[1]=e,r};v.prototype.reshape=function(r,t){if(!c(r))throw new TypeError("Array expected");if(2!==r.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");if(r.forEach(function(t){if(!s.isNumber(t)||!s.isInteger(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+u.format(r)+")")}),this._size[0]*this._size[1]!=r[0]*r[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var e=t?this.clone():this;if(this._size[0]===r[0]&&this._size[1]===r[1])return e;for(var n=[],i=0;i=t&&M<=e){if(!a)for(var A=b;A "+(this._values?u.format(this._values[c],r):"X")}return i},v.prototype.toString=function(){return u.format(this.toArray())},v.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},v.prototype.diagonal=function(r){if(r){if(t.isBigNumber(r)&&(r=r.toNumber()),!f(r)||!l(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var e=r>0?r:0,n=r<0?-r:0,i=this._size[0],o=this._size[1],a=Math.min(i-n,o-e),u=[],s=[],c=[];c[0]=0;for(var m=e;m0?n:0,p=n<0?-n:0,y=r[0],x=r[1],b=Math.min(y-p,x-h);if(c(e)){if(e.length!==b)throw new Error("Invalid value array length");s=function(r){return e[r]}}else if(t.isMatrix(e)){var w=e.size();if(1!==w.length||w[0]!==b)throw new Error("Invalid matrix length");s=function(r){return e.get([r])}}else s=function(){return e};for(var M=[],A=[],N=[],_=0;_=0&&E=s||i[f]!==t)){var m=n?n[c]:void 0;i.splice(f,0,t),n&&n.splice(f,0,m),i.splice(f<=c?c+1:c,1),n&&n.splice(f<=c?c+1:c,1)}else if(f=s||i[c]!==r)){var h=n?n[f]:void 0;i.splice(c,0,r),n&&n.splice(c,0,h),i.splice(c<=f?f+1:f,1),n&&n.splice(c<=f?f+1:f,1)}}},t.Matrix._storage.sparse=v,v},e.lazy=!1},{"../../error/DimensionError":53,"../../function/relational/equalScalar":128,"../../utils/index":227,"./Matrix":189}],194:[function(r,t,e){"use strict";e.name="index",e.factory=function(r,t,e,n){return n("index",{"...number | string | BigNumber | Range | Array | Matrix":function(t){var e=t.map(function(t){return r.isBigNumber(t)?t.toNumber():Array.isArray(t)||r.isMatrix(t)?t.map(function(t){return r.isBigNumber(t)?t.toNumber():t}):t}),n=new r.Index;return r.Index.apply(n,e),n}})}},{}],195:[function(r,t,e){"use strict";e.name="matrix",e.factory=function(r,t,e,n){var i=n("matrix",{"":function(){return o([])},string:function(r){return o([],r)},"string, string":function(r,t){return o([],r,t)},Array:function(r){return o(r)},Matrix:function(r){return o(r,r.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});return i.toTex={0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},i;function o(t,e,n){return new(r.Matrix.storage(e||"default"))(t,n)}}},{}],196:[function(r,t,e){"use strict";e.name="sparse",e.factory=function(r,t,e,n){var i=r.SparseMatrix,o=n("sparse",{"":function(){return new i([])},string:function(r){return new i([],r)},"Array | Matrix":function(r){return new i(r)},"Array | Matrix, string":function(r,t){return new i(r,t)}});return o.toTex={0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},o}},{}],197:[function(r,t,e){"use strict";t.exports=[r("./Matrix"),r("./DenseMatrix"),r("./SparseMatrix"),r("./Spa"),r("./FibonacciHeap"),r("./ImmutableDenseMatrix"),r("./MatrixIndex"),r("./Range"),r("./function/index"),r("./function/matrix"),r("./function/sparse")]},{"./DenseMatrix":186,"./FibonacciHeap":187,"./ImmutableDenseMatrix":188,"./Matrix":189,"./MatrixIndex":190,"./Range":191,"./Spa":192,"./SparseMatrix":193,"./function/index":194,"./function/matrix":195,"./function/sparse":196}],198:[function(r,t,e){"use strict";var n=r("../../../error/DimensionError");e.name="algorithm01",e.factory=function(r,t,e,i){var o=r.DenseMatrix;return function(r,t,e,a){var u=r._data,s=r._size,c=r._datatype,f=t._values,l=t._index,m=t._ptr,h=t._size,p=t._datatype;if(s.length!==h.length)throw new n(s.length,h.length);if(s[0]!==h[0]||s[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+h+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g,y,d=s[0],v=s[1],x="string"==typeof c&&c===p?c:void 0,b=x?i.find(e,[x,x]):e,w=[];for(g=0;g0?a(y,0,p,p[0],s,l):[];return new o({data:d,size:p,datatype:u})}}},{"../../../error/DimensionError":53,"../../../utils/index":227}],210:[function(r,t,e){"use strict";var n=r("../../../utils/object").clone;e.name="algorithm14",e.factory=function(r,t,e,i){var o=r.DenseMatrix,a=function r(t,e,n,i,o,a,u){var s=[];if(e===n.length-1)for(var c=0;c0?a(m,0,f,f[0],c,t,u):[];return new o({data:h,size:n(f),datatype:s})}}},{"../../../utils/object":230}],211:[function(r,t,e){"use strict";var n=r("./../utils/collection/deepMap");e.name="number",e.factory=function(r,t,e,i){var o=i("number",{"":function(){return 0},number:function(r){return r},string:function(r){var t=Number(r);if(isNaN(t))throw new SyntaxError('String "'+r+'" is no valid number');return t},BigNumber:function(r){return r.toNumber()},Fraction:function(r){return r.valueOf()},Unit:function(r){throw new Error("Second argument with valueless unit expected")},"Unit, string | Unit":function(r,t){return r.toNumber(t)},"Array | Matrix":function(r){return n(r,o)}});return o.toTex={0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},o}},{"./../utils/collection/deepMap":219}],212:[function(r,t,e){"use strict";var n=r("./number"),i=r("./string"),o=(r("./object"),r("./types"),r("../error/DimensionError")),a=r("../error/IndexError");e.size=function(r){for(var t=[];Array.isArray(r);)t.push(r.length),r=r[0];return t},e.validate=function(r,t){if(0==t.length){if(Array.isArray(r))throw new o(r.length,0)}else!function r(t,e,n){var i,a=t.length;if(a!=e[n])throw new o(a,e[n]);if(n")}(r,t,0)},e.validateIndex=function(r,t){if(!n.isNumber(r)||!n.isInteger(r))throw new TypeError("Index must be an integer (value: "+r+")");if(r<0||"number"==typeof t&&r>=t)throw new a(r,t)},e.UNINITIALIZED={},e.resize=function(r,t,o){if(!Array.isArray(r)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");return t.forEach(function(r){if(!n.isNumber(r)||!n.isInteger(r)||r<0)throw new TypeError("Invalid size, must contain positive integers (size: "+i.format(t)+")")}),function r(t,n,i,o){var a;var u;var s=t.length;var c=n[i];var f=Math.min(s,c);t.length=c;if(i=u.length)throw new o(t,u.length);return i(r)?r.create(a(r.valueOf(),t,e)):a(r,t,e)}},{"../../error/IndexError":54,"../array":212,"../collection/isMatrix":221}],223:[function(r,t,e){"use strict";t.exports=function(r,t,e,n,i,o,a,u,s,c,f){var l,m,h,p,g=r._values,y=r._index,d=r._ptr,v=a._index;if(n)for(m=d[t],h=d[t+1],l=m;l>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},e.defaultTemplate="\\mathrm{${name}}\\left(${args}\\right)";var i={deg:"^\\circ"};e.escape=function(r){return n(r,{preserveFormatting:!0})},e.toSymbol=function(r,t){return(t=void 0!==t&&t)?i.hasOwnProperty(r)?i[r]:"\\mathrm{"+e.escape(r)+"}":e.symbols.hasOwnProperty(r)?e.symbols[r]:e.escape(r)}},{"escape-latex":43}],229:[function(r,t,e){"use strict";function n(r){for(var t=[],e=0;e0?1:r<0?-1:0},e.format=function(r,t){if("function"==typeof t)return t(r);if(r===1/0)return"Infinity";if(r===-1/0)return"-Infinity";if(isNaN(r))return"NaN";var n="auto",i=void 0;switch(t&&(t.notation&&(n=t.notation),e.isNumber(t)?i=t:t.precision&&(i=t.precision)),n){case"fixed":return e.toFixed(r,i);case"exponential":return e.toExponential(r,i);case"engineering":return e.toEngineering(r,i);case"auto":return e.toPrecision(r,i,t&&t.exponential).replace(/((\.\d*?)(0+))($|e)/,function(){var r=arguments[2],t=arguments[4];return"."!==r?r+t:t});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", or "fixed".')}},e.splitNumber=function(r){var t=String(r).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+r);var e=t[1],n=t[2],i=parseFloat(t[4]||"0"),o=n.indexOf(".");i+=-1!==o?o-1:n.length-1;var a=n.replace(".","").replace(/^0*/,function(r){return i-=r.length,""}).replace(/0*$/,"").split("").map(function(r){return parseInt(r)});return 0===a.length&&(a.push(0),i++),{sign:e,coefficients:a,exponent:i}},e.toEngineering=function(r,t){if(isNaN(r)||!isFinite(r))return String(r);var i=e.roundDigits(e.splitNumber(r),t),o=i.exponent,a=i.coefficients,u=o%3==0?o:o<0?o-3-o%3:o-o%3,s=o>=0?o:Math.abs(u);a.length-1=0;)f++;var l=a.slice(f).join(""),m=l.match(/[1-9]/)?"."+l:"",h=a.slice(0,f).join("")+m+"e"+(o>=0?"+":"")+u.toString();return i.sign+h},e.toFixed=function(r,t){if(isNaN(r)||!isFinite(r))return String(r);var i=e.splitNumber(r),o=e.roundDigits(i,i.exponent+1+(t||0)),a=o.coefficients,u=o.exponent+1,s=u+(t||0);return a.length0?"."+a.join(""):"")+"e"+(u>=0?"+":"")+u},e.toPrecision=function(r,t,i){if(isNaN(r)||!isFinite(r))return String(r);var o=i&&void 0!==i.lower?i.lower:.001,a=i&&void 0!==i.upper?i.upper:1e5,u=e.splitNumber(r),s=Math.abs(Math.pow(10,u.exponent));if(s=a)return e.toExponential(r,t);var c=t?e.roundDigits(u,t):u,f=c.coefficients,l=c.exponent;f.length0?l:0;return m<(f=n(-l).concat(f)).length-1&&f.splice(m+1,0,"."),c.sign+f.join("")},e.roundDigits=function(r,t){for(var e={sign:r.sign,coefficients:r.coefficients,exponent:r.exponent},n=e.coefficients;t<=0;)n.unshift(0),e.exponent++,t++;if(n.length>t&&n.splice(t,n.length-t)[0]>=5){var i=t-1;for(n[i]++;10===n[i];)n.pop(),0===i&&(n.unshift(0),e.exponent++,i++),n[--i]++}return e},e.digits=function(r){return r.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length},e.DBL_EPSILON=Number.EPSILON||2.220446049250313e-16,e.nearlyEqual=function(r,t,n){if(null==n)return r==t;if(r==t)return!0;if(isNaN(r)||isNaN(t))return!1;if(isFinite(r)&&isFinite(t)){var i=Math.abs(r-t);return i/g,">")}},{"./bignumber/formatter":213,"./bignumber/isBigNumber":214,"./number":229}],232:[function(r,t,e){"use strict";function n(r){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}e.type=function(r){var t=n(r);return"object"===t?null===r?"null":Array.isArray(r)?"Array":r instanceof Date?"Date":r instanceof RegExp?"RegExp":r instanceof Boolean?"boolean":r instanceof Number?"number":r instanceof String?"string":"Object":"function"===t?"Function":t}},{}],233:[function(require,module,exports){(function(global){"use strict";function _typeof(r){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var numeric=void 0===exports?function(){}:exports;void 0!==global&&(global.numeric=numeric),numeric.version="1.2.6",numeric.bench=function(r,t){var e,n,i;for(void 0===t&&(t=15),n=.5,e=new Date;;){for(i=n*=2;i>3;i-=4)r(),r(),r(),r();for(;i>0;)r(),i--;if(new Date-e>t)break}for(i=n;i>3;i-=4)r(),r(),r(),r();for(;i>0;)r(),i--;return 1e3*(3*n-1)/(new Date-e)},numeric._myIndexOf=function(r){var t,e=this.length;for(t=0;tnumeric.largeArray)return t.push("...Large Array..."),!0;for(s=!1,t.push("["),n=0;n0&&(t.push(","),s&&t.push("\n ")),s=r(e[n]);return t.push("]"),!0}t.push("{");s=!1;for(n in e)e.hasOwnProperty(n)&&(s&&t.push(",\n"),s=!0,t.push(n),t.push(": \n"),r(e[n]));return t.push("}"),!0}(r),t.join("")},numeric.parseDate=function(r){return function r(t){if("string"==typeof t)return Date.parse(t.replace(/-/g,"/"));if(!(t instanceof Array))throw new Error("parseDate: parameter must be arrays of strings");var e,n=[];for(e=0;e0){for(o[s]=[],t=0;t>>8^i[255&(o^r[n])];return-1^o}var e,n,i,o,a,u,s,c,f,l,m=r[0].length,h=r[0][0].length,p=[137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,h>>24&255,h>>16&255,h>>8&255,255&h,m>>24&255,m>>16&255,m>>8&255,255&m,8,2,0,0,0,-1,-2,-3,-4,-5,-6,-7,-8,73,68,65,84,8,29];for(l=t(p,12,29),p[29]=l>>24&255,p[30]=l>>16&255,p[31]=l>>8&255,p[32]=255&l,e=1,n=0,s=0;s>8&255,p.push(a),p.push(u),p.push(255&~a),p.push(255&~u),0===s&&p.push(0),c=0;c255?255:a<0?0:Math.round(a)))%65521))%65521,p.push(a);p.push(0)}return f=(n<<16)+e,p.push(f>>24&255),p.push(f>>16&255),p.push(f>>8&255),p.push(255&f),o=p.length-41,p[33]=o>>24&255,p[34]=o>>16&255,p[35]=o>>8&255,p[36]=255&o,l=t(p,37),p.push(l>>24&255),p.push(l>>16&255),p.push(l>>8&255),p.push(255&l),p.push(0),p.push(0),p.push(0),p.push(0),p.push(73),p.push(69),p.push(78),p.push(68),p.push(174),p.push(66),p.push(96),p.push(130),"data:image/png;base64,"+function(r){var t,e,n,i,o,a,u,s=r.length,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="";for(t=0;t>4),a=((15&n)<<2)+((i=r[t+2])>>6),u=63&i,t+1>=s?a=u=64:t+2>=s&&(u=64),f+=c.charAt(e>>2)+c.charAt(o)+c.charAt(a)+c.charAt(u);return f}(p)},numeric._dim=function(r){for(var t=[];"object"===_typeof(r);)t.push(r.length),r=r[0];return t},numeric.dim=function(r){var t;return"object"===_typeof(r)?"object"===_typeof(t=r[0])?"object"===_typeof(t[0])?numeric._dim(r):[r.length,t.length]:[r.length]:[]},numeric.mapreduce=function(r,t){return Function("x","accum","_s","_k",'if(typeof accum === "undefined") accum = '+t+';\nif(typeof x === "number") { var xi = x; '+r+'; return accum; }\nif(typeof _s === "undefined") _s = numeric.dim(x);\nif(typeof _k === "undefined") _k = 0;\nvar _n = _s[_k];\nvar i,xi;\nif(_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}\nfor(i=_n-1;i>=1;i-=2) { \n xi = x[i];\n '+r+";\n xi = x[i-1];\n "+r+";\n}\nif(i === 0) {\n xi = x[i];\n "+r+"\n}\nreturn accum;")},numeric.mapreduce2=function(r,t){return Function("x","var n = x.length;\nvar i,xi;\n"+t+";\nfor(i=n-1;i!==-1;--i) { \n xi = x[i];\n "+r+";\n}\nreturn accum;")},numeric.same=function r(t,e){var n,i;if(!(t instanceof Array&&e instanceof Array))return!1;if((i=t.length)!==e.length)return!1;for(n=0;n=0;n-=2)o[n+1]=t,o[n]=t;return-1===n&&(o[0]=t),o}for(n=i-1;n>=0;n--)o[n]=numeric.rep(r,t,e+1);return o},numeric.dotMMsmall=function(r,t){var e,n,i,o,a,u,s,c,f,l,m;for(o=r.length,a=t.length,u=t[0].length,s=Array(o),e=o-1;e>=0;e--){for(c=Array(u),f=r[e],i=u-1;i>=0;i--){for(l=f[a-1]*t[a-1][i],n=a-2;n>=1;n-=2)m=n-1,l+=f[n]*t[n][i]+f[m]*t[m][i];0===n&&(l+=f[0]*t[0][i]),c[i]=l}s[e]=c}return s},numeric._getCol=function(r,t,e){var n;for(n=r.length-1;n>0;--n)e[n]=r[n][t],e[--n]=r[n][t];0===n&&(e[0]=r[0][t])},numeric.dotMMbig=function(r,t){var e,n,i,o=numeric._getCol,a=t.length,u=Array(a),s=r.length,c=t[0].length,f=new Array(s),l=numeric.dotVV;for(--a,n=--s;-1!==n;--n)f[n]=Array(c);for(n=--c;-1!==n;--n)for(o(t,n,u),i=s;-1!==i;--i)0,e=r[i],f[i][n]=l(e,u);return f},numeric.dotMV=function(r,t){var e,n=r.length,i=(t.length,Array(n)),o=numeric.dotVV;for(e=n-1;e>=0;e--)i[e]=o(r[e],t);return i},numeric.dotVM=function(r,t){var e,n,i,o,a,u,s;for(i=r.length,o=t[0].length,a=Array(o),n=o-1;n>=0;n--){for(u=r[i-1]*t[i-1][n],e=i-2;e>=1;e-=2)s=e-1,u+=r[e]*t[e][n]+r[s]*t[s][n];0===e&&(u+=r[0]*t[0][n]),a[n]=u}return a},numeric.dotVV=function(r,t){var e,n,i=r.length,o=r[i-1]*t[i-1];for(e=i-2;e>=1;e-=2)n=e-1,o+=r[e]*t[e]+r[n]*t[n];return 0===e&&(o+=r[0]*t[0]),o},numeric.dot=function(r,t){var e=numeric.dim;switch(1e3*e(r).length+e(t).length){case 2002:return t.length<10?numeric.dotMMsmall(r,t):numeric.dotMMbig(r,t);case 2001:return numeric.dotMV(r,t);case 1002:return numeric.dotVM(r,t);case 1001:return numeric.dotVV(r,t);case 1e3:return numeric.mulVS(r,t);case 1:return numeric.mulSV(r,t);case 0:return r*t;default:throw new Error("numeric.dot only works on vectors and matrices")}},numeric.diag=function(r){var t,e,n,i,o=r.length,a=Array(o);for(t=o-1;t>=0;t--){for(i=Array(o),e=t+2,n=o-1;n>=e;n-=2)i[n]=0,i[n-1]=0;for(n>t&&(i[n]=0),i[t]=r[t],n=t-1;n>=1;n-=2)i[n]=0,i[n-1]=0;0===n&&(i[0]=0),a[t]=i}return a},numeric.getDiag=function(r){var t,e=Math.min(r.length,r[0].length),n=Array(e);for(t=e-1;t>=1;--t)n[t]=r[t][t],n[--t]=r[t][t];return 0===t&&(n[0]=r[0][0]),n},numeric.identity=function(r){return numeric.diag(numeric.rep([r],1))},numeric.pointwise=function(r,t,e){void 0===e&&(e="");var n,i,o=[],a=/\[i\]$/,u="",s=!1;for(n=0;n=0;i--) ret[i] = arguments.callee("+r.join(",")+",_s,_k+1);\n return ret;\n}\n"+e+"\nfor(i=_n-1;i!==-1;--i) {\n "+t+"\n}\nreturn ret;",Function.apply(null,o)},numeric.pointwise2=function(r,t,e){void 0===e&&(e="");var n,i,o=[],a=/\[i\]$/,u="",s=!1;for(n=0;n=0;a--)r("object"===_typeof(t)?t[a]:t,"object"===_typeof(e)?e[a]:e,n,i+1,o);else o(t,e)},numeric._biforeach2=function r(t,e,n,i,o){if(i===n.length-1)return o(t,e);var a,u=n[i],s=Array(u);for(a=u-1;a>=0;--a)s[a]=r("object"===_typeof(t)?t[a]:t,"object"===_typeof(e)?e[a]:e,n,i+1,o);return s},numeric._foreach=function r(t,e,n,i){var o;if(n!==e.length-1)for(o=e[n]-1;o>=0;o--)r(t[o],e,n+1,i);else i(t)},numeric._foreach2=function r(t,e,n,i){if(n===e.length-1)return i(t);var o,a=e[n],u=Array(a);for(o=a-1;o>=0;o--)u[o]=r(t[o],e,n+1,i);return u},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 r,t;for(r=0;rg&&(p=o,g=u);for(e=m[p],m[p]=m[a],m[a]=e,i=h[p],h[p]=h[a],h[a]=i,r=e[a],u=a;u!==l;++u)e[u]/=r;for(u=l-1;-1!==u;--u)i[u]/=r;for(o=f-1;-1!==o;--o)if(o!==a){for(t=m[o],n=h[o],r=t[a],u=a+1;u!==l;++u)t[u]-=e[u]*r;for(u=l-1;u>0;--u)n[u]-=i[u]*r,n[--u]-=i[u]*r;0===u&&(n[0]-=i[0]*r)}}return h},numeric.det=function(r){var t=numeric.dim(r);if(2!==t.length||t[0]!==t[1])throw new Error("numeric: det() only works on square matrices");var e,n,i,o,a,u,s,c,f=t[0],l=1,m=numeric.clone(r);for(n=0;nMath.abs(m[i][n])&&(i=e);for(i!==n&&(s=m[i],m[i]=m[n],m[n]=s,l*=-1),o=m[n],e=n+1;e=1;t-=2){for(i=r[t],n=r[t-1],e=u-1;e>=1;--e)(o=s[e])[t]=i[e],o[t-1]=n[e],(o=s[--e])[t]=i[e],o[t-1]=n[e];0===e&&((o=s[0])[t]=i[0],o[t-1]=n[0])}if(0===t){for(n=r[0],e=u-1;e>=1;--e)s[e][0]=n[e],s[--e][0]=n[e];0===e&&(s[0][0]=n[0])}return s},numeric.negtranspose=function(r){var t,e,n,i,o,a=r.length,u=r[0].length,s=Array(u);for(e=0;e=1;t-=2){for(i=r[t],n=r[t-1],e=u-1;e>=1;--e)(o=s[e])[t]=-i[e],o[t-1]=-n[e],(o=s[--e])[t]=-i[e],o[t-1]=-n[e];0===e&&((o=s[0])[t]=-i[0],o[t-1]=-n[0])}if(0===t){for(n=r[0],e=u-1;e>=1;--e)s[e][0]=-n[e],s[--e][0]=-n[e];0===e&&(s[0][0]=-n[0])}return s},numeric._random=function r(t,e){var n,i,o=t[e],a=Array(o);if(e===t.length-1){for(i=Math.random,n=o-1;n>=1;n-=2)a[n]=i(),a[n-1]=i();return 0===n&&(a[0]=i()),a}for(n=o-1;n>=0;n--)a[n]=r(t,e+1);return a},numeric.random=function(r){return numeric._random(r,0)},numeric.norm2=function(r){return Math.sqrt(numeric.norm2Squared(r))},numeric.linspace=function(r,t,e){if(void 0===e&&(e=Math.max(Math.round(t-r)+1,1)),e<2)return 1===e?[r]:[];var n,i=Array(e);for(n=--e;n>=0;n--)i[n]=(n*t+(e-n)*r)/e;return i},numeric.getBlock=function(r,t,e){var n=numeric.dim(r);return function r(i,o){var a,u=t[o],s=e[o]-u,c=Array(s);if(o===n.length-1){for(a=s;a>=0;a--)c[a]=i[a+u];return c}for(a=s;a>=0;a--)c[a]=r(i[a+u],o+1);return c}(r,0)},numeric.setBlock=function(r,t,e,n){var i=numeric.dim(r);return function r(n,o,a){var u,s=t[a],c=e[a]-s;if(a===i.length-1)for(u=c;u>=0;u--)n[u+s]=o[u];for(u=c;u>=0;u--)r(n[u+s],o[u],a+1)}(r,n,0),r},numeric.getRange=function(r,t,e){var n,i,o,a,u=t.length,s=e.length,c=Array(u);for(n=u-1;-1!==n;--n)for(c[n]=Array(s),o=c[n],a=r[t[n]],i=s-1;-1!==i;--i)o[i]=a[e[i]];return c},numeric.blockMatrix=function(r){var t=numeric.dim(r);if(t.length<4)return numeric.blockMatrix([r]);var e,n,i,o,a,u=t[0],s=t[1];for(e=0,n=0,i=0;i=0;o--){for(i=Array(c),u=r[o],a=c-1;a>=3;--a)i[a]=u*t[a],i[--a]=u*t[a],i[--a]=u*t[a],i[--a]=u*t[a];for(;a>=0;)i[a]=u*t[a],--a;f[o]=i}return f},numeric.T=function(r,t){this.x=r,this.y=t},numeric.t=function(r,t){return new numeric.T(r,t)},numeric.Tbinop=function(r,t,e,n,i){var o;numeric.indexOf;if("string"!=typeof i)for(o in i="",numeric)numeric.hasOwnProperty(o)&&(r.indexOf(o)>=0||t.indexOf(o)>=0||e.indexOf(o)>=0||n.indexOf(o)>=0)&&o.length>1&&(i+="var "+o+" = numeric."+o+";\n");return Function(["y"],"var x = this;\nif(!(y instanceof numeric.T)) { y = new numeric.T(y); }\n"+i+"\nif(x.y) { if(y.y) { return new numeric.T("+n+");\n }\n return new numeric.T("+e+");\n}\nif(y.y) {\n return new numeric.T("+t+");\n}\nreturn new numeric.T("+r+");\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(){var r=numeric.mul,t=numeric.div;if(this.y){var e=numeric.add(r(this.x,this.x),r(this.y,this.y));return new numeric.T(t(this.x,e),t(numeric.neg(this.y),e))}return new T(t(1,this.x))},numeric.T.prototype.div=function(r){if(r instanceof numeric.T||(r=new numeric.T(r)),r.y)return this.mul(r.reciprocal());var t=numeric.div;return this.y?new numeric.T(t(this.x,r.x),t(this.y,r.x)):new numeric.T(t(this.x,r.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(){var r=numeric.transpose,t=this.x,e=this.y;return e?new numeric.T(r(t),r(e)):new numeric.T(r(t))},numeric.T.prototype.transjugate=function(){var r=numeric.transpose,t=this.x,e=this.y;return e?new numeric.T(r(t),numeric.negtranspose(e)):new numeric.T(r(t))},numeric.Tunop=function(r,t,e){return"string"!=typeof e&&(e=""),Function("var x = this;\n"+e+"\nif(x.y) { "+t+";\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();\nreturn new numeric.T(numeric.log(r.x),theta.x);"),numeric.T.prototype.norm2=numeric.Tunop("return numeric.norm2(x.x);","var f = numeric.norm2Squared;\nreturn Math.sqrt(f(x.x)+f(x.y));"),numeric.T.prototype.inv=function(){var r=this;if(void 0===r.y)return new numeric.T(numeric.inv(r.x));var t,e,n,i,o,a,u,s,c,f,l,m,h,p,g,y,d,v,x=r.x.length,b=numeric.identity(x),w=numeric.rep([x,x],0),M=numeric.clone(r.x),A=numeric.clone(r.y);for(c=0;cm&&(l=f,m=h);for(l!==c&&(v=M[c],M[c]=M[l],M[l]=v,v=A[c],A[c]=A[l],A[l]=v,v=b[c],b[c]=b[l],b[l]=v,v=w[c],w[c]=w[l],w[l]=v),t=M[c],e=A[c],o=b[c],a=w[c],p=t[c],g=e[c],f=c+1;f0;c--)for(o=b[c],a=w[c],f=c-1;f>=0;f--)for(u=b[f],s=w[f],p=M[f][c],g=A[f][c],l=x-1;l>=0;l--)y=o[l],d=a[l],u[l]-=p*y-g*d,s[l]-=p*d+g*y;return new numeric.T(b,w)},numeric.T.prototype.get=function(r){var t,e=this.x,n=this.y,i=0,o=r.length;if(n){for(;i=0?1:-1)*numeric.norm2(r);t[0]+=e;var n=numeric.norm2(t);if(0===n)throw new Error("eig: internal error");return numeric.div(t,n)},numeric.toUpperHessenberg=function(r){var t=numeric.dim(r);if(2!==t.length||t[0]!==t[1])throw new Error("numeric: toUpperHessenberg() only works on square matrices");var e,n,i,o,a,u,s,c,f,l,m=t[0],h=numeric.clone(r),p=numeric.identity(m);for(n=0;n0){for(a=numeric.house(o),u=numeric.getBlock(h,[n+1,n],[m-1,m-1]),s=numeric.tensor(a,numeric.dot(a,u)),e=n+1;e=4*s)_=.5*(c+Math.sqrt(c*c-4*s)),E=.5*(c-Math.sqrt(c*c-4*s)),f=numeric.add(numeric.sub(numeric.dot(f,f),numeric.mul(f,_+E)),numeric.diag(numeric.rep([3],_*E)));else f=numeric.add(numeric.sub(numeric.dot(f,f),numeric.mul(f,c)),numeric.diag(numeric.rep([3],s)));for(e=[f[0][0],f[1][0],f[2][0]],n=numeric.house(e),h=[r[0],r[1],r[2]],p=numeric.tensor(n,numeric.dot(n,h)),y=0;y<3;y++)for(m=r[y],g=p[y],v=0;v=0?((y=(a-(m=f<0?-.5*(f-E(l)):-.5*(f+E(l))))*(a-m)+u*u)>(d=s*s+(c-m)*(c-m))?(p=(a-m)/(y=E(y)),g=u/y):(p=s/(d=E(d)),g=(c-m)/d),i=new b([[g,-p],[p,g]]),N.setRows(e,o,i.dot(N.getRows(e,o)))):(m=-.5*f,h=.5*E(-l),(y=(a-m)*(a-m)+u*u)>(d=s*s+(c-m)*(c-m))?(p=(a-m)/(y=E(y+h*h)),g=u/y,m=0,h/=y):(p=s/(d=E(d+h*h)),g=(c-m)/d,m=h/d,h=0),i=new b([[g,-p],[p,g]],[[m,h],[h,-m]]),N.setRows(e,o,i.dot(N.getRows(e,o))))}var S=N.dot(r).dot(N.transjugate()),j=(w=r.length,numeric.T.identity(w));for(o=0;o0)for(n=o-1;n>=0;n--){var B=S.get([n,n]),T=S.get([o,o]);numeric.neq(B.x,T.x)||numeric.neq(B.y,T.y)?(m=S.getRow(n).getBlock([n],[o-1]),h=j.getRow(o).getBlock([n],[o-1]),j.set([o,n],S.get([n,o]).neg().sub(m.dot(h)).div(B.sub(T)))):j.setRow(o,j.getRow(n))}for(o=0;o=o.length;)o[o.length]=0;0!==t[n]&&o[n]++}var a=o.length,u=Array(a+1);for(u[0]=0,e=0;e=s){if(i[f]=h[c],0===c)return;++f,u=l[--c],s=m[c]}else 0===n[a=o[e[u]]]?(n[a]=1,l[c]=u,h[++c]=a,u=t[a],m[c]=s=t[a+1]):++u},numeric.ccsLPSolve=function(r,t,e,n,i,o,a){var u,s,c,f,l,m,h,p,g,y=r[0],d=r[1],v=r[2],x=(y.length,t[0]),b=t[1],w=t[2];for(s=x[i],c=x[i+1],n.length=0,u=s;uo&&(a=i,o=u);for(w(v[e])=c){if(i[l]=o[p[f]],0===f)return;++l,s=m[--f],c=h[f]}else 0===n[u=e[s]]?(n[u]=1,m[f]=s,p[++f]=u,s=t[u=o[u]],h[f]=c=t[u+1]):++s}},numeric.ccsLPSolve0=function(r,t,e,n,i,o,a,u){var s,c,f,l,m,h,p,g,y,d=r[0],v=r[1],x=r[2],b=(d.length,t[0]),w=t[1],M=t[2];for(c=b[i],f=b[i+1],n.length=0,s=c;so&&(a=i,o=u);for(w(v[M[e]])e[n]&&(e[n]=t.length),t)t.hasOwnProperty(i)&&r(t[i],e,n+1);return e},numeric.sclone=function r(t,e,n){void 0===e&&(e=0),void 0===n&&(n=numeric.sdim(t).length);var i,o=Array(t.length);if(e===n-1){for(i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);return o}for(i in t)t.hasOwnProperty(i)&&(o[i]=r(t[i],e+1,n));return o},numeric.sdiag=function(r){var t,e,n=r.length,i=Array(n);for(t=n-1;t>=1;t-=2)e=t-1,i[t]=[],i[t][t]=r[t],i[e]=[],i[e][e]=r[e];return 0===t&&(i[0]=[],i[0][0]=r[t]),i},numeric.sidentity=function(r){return numeric.sdiag(numeric.rep([r],1))},numeric.stranspose=function(r){var t,e,n,i=[];r.length;for(t in r)if(r.hasOwnProperty(t))for(e in n=r[t])n.hasOwnProperty(e)&&("object"!==_typeof(i[e])&&(i[e]=[]),i[e][t]=n[e]);return i},numeric.sLUP=function(r,t){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(r,t){var e,n,i,o,a,u,s,c=r.length,f=(t.length,numeric.stranspose(t)),l=f.length,m=Array(c);for(i=c-1;i>=0;i--){for(s=[],e=r[i],a=l-1;a>=0;a--){for(o in u=0,n=f[a],e)e.hasOwnProperty(o)&&o in n&&(u+=e[o]*n[o]);u&&(s[a]=u)}m[i]=s}return m},numeric.sdotMV=function(r,t){var e,n,i,o,a=r.length,u=Array(a);for(n=a-1;n>=0;n--){for(i in o=0,e=r[n])e.hasOwnProperty(i)&&t[i]&&(o+=e[i]*t[i]);o&&(u[n]=o)}return u},numeric.sdotVM=function(r,t){var e,n,i,o,a=[];for(e in r)if(r.hasOwnProperty(e))for(n in i=t[e],o=r[e],i)i.hasOwnProperty(n)&&(a[n]||(a[n]=0),a[n]+=o*i[n]);return a},numeric.sdotVV=function(r,t){var e,n=0;for(e in r)r[e]&&t[e]&&(n+=r[e]*t[e]);return n},numeric.sdot=function(r,t){var e=numeric.sdim(r).length,n=numeric.sdim(t).length;switch(1e3*e+n){case 0:return r*t;case 1001:return numeric.sdotVV(r,t);case 2001:return numeric.sdotMV(r,t);case 1002:return numeric.sdotVM(r,t);case 2002:return numeric.sdotMM(r,t);default:throw new Error("numeric.sdot not implemented for tensors of order "+e+" and "+n)}},numeric.sscatter=function(r){var t,e,n,i,o=r[0].length,a=r.length,u=[];for(e=o-1;e>=0;--e)if(r[a-1][e]){for(i=u,n=0;n=0;--o)e[o]=[];for(o=i;o>=0;--o)e[o].push(n[o]);e[i+1].push(a)}}else r(a,e,n);return n.length>i&&n.pop(),e},numeric.cLU=function(r){var t,e,n,i,o,a,u=r[0],s=r[1],c=r[2],f=u.length,l=0;for(t=0;tl&&(l=u[t]);l++;var m,h=Array(l),p=Array(l),g=numeric.rep([l],1/0),y=numeric.rep([l],-1/0);for(n=0;ny[t]&&(y[t]=e);for(t=0;ty[t+1]&&(y[t+1]=y[t]);for(t=l-1;t>=1;t--)g[t]=0;e--){for(;l[n]>e;)a[e]-=m[n]*a[l[n]],n--;a[e]/=m[n],n--}return a},numeric.cgrid=function(r,t){"number"==typeof r&&(r=[r,r]);var e,n,i,o=numeric.rep(r,-1);if("function"!=typeof t)switch(t){case"L":t=function(t,e){return t>=r[0]/2||ei&&(i=o[n]);for(i++,e=numeric.rep([i],0),n=0;n1;)i[n=a((t+e)/2)]<=r?t=n:e=n;return this._at(r,t)}o=r.length;var u,s=Array(o);for(u=o-1;-1!==u;--u)s[u]=this.at(r[u]);return s},numeric.Spline.prototype.diff=function(){var r,t,e,n=this.x,i=this.yl,o=this.yr,a=this.kl,u=this.kr,s=i.length,c=a,f=u,l=Array(s),m=Array(s),h=numeric.add,p=numeric.mul,g=numeric.div,y=numeric.sub;for(r=s-1;-1!==r;--r)t=n[r+1]-n[r],e=y(o[r+1],i[r]),l[r]=g(h(p(e,6),p(a[r],-4*t),p(u[r+1],-2*t)),t*t),m[r+1]=g(h(p(e,-6),p(a[r],2*t),p(u[r+1],4*t)),t*t);return new numeric.Spline(n,c,f,l,m)},numeric.Spline.prototype.roots=function(){function r(r){return r*r}var t=[],e=this.x,n=this.yl,i=this.yr,o=this.kl,a=this.kr;"number"==typeof n[0]&&(n=[n],i=[i],o=[o],a=[a]);var u,s,c,f,l,m,h,p,g,y,d,v,x,b,w,M,A,N,_,E,S,j,B,T=n.length,z=e.length-1,C=(t=Array(T),Math.sqrt);for(u=0;u!==T;++u){for(f=n[u],l=i[u],m=o[u],h=a[u],p=[],s=0;s!==z;s++){for(s>0&&l[s]*f[s]<0&&p.push(e[s]),M=e[s+1]-e[s],e[s],d=f[s],v=l[s+1],g=m[s]/M,x=(y=h[s+1]/M)+3*d+2*g-3*v,b=3*(y+g+2*(d-v)),(w=r(g-y+3*(d-v))+12*y*d)<=0?A=(N=x/b)>e[s]&&Ne[s]&&Ne[s]&&_0)S=j,N=_;else{for(var O=0;!((B=(N*j-_*S)/(N-_))<=S||B>=j);)if((E=this._at(B,s))*_>0)j=B,_=E,-1===O&&(N*=.5),O=-1;else{if(!(E*N>0))break;S=B,N=E,1===O&&(_*=.5),O=1}p.push(B),S=A[c+1],N=this._at(S,s)}else p.push(S),S=j,N=_;0===_&&p.push(j)}t[u]=p}return"number"==typeof this.yl[0]?t[0]:t},numeric.spline=function(r,t,e,n){var i,o=r.length,a=[],u=[],s=[],c=numeric.sub,f=numeric.mul,l=numeric.add;for(i=o-2;i>=0;i--)u[i]=r[i+1]-r[i],s[i]=c(t[i+1],t[i]);"string"!=typeof e&&"string"!=typeof n||(e=n="periodic");var m=[[],[],[]];switch(_typeof(e)){case"undefined":a[0]=f(3/(u[0]*u[0]),s[0]),m[0].push(0,0),m[1].push(0,1),m[2].push(2/u[0],1/u[0]);break;case"string":a[0]=l(f(3/(u[o-2]*u[o-2]),s[o-2]),f(3/(u[0]*u[0]),s[0])),m[0].push(0,0,0),m[1].push(o-2,0,1),m[2].push(1/u[o-2],2/u[o-2]+2/u[0],1/u[0]);break;default:a[0]=e,m[0].push(0),m[1].push(0),m[2].push(1)}for(i=1;i20)throw new Error("Numerical gradient fails");if(p[i]=t[i]+x,o=r(p),p[i]=t[i]-x,a=r(p),p[i]=t[i],isNaN(o)||isNaN(a))x/=16;else{if(g[i]=(o-a)/(2*x),u=t[i]-x,s=t[i],c=t[i]+x,f=(o-n)/x,l=(n-a)/x,m=h(y(g[i]),y(n),y(o),y(a),y(u),y(s),y(c),1e-8),!(d(h(y(f-g[i]),y(l-g[i]),y(f-l))/m,x/m)>.001))break;x/=16}}return g},numeric.uncmin=function(r,t,e,n,i,o,a){var u=numeric.gradient;void 0===a&&(a={}),void 0===e&&(e=1e-8),void 0===n&&(n=function(t){return u(r,t)}),void 0===i&&(i=1e3);var s,c,f=(t=numeric.clone(t)).length,l=r(t);if(isNaN(l))throw new Error("uncmin: f(x0) is a NaN!");var m=Math.max,h=numeric.norm2;e=m(e,numeric.epsilon);var p,g,y,d,v,x,b,w,M,A,N=a.Hinv||numeric.identity(f),_=numeric.dot,E=(numeric.inv,numeric.sub),S=numeric.add,j=numeric.tensor,B=numeric.div,T=numeric.mul,z=numeric.all,C=numeric.isFinite,O=numeric.neg,k=0,I="";for(g=n(t);k=.1*M*c||isNaN(s));)M*=.5,++k;if(M*A1;)u[n=i(.5*(t+e))]<=r?t=n:e=n;return this._at(r,t)},numeric.dopri=function(r,t,e,n,i,o,a){void 0===i&&(i=1e-6),void 0===o&&(o=1e3);var u,s,c,f,l,m,h,p,g,y,d,v,x,b=[r],w=[e],M=[n(r,e)],A=[],N=[.075,.225],_=[44/45,-56/15,32/9],E=[19372/6561,-25360/2187,64448/6561,-212/729],S=[9017/3168,-355/33,46732/5247,49/176,-5103/18656],j=[35/384,0,500/1113,125/192,-2187/6784,11/84],B=[.10013431883002395,0,.3918321794184259,-.02982460176594817,.05893268337240795,-.04497888809104361,.023904308236133973],T=[.2,.3,.8,8/9,1,1],z=[-71/57600,0,71/16695,-71/1920,17253/339200,-22/525,.025],C=0,O=(t-r)/10,k=0,I=numeric.add,P=numeric.mul,F=(Math.max,Math.min),q=Math.abs,U=numeric.norminf,D=Math.pow,R=numeric.any,L=numeric.lt,$=numeric.and,V=(numeric.sub,new numeric.Dopri(b,w,M,A,-1,""));for("function"==typeof a&&(d=a(r,e));rt&&(O=t-r),u=n(r+T[0]*O,I(e,P(.2*O,M[C]))),s=n(r+T[1]*O,I(I(e,P(N[0]*O,M[C])),P(N[1]*O,u))),c=n(r+T[2]*O,I(I(I(e,P(_[0]*O,M[C])),P(_[1]*O,u)),P(_[2]*O,s))),f=n(r+T[3]*O,I(I(I(I(e,P(E[0]*O,M[C])),P(E[1]*O,u)),P(E[2]*O,s)),P(E[3]*O,c))),l=n(r+T[4]*O,I(I(I(I(I(e,P(S[0]*O,M[C])),P(S[1]*O,u)),P(S[2]*O,s)),P(S[3]*O,c)),P(S[4]*O,f))),m=n(r+O,g=I(I(I(I(I(e,P(M[C],O*j[0])),P(s,O*j[2])),P(c,O*j[3])),P(f,O*j[4])),P(l,O*j[5]))),(y="number"==typeof(h=I(I(I(I(I(P(M[C],O*z[0]),P(s,O*z[2])),P(c,O*z[3])),P(f,O*z[4])),P(l,O*z[5])),P(m,O*z[6])))?q(h):U(h))>i){if(r+(O=.2*O*D(i/y,.25))===r){V.msg="Step size became too small";break}}else{if(A[C]=I(I(I(I(I(I(e,P(M[C],O*B[0])),P(s,O*B[2])),P(c,O*B[3])),P(f,O*B[4])),P(l,O*B[5])),P(m,O*B[6])),b[++C]=r+O,w[C]=g,M[C]=m,"function"==typeof a){var Z,X,H=r,Y=r+.5*O;if(v=a(Y,A[C-1]),R(x=$(L(d,0),L(0,v)))||(H=Y,d=v,v=a(Y=r+O,g),x=$(L(d,0),L(0,v))),R(x)){for(var J,G,W=0,Q=1,K=1;;){if("number"==typeof d)X=(K*v*H-Q*d*Y)/(K*v-Q*d);else for(X=Y,p=d.length-1;-1!==p;--p)d[p]<0&&v[p]>0&&(X=F(X,(K*v[p]*H-Q*d[p]*Y)/(K*v[p]-Q*d[p])));if(X<=H||X>=Y)break;G=a(X,Z=V._at(X,C-1)),R(J=$(L(d,0),L(0,G)))?(Y=X,v=G,x=J,K=1,-1===W?Q*=.5:Q=1,W=-1):(H=X,d=G,Q=1,1===W?K*=.5:K=1,W=1)}return g=V._at(.5*(r+X),C-1),V.f[C]=n(X,Z),V.x[C]=X,V.y[C]=Z,V.ymid[C-1]=g,V.events=x,V.iterations=k,V}}r+=O,e=g,d=v,O=F(.8*O*D(i/y,.25),4*O)}return V.iterations=k,V},numeric.LU=function(r,t){t=t||!1;var e,n,i,o,a,u,s,c,f,l=Math.abs,m=r.length,h=m-1,p=new Array(m);for(t||(r=numeric.clone(r)),i=0;i=0;--e){for(o=u[e],n=e+1;nI)&&(b=I),f=y(r,m(b,S)),s=p(k,j),C=d-1;-1!==C;--C)s[C][C]+=1;O=B(s,g(f,b),!0);var P=g(T,p(t,O)),F=1;for(C=v-1;-1!==C;--C)P[C]<0&&(F=N(F,-.999*P[C]));if(u=h(o,m(O,F)),!_(E(T=h(e,p(t,u)),0)))return{solution:o,message:"",iterations:c};if(o=u,b=0);if(x)return{solution:u,message:"Unbounded",iterations:c}}return{solution:o,message:"maximum iteration count exceeded",iterations:c}},numeric._solveLP=function(r,t,e,n,i){var o=r.length,a=e.length,u=(numeric.sum,numeric.log,numeric.mul,numeric.sub),s=numeric.dot,c=(numeric.div,numeric.add,numeric.rep([o],0).concat([1])),f=numeric.rep([a,1],-1),l=numeric.blockMatrix([[t,f]]),m=e,h=numeric.rep([o],0).concat(Math.max(0,numeric.sup(numeric.neg(e)))+1),p=numeric.__solveLP(c,l,m,n,i,h,!1),g=numeric.clone(p.solution);if(g.length=o,numeric.inf(u(e,s(t,g)))<0)return{solution:NaN,message:"Infeasible",iterations:p.iterations};var y=numeric.__solveLP(r,t,e,n,i-p.iterations,g,!0);return y.iterations+=p.iterations,y},numeric.solveLP=function(r,t,e,n,i,o,a){if(void 0===a&&(a=1e3),void 0===o&&(o=numeric.epsilon),void 0===n)return numeric._solveLP(r,t,e,o,a);var u,s=n.length,c=n[0].length,f=t.length,l=numeric.echelonize(n),m=numeric.rep([c],0),h=l.P,p=[];for(u=h.length-1;-1!==u;--u)m[h[u]]=1;for(u=c-1;-1!==u;--u)0===m[u]&&p.push(u);var g=numeric.getRange,y=numeric.linspace(0,s-1),d=numeric.linspace(0,f-1),v=g(n,y,p),x=g(t,d,h),b=g(t,d,p),w=numeric.dot,M=numeric.sub,A=w(x,l.I),N=M(b,w(A,v)),_=M(e,w(A,i)),E=Array(h.length),S=Array(p.length);for(u=h.length-1;-1!==u;--u)E[u]=r[h[u]];for(u=p.length-1;-1!==u;--u)S[u]=r[p[u]];var j=M(S,w(E,w(l.I,v))),B=numeric._solveLP(j,N,_,o,a),T=B.solution;if(T!=T)return B;var z=w(l.I,M(i,w(v,T))),C=Array(r.length);for(u=h.length-1;-1!==u;--u)C[h[u]]=z[u];for(u=p.length-1;-1!==u;--u)C[p[u]]=T[u];return{solution:C,message:B.message,iterations:B.iterations}},numeric.MPStoLP=function(r){r instanceof String&&r.split("\n");var t,e,n,i,o=0,a=["Initial state","NAME","ROWS","COLUMNS","RHS","BOUNDS","ENDATA"],u=r.length,s=0,c={},f=[],l=0,m={},h=0,p=[],g=[],y=[];function d(e){throw new Error("MPStoLP: "+e+"\nLine "+t+": "+r[t]+"\nCurrent state: "+a[o]+"\n")}for(t=0;t=o;)r/=2,t/=2,n>>>=1;return(r+n)/t},n},a=t.pow(e,6),i=t.pow(2,i),o=2*i,s(t.random(),r)}([],numeric.seedrandom,256,0,52),function(r){function t(r){if("object"!==_typeof(r))return r;var e,n=[],i=r.length;for(e=0;ef)p[v]=z;else if(p[v]=-Math.abs(z),z>0){for(d=1;d<=n;d+=1)a[d][y]=-a[d][y];u[y]=-u[y]}}for(y=1;y<=m;y+=1)p[_+l[y]]=0;for(S=0,T=0,y=1;y<=c;y+=1)p[_+y]=1;y-=1){for(z=p[y],x=(v=N+y*(y+3)/2)-y,d=y+1;d<=m;d+=1)z-=p[v]*p[A+d],v+=d;if(z/=p[x],p[A+y]=z,l[y]f)p[_+S]=z;else if(p[_+S]=-Math.abs(z),z>0){for(d=1;d<=n;d+=1)a[d][S]=-a[d][S];u[S]=-u[S]}return 700}for(l[m+=1]=S,v=N+(m-1)*m/2+1,y=1;y<=m-1;y+=1)p[v]=p[y],v+=1;if(m===n)p[v]=p[n];else{for(y=n;y>=m+1&&0!==p[y]&&(k=Math.max(Math.abs(p[y-1]),Math.abs(p[y])),I=Math.min(Math.abs(p[y-1]),Math.abs(p[y])),T=p[y-1]>=0?Math.abs(k*Math.sqrt(1+I*I/(k*k))):-Math.abs(k*Math.sqrt(1+I*I/(k*k))),k=p[y-1]/T,I=p[y]/T,1!==k);y-=1)if(0===k)for(p[y-1]=I*T,d=1;d<=n;d+=1)T=r[d][y-1],r[d][y-1]=r[d][y],r[d][y]=T;else for(p[y-1]=T,P=I/(1+k),d=1;d<=n;d+=1)T=k*r[d][y-1]+I*r[d][y],r[d][y]=P*(r[d][y-1]+T)-r[d][y],r[d][y-1]=T;p[v]=p[m]}return 0}function Z(){if(0===p[x=(v=N+w*(w+1)/2+1)+w])return 798;if(k=Math.max(Math.abs(p[x-1]),Math.abs(p[x])),I=Math.min(Math.abs(p[x-1]),Math.abs(p[x])),T=p[x-1]>=0?Math.abs(k*Math.sqrt(1+I*I/(k*k))):-Math.abs(k*Math.sqrt(1+I*I/(k*k))),k=p[x-1]/T,I=p[x]/T,1===k)return 798;if(0===k){for(y=w+1;y<=m;y+=1)T=p[x-1],p[x-1]=p[x],p[x]=T,x+=y;for(y=1;y<=n;y+=1)T=r[y][w],r[y][w]=r[y][w+1],r[y][w+1]=T}else{for(P=I/(1+k),y=w+1;y<=m;y+=1)T=k*p[x-1]+I*p[x],p[x]=P*(p[x-1]+T)-p[x],p[x-1]=T,x+=y;for(y=1;y<=n;y+=1)T=k*r[y][w]+I*r[y][w+1],r[y][w+1]=P*(r[y][w]+T)-r[y][w+1],r[y][w]=T}return 0}function X(){for(x=v-w,y=1;y<=w;y+=1)p[x]=p[v],v+=1,x+=1;return p[E+w]=p[E+w+1],l[w]=l[w+1],(w+=1)(t=Math.abs(t))?r*Math.sqrt(1+t*t/r/r):0==t?r:t*Math.sqrt(1+r*r/t/t)}var y=0,d=0,v=0,x=0,b=0,w=0,M=0;for(o=0;o=0&&(d=-d),v=y*d-M,c[o][o]=y-d,a=s;a=0&&(d=-d),v=y*d-M,c[o][o+1]=y-d,a=s;ax&&(x=b)}for(o=l-1;-1!=o;o+=-1){if(0!=d){for(v=d*c[o][o+1],a=s;a=49)throw"Error: no convergence.";for(x=h[s],d=g(y=(((b=h[u-1])-w)*(b+w)+((d=m[u-1])-(v=m[u]))*(d+v))/(2*v*b),1),y=y<0?((x-w)*(x+w)+v*(b/(y-d)-v))/x:((x-w)*(x+w)+v*(b/(y+d)-v))/x,i=1,M=1,o=s+1;o=0;a--)if(h[a]u&&(o=s,u=t[s]);return o},t.exports=o},{"mathjs/core":47,"mathjs/lib/function/arithmetic":71,"mathjs/lib/function/matrix":98,"mathjs/lib/type/matrix":197,"pw-stat":236}],236:[function(r,t,e){"use strict";e.cov=function(r){for(var t=r.length,e=[],n=0;n=s;)r/=2,t/=2,e>>>=1;return(r+e)/t}},t.exports.resetGlobal=function(){Math.random=f},m(Math.random(),i)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],238:[function(r,t,e){"use strict";function n(){}n.prototype={on:function(r,t,e){var n=this.e||(this.e={});return(n[r]||(n[r]=[])).push({fn:t,ctx:e}),this},once:function(r,t,e){var n=this;function i(){n.off(r,i),t.apply(e,arguments)}return i._=t,this.on(r,i,e)},emit:function(r){for(var t=[].slice.call(arguments,1),e=((this.e||(this.e={}))[r]||[]).slice(),n=0,i=e.length;ne&&!c?"Unexpected type of argument in function "+s+" (expected: "+u.join(" or ")+", actual: "+a+", index: "+e+")":"Too few arguments in function "+s+" (expected: "+u.join(" or ")+", index: "+e+")":"Too many arguments in function "+s+" (expected: "+e+", actual: "+t+")";var h=new TypeError(o);return h.data=m,h}function o(r){this.name=r||"refs",this.categories={}}function a(r,t){if("string"==typeof r){var e=r.trim(),n="..."===e.substr(0,3);if(n&&(e=e.substr(3)),""===e)this.types=["any"];else{this.types=e.split("|");for(var i=0;it&&(t=n)}return t}(n));f.push("function "+m+"("+h.join(", ")+") {"),f.push(' "use strict";'),f.push(" var name = "+JSON.stringify(r||"")+";"),f.push(c.toCode(e," ",!1)),f.push("}");var p=[e.toCode(),"return "+f.join("\n")].join("\n"),g=new Function(e.name,"createError",p)(e,i);return g.signatures=function(r){for(var t={},e=0;e0},a.prototype.contains=function(r){for(var t=0;tt.params.length)return 1;if(r.params.lengtho)return 1;if(i "+i+") {"),n.push(e+" var varArgs = [];"),n.push(e+" for (var i = "+i+"; i < arguments.length; i++) {"),n.push(e+" varArgs.push(arguments[i]);"),n.push(e+" }"),n.push(this.signature.toCode(r,e+" ")),n.push(e+"}");else{for(var u=function(e,n){for(var i=[],o=0;o "+e+") {",t+" throw createError(name, arguments.length, "+e+", arguments["+e+"]);",t+"}"].join("\n");for(var n={},i=[],o=0;o=127&&r<160?t.control:function(r){var t,e=0,n=i.length-1;if(ri[n][1])return!1;for(;n>=e;)if(t=Math.floor((e+n)/2),r>i[t][1])e=t+1;else{if(!(r=4352&&(r<=4447||9001==r||9002==r||r>=11904&&r<=42191&&12351!=r||r>=44032&&r<=55203||r>=63744&&r<=64255||r>=65040&&r<=65049||r>=65072&&r<=65135||r>=65280&&r<=65376||r>=65504&&r<=65510||r>=131072&&r<=196605||r>=196608&&r<=262141))}t.exports=function(r){return a(r,o)},t.exports.config=function(r){return r=n(r||{},o),function(t){return a(t,r)}}},{"./combining":240,defaults:41}]},{},[1])(1)}); \ No newline at end of file diff --git a/docs/docs/index.js.html b/docs/docs/index.js.html index 8316f23..cc9e6e8 100644 --- a/docs/docs/index.js.html +++ b/docs/docs/index.js.html @@ -98,7 +98,7 @@

// This file was auto generated, changes will be overwritten
-// Created on Sat Nov 09 2019 13:41:27 GMT-0600 (Central Standard Time)
+// Created on Sat Nov 09 2019 13:46:57 GMT-0600 (Central Standard Time)
 /** @module bcijs */
 module.exports.csp = require('./lib/compat/csp.js');
 module.exports.f1score = require('./lib/compat/f1score.js');
diff --git a/index.js b/index.js
index 0fccdbe..a1186e9 100644
--- a/index.js
+++ b/index.js
@@ -1,5 +1,5 @@
 // This file was auto generated, changes will be overwritten
-// Created on Sat Nov 09 2019 13:41:27 GMT-0600 (Central Standard Time)
+// Created on Sat Nov 09 2019 13:46:57 GMT-0600 (Central Standard Time)
 /** @module bcijs */
 module.exports.csp = require('./lib/compat/csp.js');
 module.exports.f1score = require('./lib/compat/f1score.js');