function zeros(r){for(var n=new Array(r),o=0;o<r;++o)n[o]=0;return n}function zerosM(r,n){return zeros(r).map(function(){return zeros(n)})}function dot(r,n){for(var o=0,t=0;t<r.length;++t)o+=r[t]*n[t];return o}function norm2(r){return Math.sqrt(dot(r,r))}function scale(r,n,o){for(var t=0;t<n.length;++t)r[t]=n[t]*o}function weightedSum(r,n,o,t,e){for(var u=0;u<r.length;++u)r[u]=n*o[u]+t*e[u]}export{zeros,zerosM,dot,norm2,scale,weightedSum};