{"_id":"compute-dot","_rev":"8-a34015a2f5860fc018834cb3529bd294","name":"compute-dot","description":"Computes the dot product between two numeric arrays.","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.0":{"name":"compute-dot","version":"0.0.0","description":"Computes the dot product between two numeric arrays.","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/dot.git"},"keywords":["compute.io","compute","computation","algebra","linear algebra","dot product","scalar product","vector","array","calculus","geometry","mathematics","math"],"bugs":{"url":"https://github.com/compute-io/dot/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":"0700dfd5e7ad257a783e0b1e53900521ddc530c4","homepage":"https://github.com/compute-io/dot","_id":"compute-dot@0.0.0","_shasum":"835c0b326e806835f6760cabfc1a918bd53a4bfc","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"dist":{"shasum":"835c0b326e806835f6760cabfc1a918bd53a4bfc","tarball":"https://registry.npmjs.org/compute-dot/-/compute-dot-0.0.0.tgz","integrity":"sha512-kXWREI9ZtrlVnd79WuC77iHhEW+9J+o8AvnRsoLeI8Uw3KKICVTwF0U+ZwH/Sy30XQ7R+8Q/ijVts8ymYAS50g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICR+7BEwBSe/vBpjvht9cj4IsrRCipZwzzj9aVrIx3c0AiBq/sCU3Z2UXb/+SY1ep0hUpic6Rk4KmPQMeAyZbAx76g=="}]}},"1.0.0":{"name":"compute-dot","version":"1.0.0","description":"Computes the dot product between two numeric arrays.","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/dot.git"},"keywords":["compute.io","compute","computation","algebra","linear algebra","dot product","scalar product","vector","array","calculus","geometry","mathematics","math"],"bugs":{"url":"https://github.com/compute-io/dot/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":"35deffc39deb98427821b1aeda7f359475b908ec","homepage":"https://github.com/compute-io/dot","_id":"compute-dot@1.0.0","_shasum":"afac8c5921dd2b0c50fd04ff996a85dc6c455e0a","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"dist":{"shasum":"afac8c5921dd2b0c50fd04ff996a85dc6c455e0a","tarball":"https://registry.npmjs.org/compute-dot/-/compute-dot-1.0.0.tgz","integrity":"sha512-4/69xv3cTIUE49SerJT0xzZPFYhX+Sh0T0/1RtcPsAplToHNBgk99JSYW9KGYtHgI6pStGmEaPhptUklefGUtw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHgGvEOIUW1/eNSop2B6yn67Yx6VVH9t2+1Ji1txthtPAiBEq29cL0AldvibFExyGQVyZogl3fpsvbpYsMeNnrsDAw=="}]}},"1.1.0":{"name":"compute-dot","version":"1.1.0","description":"Computes the dot product between two numeric arrays.","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/dot.git"},"keywords":["compute.io","compute","computation","algebra","linear algebra","dot product","scalar product","vector","array","calculus","geometry","mathematics","math","dot"],"bugs":{"url":"https://github.com/compute-io/dot/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":"6ad524147fe36041101fc621d892e89bedd5fa33","homepage":"https://github.com/compute-io/dot#readme","_id":"compute-dot@1.1.0","_shasum":"01a5ba2c7af73b99002acb258459c9576a8232dc","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.10.29","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"01a5ba2c7af73b99002acb258459c9576a8232dc","tarball":"https://registry.npmjs.org/compute-dot/-/compute-dot-1.1.0.tgz","integrity":"sha512-L5Ocet4DdMrXboss13K59OK23GXjiSia7+7Ukc7q4Bl+RVpIXK2W9IHMbWDZkh+JUEvJAwOKRaJDiFUa1LTnJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJKDagc8gispf/DRrXEFF1BI/oX1/7F8FL9W/oFKaDIwIhAPGoRfuRyrfLtuuQr2yYF59ekTJZNK5zTNrTe398xZeB"}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]}},"readme":"Dot Product\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 [dot product](http://en.wikipedia.org/wiki/Dot_product) between two arrays.\n\n\n## Installation\n\n``` bash\n$ npm install compute-dot\n```\n\nFor use in the browser, use [browserify](https://github.com/substack/node-browserify).\n\n\n## Usage\n\n``` javascript\nvar dot = require( 'compute-dot' );\n```\n\n#### dot( x, y[, accessor] )\n\nComputes the [dot product](http://en.wikipedia.org/wiki/Dot_product) between two `arrays` of equal length.\n\n``` javascript\nvar val = dot( [1,2,3], [4,5,6] );\n// returns 32\n```\n\nTo compute the [dot product](http://en.wikipedia.org/wiki/Dot_product) between nested `array` values, provide an accessor `function` for accessing `numeric` values.\n\n``` javascript\nvar x = [\n\t{'x':2},\n\t{'x':4},\n\t{'x':5}\n];\n\nvar y = [\n\t[1,3],\n\t[2,1],\n\t[3,5]\n];\n\nfunction getValue( d, i, j ) {\n\tif ( j === 0 ) {\n\t\treturn d.x;\n\t}\n\treturn d[ 1 ];\n}\n\nvar val = dot( x, y, getValue );\n// returns 35\n```\n\nThe accessor `function` is provided three arguments:\n\n-\t__d__: current datum.\n-\t__i__: current datum index.\n-\t__j__: array index; e.g., array `x` has index `0` and array `y` has index `1`.\n\n\nIf provided empty `arrays`, the function returns `null`.\n\n\n## Examples\n\n``` javascript\nvar dot = require( 'compute-dot' );\n\n// Simulate some data...\nvar x = new Array( 100 ),\n\ty = new Array( 100 );\n\nvar val;\nfor ( var i = 0; i < x.length; i++ ) {\n\tval = Math.round( Math.random()*100 ) + 1;\n\tx[ i ] = val;\n\tif ( i % 2 === 0 ) {\n\t\tval = -val;\n\t}\n\ty[ i ] = 1 / val;\n}\n\nconsole.log( dot( x, y ) );\n// returns ~0 (floating-point errors)\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## 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-dot.svg\n[npm-url]: https://npmjs.org/package/compute-dot\n\n[travis-image]: http://img.shields.io/travis/compute-io/dot/master.svg\n[travis-url]: https://travis-ci.org/compute-io/dot\n\n[coveralls-image]: https://img.shields.io/coveralls/compute-io/dot/master.svg\n[coveralls-url]: https://coveralls.io/r/compute-io/dot?branch=master\n\n[dependencies-image]: http://img.shields.io/david/compute-io/dot.svg\n[dependencies-url]: https://david-dm.org/compute-io/dot\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/compute-io/dot.svg\n[dev-dependencies-url]: https://david-dm.org/dev/compute-io/dot\n\n[github-issues-image]: http://img.shields.io/github/issues/compute-io/dot.svg\n[github-issues-url]: https://github.com/compute-io/dot/issues\n","maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"},{"name":"planeshifter","email":"pgb@andrew.cmu.edu"}],"time":{"modified":"2022-06-13T20:27:47.808Z","created":"2014-11-09T04:02:26.532Z","0.0.0":"2014-11-09T04:02:26.532Z","1.0.0":"2014-11-09T04:02:47.517Z","1.1.0":"2015-05-10T02:31:44.530Z"},"homepage":"https://github.com/compute-io/dot#readme","keywords":["compute.io","compute","computation","algebra","linear algebra","dot product","scalar product","vector","array","calculus","geometry","mathematics","math","dot"],"repository":{"type":"git","url":"git://github.com/compute-io/dot.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/dot/issues"},"readmeFilename":"README.md"}