{"id":32167534,"url":"https://github.com/thara/elixir_alias_method","last_synced_at":"2026-02-21T03:31:02.657Z","repository":{"id":57478788,"uuid":"415639445","full_name":"thara/elixir_alias_method","owner":"thara","description":"Implementation of Walker's Alias method in Elixir ","archived":false,"fork":false,"pushed_at":"2021-10-11T15:36:51.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-21T17:10:44.867Z","etag":null,"topics":["algorithm","alias-method","elixir","walker-alias"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thara.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":"2021-10-10T16:27:37.000Z","updated_at":"2021-10-24T07:04:40.000Z","dependencies_parsed_at":"2022-08-30T09:50:13.857Z","dependency_job_id":null,"html_url":"https://github.com/thara/elixir_alias_method","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/thara/elixir_alias_method","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thara%2Felixir_alias_method","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thara%2Felixir_alias_method/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thara%2Felixir_alias_method/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thara%2Felixir_alias_method/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thara","download_url":"https://codeload.github.com/thara/elixir_alias_method/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thara%2Felixir_alias_method/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29672704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T03:11:15.450Z","status":"ssl_error","status_checked_at":"2026-02-21T03:10:34.920Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["algorithm","alias-method","elixir","walker-alias"],"created_at":"2025-10-21T15:32:39.894Z","updated_at":"2026-02-21T03:31:02.643Z","avatar_url":"https://github.com/thara.png","language":"Elixir","readme":"# AliasMethod\n\n[![Hex.pm](https://img.shields.io/hexpm/v/alias_method)](https://hex.pm/packages/alias_method) [![Elixir CI](https://github.com/thara/elixir_alias_method/actions/workflows/elixir.yml/badge.svg)](https://github.com/thara/elixir_alias_method/actions/workflows/elixir.yml) \n\nImplementation of Walker's Alias method by Elixir.\nThe algorithm is principally useful when you need to random sampling with replacement by O(1).\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:alias_method, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Example\n\n```elixir\niex\u003e weights = [1, 1, 8]\niex\u003e table = AliasMethod.generate_table(weights)\niex\u003e table\n%AliasMethod.Table{alias_table: %{0 =\u003e 2, 1 =\u003e 2, 2 =\u003e 0}, length: 3, probability_table: %{0 =\u003e 0.3, 1 =\u003e 0.3, 2 =\u003e 1.0}}\n\niex\u003e n = AliasMethod.choice(table)\niex\u003e 0 \u003c= n \u0026\u0026 n \u003c= table.length\ntrue\n```\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details\n\n## Author\n\n*Tomochika Hara* - [thara](https://github.com/thara)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthara%2Felixir_alias_method","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthara%2Felixir_alias_method","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthara%2Felixir_alias_method/lists"}