{"_id":"compute-l2norm","_rev":"10-2bacc2b430c271e7be55c1faf1de9609","name":"compute-l2norm","description":"Computes the L2 norm (Euclidean norm) of an array of values.","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.0":{"name":"compute-l2norm","version":"0.0.0","description":"Computes the L2 norm (Euclidean norm) of an array of values.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls"},"main":"./lib","repository":{"type":"git","url":"git://github.com/compute-io/l2norm.git"},"keywords":["compute.io","compute","computation","mathematics","math","linear algebra","norm","euclidean norm","l2norm"],"bugs":{"url":"https://github.com/compute-io/l2norm/issues"},"dependencies":{},"devDependencies":{"chai":"1.x.x","mocha":"1.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"gitHead":"f5c7d1ea50df1dbccec56c7667a864c21332c234","homepage":"https://github.com/compute-io/l2norm","_id":"compute-l2norm@0.0.0","_shasum":"c2d5d32aa2bb0843cec52359815dd0f3d1cca006","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"dist":{"shasum":"c2d5d32aa2bb0843cec52359815dd0f3d1cca006","tarball":"https://registry.npmjs.org/compute-l2norm/-/compute-l2norm-0.0.0.tgz","integrity":"sha512-Qq0wMVsNimL4Ck1tUzow+mcTkrNsy7g8eGiz8J1HNaZmYmmfa4N/EmxdWaiay76w5V+0fIGR4F/Bc2iVMVCUyw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkOGEnDSVl5vduZbOKrN09mu1sEl3JZqIZglytJ1G5OwIgV5i/idDyjbGXEkDSqzIYcOIbZXocPgmObL4KzqgxzEk="}]}},"1.0.0":{"name":"compute-l2norm","version":"1.0.0","description":"Computes the L2 norm (Euclidean norm) of an array of values.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls"},"main":"./lib","repository":{"type":"git","url":"git://github.com/compute-io/l2norm.git"},"keywords":["compute.io","compute","computation","mathematics","math","linear algebra","norm","euclidean norm","l2norm"],"bugs":{"url":"https://github.com/compute-io/l2norm/issues"},"dependencies":{},"devDependencies":{"chai":"1.x.x","mocha":"1.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"gitHead":"2544b28899e3e1f9266f669d6850cb7594574813","homepage":"https://github.com/compute-io/l2norm","_id":"compute-l2norm@1.0.0","_shasum":"a4ac4ec7a357381c6a9b556fa94fd6ca31e58f12","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"dist":{"shasum":"a4ac4ec7a357381c6a9b556fa94fd6ca31e58f12","tarball":"https://registry.npmjs.org/compute-l2norm/-/compute-l2norm-1.0.0.tgz","integrity":"sha512-wBDE3eD48EWNGAvsjnPpkmXjw5oOcMDVJ0jJqTkbcMctHWoNA17xXI9mQCUxMlpS/TKXDAAjNwtAm5vPjhaw6Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEKCjTZjEtikrVLpe8GDjyYg9nxfYrCY8hzbGdBsMbOwIhAKCTMX5GkrS+rfynNiHxSr/TGsLBfhmImhQdeX6eF/O7"}]}},"1.0.1":{"name":"compute-l2norm","version":"1.0.1","description":"Computes the L2 norm (Euclidean norm) of an array of values.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls"},"main":"./lib","repository":{"type":"git","url":"git://github.com/compute-io/l2norm.git"},"keywords":["compute.io","compute","computation","mathematics","math","linear algebra","norm","euclidean norm","l2norm"],"bugs":{"url":"https://github.com/compute-io/l2norm/issues"},"dependencies":{},"devDependencies":{"chai":"1.x.x","mocha":"1.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"gitHead":"b7c8acf9f667d5761d9ac8e86f05fc4ed6ec4177","homepage":"https://github.com/compute-io/l2norm","_id":"compute-l2norm@1.0.1","_shasum":"084978bdcb432625c5a1f14ea6c2eb936b1f082b","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"dist":{"shasum":"084978bdcb432625c5a1f14ea6c2eb936b1f082b","tarball":"https://registry.npmjs.org/compute-l2norm/-/compute-l2norm-1.0.1.tgz","integrity":"sha512-Yst4l32FPjFyp+x/M5oFXaG/1tbslTMybSC8FogF8Tyd8SobF4Cv0tBoHtuUPXgBfmrfBaeC9zaRRmQtdHk9tA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiVMbH53l0mgmFmC38KakAHoX5WDVjSTSXitFfvuRj0AIgM204RB2CgtC3EorEGiS4QkVXa3asaO/Kt8rEmTaCmdQ="}]}},"1.1.0":{"name":"compute-l2norm","version":"1.1.0","description":"Computes the L2 norm (Euclidean norm) of an array of values.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"},{"name":"Philipp Burckhardt","email":"pburckhardt@outlook.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls"},"main":"./lib","repository":{"type":"git","url":"git://github.com/compute-io/l2norm.git"},"keywords":["compute.io","compute","computation","mathematics","math","linear algebra","norm","euclidean norm","l2norm","l2 distance","euclidean length","length","distance","array","vector"],"bugs":{"url":"https://github.com/compute-io/l2norm/issues"},"dependencies":{"validate.io-array":"^1.0.3","validate.io-function":"^1.0.2"},"devDependencies":{"chai":"2.x.x","mocha":"2.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0","jshint":"2.x.x","jshint-stylish":"^1.0.0"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"gitHead":"e418666cf46ef5d0f6e7572d29960ce0e027c88d","homepage":"https://github.com/compute-io/l2norm#readme","_id":"compute-l2norm@1.1.0","_shasum":"bd09131c6b36c8d70c68334e176009a4e0a989ac","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.10.29","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"bd09131c6b36c8d70c68334e176009a4e0a989ac","tarball":"https://registry.npmjs.org/compute-l2norm/-/compute-l2norm-1.1.0.tgz","integrity":"sha512-6EHh1Elj90eU28SXi+h2PLnTQvZmkkHWySpoFz+WOlVNLz3DQoC4ISUHSV9n5jMxPHtKGJ01F4uu2PsXBB8sSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGUeYazUX+oxG7lFfX1E+62KE2zCxtGOh6Zm7GG2y2ZQIgLrY1nwb+yOpS7dKtu1OO+/IrB6tdDOYSobT9ihIZ2LA="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]}},"readme":"L2 norm\n===\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]\n\n> Computes the L2 norm ([Euclidean norm](http://en.wikipedia.org/wiki/Norm_(mathematics))) of an array.\n\n\n## Installation\n\n``` bash\n$ npm install compute-l2norm\n```\n\nFor use in the browser, use [browserify](https://github.com/substack/node-browserify).\n\n\n## Usage\n\n``` javascript\nvar l2norm = require( 'compute-l2norm' );\n```\n\n#### l2norm( arr[, accessor] )\n\nComputes the _L2_ norm (Euclidean norm) of an `array`.\n\n``` javascript\nvar data = [ 2, 7, 3, -3, 9 ];\n\nvar norm = l2norm( data );\n// returns ~12.3288\n```\n\nFor object `arrays`, provide an accessor `function` for accessing `array` values.\n\n``` javascript\nvar data = [\n\t['beep', 3],\n\t['boop', 4]\n];\n\nfunction getValue( d, i ) {\n\treturn d[ 1 ];\n}\n\nvar norm = l2norm( data, getValue );\n// returns 5\n```\n\nIf provided an empty `array`, the function returns `null`.\n\n\n## Examples\n\n``` javascript\nvar l2norm = require( 'compute-l2norm' );\n\nvar data = new Array( 1000 );\nfor ( var i = 0; i < data.length; i++ ) {\n\tdata[ i ] = Math.random() * 100;\n}\n\nconsole.log( l2norm( data ) );\n```\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n## References\n\n- \tDahlquist, Germund and Bjorck, Ake. _Numerical Methods in Scientific Computing_.\n- \tBlue, James (1978) \"A Portable Fortran Program To Find the Euclidean Norm of a Vector\". _ACM Transactions on Mathematical Software_.\n- \tHigham, Nicholas J. _Accuracy and Stability of Numerical Algorithms, Second Edition_.\n\nThis module implements a one-pass algorithm proposed by S.J. Hammarling.\n\n\n## Tests\n\n### Unit\n\nUnit tests use the [Mocha](http://mochajs.org) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n\n## Copyright\n\nCopyright &copy; 2014-2015. Athan Reines.\n\n\n[npm-image]: http://img.shields.io/npm/v/compute-l2norm.svg\n[npm-url]: https://npmjs.org/package/compute-l2norm\n\n[travis-image]: http://img.shields.io/travis/compute-io/l2norm/master.svg\n[travis-url]: https://travis-ci.org/compute-io/l2norm\n\n[coveralls-image]: https://img.shields.io/coveralls/compute-io/l2norm/master.svg\n[coveralls-url]: https://coveralls.io/r/compute-io/l2norm?branch=master\n\n[dependencies-image]: http://img.shields.io/david/compute-io/l2norm.svg\n[dependencies-url]: https://david-dm.org/compute-io/l2norm\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/compute-io/l2norm.svg\n[dev-dependencies-url]: https://david-dm.org/dev/compute-io/l2norm\n\n[github-issues-image]: http://img.shields.io/github/issues/compute-io/l2norm.svg\n[github-issues-url]: https://github.com/compute-io/l2norm/issues\n","maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"},{"name":"planeshifter","email":"pgb@andrew.cmu.edu"}],"time":{"modified":"2022-06-13T20:29:42.855Z","created":"2014-10-10T04:39:21.819Z","0.0.0":"2014-10-10T04:39:21.819Z","1.0.0":"2014-10-10T04:39:46.199Z","1.0.1":"2014-10-10T05:12:19.193Z","1.1.0":"2015-05-10T03:50:32.270Z"},"homepage":"https://github.com/compute-io/l2norm#readme","keywords":["compute.io","compute","computation","mathematics","math","linear algebra","norm","euclidean norm","l2norm","l2 distance","euclidean length","length","distance","array","vector"],"repository":{"type":"git","url":"git://github.com/compute-io/l2norm.git"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"},{"name":"Philipp Burckhardt","email":"pburckhardt@outlook.com"}],"author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"bugs":{"url":"https://github.com/compute-io/l2norm/issues"},"readmeFilename":"README.md"}