{"id":22096662,"url":"https://github.com/libmir/mir-algorithm","last_synced_at":"2026-02-17T18:34:07.676Z","repository":{"id":14676158,"uuid":"76841664","full_name":"libmir/mir-algorithm","owner":"libmir","description":"Dlang Core Library","archived":false,"fork":false,"pushed_at":"2026-02-04T06:56:31.000Z","size":4316,"stargazers_count":178,"open_issues_count":27,"forks_count":36,"subscribers_count":10,"default_branch":"master","last_synced_at":"2026-02-04T18:08:23.102Z","etag":null,"topics":["algorithms","iterator","multidimensional-arrays","multidimensionality","ndslice","range"],"latest_commit_sha":null,"homepage":"http://mir-algorithm.libmir.org","language":"D","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/libmir.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-12-19T08:09:29.000Z","updated_at":"2026-02-04T06:56:35.000Z","dependencies_parsed_at":"2024-02-22T10:28:24.559Z","dependency_job_id":"1eb73d36-284b-4e1d-ab37-1d239ee460db","html_url":"https://github.com/libmir/mir-algorithm","commit_stats":null,"previous_names":[],"tags_count":617,"template":false,"template_full_name":null,"purl":"pkg:github/libmir/mir-algorithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libmir%2Fmir-algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libmir%2Fmir-algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libmir%2Fmir-algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libmir%2Fmir-algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libmir","download_url":"https://codeload.github.com/libmir/mir-algorithm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libmir%2Fmir-algorithm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29552798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T18:16:07.221Z","status":"ssl_error","status_checked_at":"2026-02-17T18:16:04.782Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["algorithms","iterator","multidimensional-arrays","multidimensionality","ndslice","range"],"created_at":"2024-12-01T04:12:03.492Z","updated_at":"2026-02-17T18:34:02.662Z","avatar_url":"https://github.com/libmir.png","language":"D","readme":"[![codecov.io](https://codecov.io/github/libmir/mir-algorithm/coverage.svg?branch=master)](https://codecov.io/github/libmir/mir-algorithm?branch=master)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/libmir/mir-algorithm/ci.yml?branch=master)](https://github.com/libmir/mir-algorithm/actions)\n[![Circle CI](https://circleci.com/gh/libmir/mir-algorithm.svg?style=svg)](https://circleci.com/gh/libmir/mir-algorithm)\n\n[![Dub downloads](https://img.shields.io/dub/dt/mir-algorithm.svg)](http://code.dlang.org/packages/mir-algorithm)\n[![Dub downloads](https://img.shields.io/dub/dm/mir-algorithm.svg)](http://code.dlang.org/packages/mir-algorithm)\n[![License](https://img.shields.io/dub/l/mir-algorithm.svg)](http://code.dlang.org/packages/mir-algorithm)\n[![Latest version](https://img.shields.io/dub/v/mir-algorithm.svg)](http://code.dlang.org/packages/mir-algorithm)\n[![Bountysource](https://www.bountysource.com/badge/team?team_id=145399\u0026style=bounties_received)](https://www.bountysource.com/teams/libmir)\n\nMir Algorithm\n=============\n\n#### [API Documentation](http://mir-algorithm.libmir.org)\n\n#### Blogs\n  - Tasty D - [Multidimensional Arrays in D](https://tastyminerals.github.io/tasty-blog/dlang/2020/03/22/multidimensional_arrays_in_d.html)\n  - Tasty D - [Using External D Libraries in D Scripts and Projects](https://tastyminerals.github.io/tasty-blog/dlang/2020/03/01/how_to_use_external_libraries_in_d_project.html)\n  - Tasty D - [Pretty-printing D Arrays](https://tastyminerals.github.io/tasty-blog/dlang/2020/06/25/pretty_printing_arrays.html)\n  - Shigeki Karita - [D言語で数値計算 mir-algorithm](https://shigekikarita.github.io/blog/2017/09/22/026.html)\n  - Shigeki Karita - [D言語(mir)でNumPyを拡張する](https://qiita.com/ShigekiKarita/items/af84b0ef864608ee1f21) (mir-pybuffer integration)\n  - [Mir Blog](http://blog.mir.dlang.io/) (deprecated)\n\n#### [Mir Type System for .NET](https://github.com/libmir/mir.net)\n\n#### Example (3 sec)\n```d\n/+dub.sdl:\ndependency \"mir-algorithm\" version=\"~\u003e2.0.0\"\n+/\n\nvoid main()\n{\n    import mir.ndslice;\n\n    auto matrix = slice!double(3, 4);\n    matrix[] = 0;\n    matrix.diagonal[] = 1;\n\n    auto row = matrix[2];\n    row[3] = 6;\n    assert(matrix[2, 3] == 6); // D \u0026 C index order\n    \n    import mir.stdio;\n    matrix.writeln;\n    // prints [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 6.0]]\n}\n```\n\n[![Open on run.dlang.io](https://img.shields.io/badge/run.dlang.io-open-blue.svg)](https://run.dlang.io/is/OdGbCj)\n\n#### Example (30 sec)\n```d\n/+dub.sdl:\ndependency \"mir-algorithm\" version=\"~\u003e2.0.0\"\n+/\nvoid main()\n{\n    import mir.ndslice;\n    import std.stdio : writefln;\n\n    enum fmt = \"%(%(%.2f %)\\n%)\\n\";\n\n    // Magic sqaure. \n    // `a` is lazy, each element is computed on-demand.\n    auto a = magic(5).as!float;\n    writefln(fmt, a);\n\n    // 5x5 grid on sqaure [1, 2] x [0, 1] with values x * x + y. \n    // `b` is lazy, each element is computed on-demand.\n    auto b = linspace!float([5, 5], [1f, 2f], [0f, 1f]).map!\"a * a + b\";\n    writefln(fmt, b);\n\n    // allocate a 5 x 5 contiguous matrix\n    auto c = slice!float(5, 5);\n\n    c[] = transposed(a + b / 2); // no memory allocations here\n    // 1. b / 2 - lazy element-wise operation with scalars\n    // 2. a + (...) - lazy element-wise operation with other slices\n    // Both slices must be `contiguous` or one-dimensional.\n    // 3. transposed(...) - trasposes matrix view. The result is `universal` (numpy-like) matrix.\n    // 5. c[] = (...) -- performs element-wise assignment.\n    writefln(fmt, c);\n}\n```\n\n[![Open on run.dlang.io](https://img.shields.io/badge/run.dlang.io-open-blue.svg)](https://run.dlang.io/is/67Gi6X)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibmir%2Fmir-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibmir%2Fmir-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibmir%2Fmir-algorithm/lists"}