{"id":20602466,"url":"https://github.com/augustunderground/cosamp","last_synced_at":"2026-06-05T19:31:12.468Z","repository":{"id":112835915,"uuid":"583162407","full_name":"AugustUnderground/cosamp","owner":"AugustUnderground","description":"CoSaMP algorithm in Haskell","archived":false,"fork":false,"pushed_at":"2022-12-29T00:34:07.000Z","size":143,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-17T06:03:02.321Z","etag":null,"topics":["compressed-sensing","cosamp","haskell","sparse-sampling"],"latest_commit_sha":null,"homepage":"https://augustunderground.github.io/cosamp","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AugustUnderground.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-29T00:30:49.000Z","updated_at":"2022-12-29T00:32:53.000Z","dependencies_parsed_at":"2023-05-31T10:00:32.763Z","dependency_job_id":null,"html_url":"https://github.com/AugustUnderground/cosamp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AugustUnderground/cosamp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustUnderground%2Fcosamp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustUnderground%2Fcosamp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustUnderground%2Fcosamp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustUnderground%2Fcosamp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AugustUnderground","download_url":"https://codeload.github.com/AugustUnderground/cosamp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustUnderground%2Fcosamp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33957496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["compressed-sensing","cosamp","haskell","sparse-sampling"],"created_at":"2024-11-16T09:13:56.141Z","updated_at":"2026-06-05T19:31:12.451Z","avatar_url":"https://github.com/AugustUnderground.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoSaMP\n\nCoSaMP algorithm in Haskell. \n\n[Documentation](https://augustunderground.github.io/cosamp)\n\n## Use in Stack Project\n\nAdd this to `stack.yaml`:\n\n```yaml\nextra-deps:\n - github: augustunderground/cosamp\n   commit: 264f4ec2f6a74d10a7cc484e0bbbe7f24d85d3cc\n```\n\n## Example\n\n```haskell\nimport CoSaMP\nimport Numeric.LinearAlgebra\nimport Graphics.Plot\n\nmain :: IO ()\nmain      = mplot [t, s] \u003e\u003e mplot [tWin, xWin, xWin']\n  where \n    n     = 4096 :: Int\n    t     = linspace n (0.0, 1.0 :: Double)\n    x     = sin ( 91 * 2 * pi * t ) + sin ( 412 * 2 * pi * t )\n    p     = 128 :: Int\n    aquis = cmap floor \n          $ scale (realToFrac n - 1) (randomVector 666 Uniform p) :: Vector I\n    y     = flatten $ asRow x ?? (All, Pos aquis)\n    φ     = dctOrtho (ident n :: Matrix Double)\n    cφ    = φ ?? (Pos aquis, All)\n    s     = cosamp cφ y 10 100 1.0e-10\n    x'    = idctOrtho s\n    wIdx  = idxs $ find (\\i -\u003e i \u003e= 0.4 \u0026\u0026 i \u003c= 0.5) t\n    tWin  = flatten $ asRow t ?? (All, Pos wIdx)\n    xWin  = flatten $ asRow x ?? (All, Pos wIdx)\n    xWin' = flatten $ asRow x' ?? (All, Pos wIdx)\n```\n\n![](docs/result.png)\n\n![](docs/spectrum.png)\n\n## Build From Source\n\n```\n$ git clone https://github.com/augustunderground/cosamp\n$ cd cosamp\n$ stack build\n$ stack install\n$ stack run\n```\n\n# References and Resources\n\nThis is a Haskell implementation of the Compressive Sampling Matched Pursuit\n(CoSaMP) algorithm as presented in Needell and Tropp's 2008\n[paper](http://arxiv.org/abs/0803.2392).\n\nThere are also reference implementations available in:\n- [MATLAB](https://www.mathworks.com/matlabcentral/fileexchange/32402-cosamp-and-omp-for-sparse-recovery).\n- [Python](https://github.com/rfmiotto/CoSaMP) which is based on \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugustunderground%2Fcosamp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faugustunderground%2Fcosamp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugustunderground%2Fcosamp/lists"}