{"id":19337672,"url":"https://github.com/sheetjs/js-vdc","last_synced_at":"2025-02-24T08:15:25.151Z","repository":{"id":57391177,"uuid":"12119166","full_name":"SheetJS/js-vdc","owner":"SheetJS","description":":headphones: van der Corput low-discrepancy sequences","archived":false,"fork":false,"pushed_at":"2020-07-04T00:33:30.000Z","size":864,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-29T22:37:40.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://oss.sheetjs.com/js-vdc/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SheetJS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-14T20:49:21.000Z","updated_at":"2023-08-02T18:08:24.000Z","dependencies_parsed_at":"2022-09-19T05:00:17.286Z","dependency_job_id":null,"html_url":"https://github.com/SheetJS/js-vdc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheetJS%2Fjs-vdc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheetJS%2Fjs-vdc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheetJS%2Fjs-vdc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheetJS%2Fjs-vdc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SheetJS","download_url":"https://codeload.github.com/SheetJS/js-vdc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240441949,"owners_count":19801793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T03:15:05.910Z","updated_at":"2025-02-24T08:15:25.116Z","avatar_url":"https://github.com/SheetJS.png","language":"HTML","readme":"# VDC\n\nPure JS implementation of van der Corput low-discrepancy sequences.\n\n## Installation\n\nWith [npm](http://npm.im/vdc):\n\n```bash\n$ npm install vdc\n```\n\nIn the browser:\n\n```html\n\u003cscript src=\"vdc.js\"\u003e\u003c/script\u003e\n```\n\nThe browser exposes a variable `VDC`\n\n## Usage\n\nThe exported function `VDC` accepts a `opts` object with the following fields:\n\n- `b` (default `2`) base for the sequence.\n- `n` (default `0`) starting index for the sequence.\n\nCalling without arguments will default to the aforementioned values.\n\nThe object returned by `VDC` exposes a `next()` method to get the next element.\n\nThe field `last` holds the most recently generated value (accessing the field\ndoes not trigger a recalculation)\n\nFor example:\n\n```js\n//var VDC = require('vdc') // uncomment this line if in node\n\nvar opts = {'n':0, 'b':2};\nvar generator = VDC(opts);\nfor(var i = 0; i != 10; ++i) console.log(generator.next());\n```\n\nThe expected output is\n\n```\n0       (0/1)\n0.5     (1/2)\n0.25    (1/4)\n0.75    (3/4)\n0.125   (1/8)\n0.625   (5/8)\n0.375   (3/8)\n0.875   (7/8)\n0.0625  (1/16)\n0.5625  (9/16)\n```\n\n## Testing\n\n`make test` will run the nodejs-based test.\n\n`make baseline` will generate the test baselines using Mathematica by explicitly\nextracting and reversing the digits.  The implementation is based off a tutorial\n\u003chttp://reference.wolfram.com/mathematica/CUDALink/tutorial/Applications.html\u003e\n\n```mathematica\nVanDerCorput[base_][len_] := Table[\n  With[{digits = Reverse@IntegerDigits[n, base]},\n   Sum[2^(-ii)*digits[[ii]], {ii, Length[digits]}]\n   ], {n, len}]\n```\n\n## Notes\n\n`0` is the first value.  Some sources (notably Wikipedia) start the sequence at\n`1/2`, but others (Glasserman \"Monte Carlo Methods in Financial Engineering\")\nclaim that the original sequence definition started at `0`.\n\n## License\n\nPlease consult the attached LICENSE file for details.  All rights not explicitly\ngranted by the Apache 2.0 license are reserved by the Original Author.\n\n## Badges\n\n[![Build Status](https://travis-ci.org/SheetJS/js-vdc.svg?branch=master)](https://travis-ci.org/SheetJS/js-vdc)\n\n[![Coverage Status](http://img.shields.io/coveralls/SheetJS/js-vdc/master.svg)](https://coveralls.io/r/SheetJS/js-vdc?branch=master)\n\n[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/js-vdc?pixel)](https://github.com/SheetJS/js-vdc)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheetjs%2Fjs-vdc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheetjs%2Fjs-vdc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheetjs%2Fjs-vdc/lists"}