{"id":15132651,"url":"https://github.com/yappy2000d/pps-ndarray","last_synced_at":"2026-01-18T23:02:40.590Z","repository":{"id":257414089,"uuid":"858189546","full_name":"yappy2000d/PPs-Ndarray","owner":"yappy2000d","description":"Multi-dimensional array implementation","archived":false,"fork":false,"pushed_at":"2024-09-25T13:28:29.000Z","size":97,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T21:44:49.285Z","etag":null,"topics":["cpp","numpy"],"latest_commit_sha":null,"homepage":"https://yappy2000d.github.io/PPs-Ndarray/","language":"C++","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/yappy2000d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-09-16T13:19:26.000Z","updated_at":"2024-09-25T13:28:33.000Z","dependencies_parsed_at":"2024-09-16T16:05:00.681Z","dependency_job_id":"5531a790-ecd0-4513-9634-59889f055f9c","html_url":"https://github.com/yappy2000d/PPs-Ndarray","commit_stats":null,"previous_names":["yappy2000d/pp-s-ndarray","yappy2000d/pps-ndarray"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yappy2000d%2FPPs-Ndarray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yappy2000d%2FPPs-Ndarray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yappy2000d%2FPPs-Ndarray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yappy2000d%2FPPs-Ndarray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yappy2000d","download_url":"https://codeload.github.com/yappy2000d/PPs-Ndarray/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406068,"owners_count":20933802,"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":["cpp","numpy"],"created_at":"2024-09-26T04:22:06.846Z","updated_at":"2026-01-18T23:02:40.554Z","avatar_url":"https://github.com/yappy2000d.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ndarray-11\n\n[![Static Badge](https://img.shields.io/badge/C%2B%2B-11-blue?style=flat-square\u0026logo=cplusplus)](https://isocpp.org/std/the-standard)\n\nA simple yet powerful multi-dimensional array implementation in C++11, inspired by Python's NumPy. This library provides an intuitive interface for working with multi-dimensional arrays, supporting slicing, indexing, and initialization through initializer lists.\n\n## Features\n\n- Multi-dimensional arrays: Supports arrays with arbitrary dimensions, enabling complex data structures.\n- Initializer list support: Easily initialize arrays with nested lists.\n- Indexing and slicing: Access and manipulate data through familiar Python-like syntax.\n- C++11 support: Fully compatible with C++11 and upper, using modern type traits and std::initializer_list.\n\n## Installation\n\nTo use Ndarray-11, simply download or clone the repository and include the header file in your project.\n\nThen, include the header file in your code:\n```cpp\n#include \"ndarray-11.hpp\"\n```\n\n## Usage\n\n- For more examples, see the [examples](./examples/) directory.\n- Documentation is generated using Doxygen, and can be found [here](https://yappy2000d.github.io/PPs-Ndarray/).\n\n### Basic Initialization\n\nCreate a 3D array with pre-defined dimensions:\n\n```cpp\npp::Ndarray\u003cint[3]\u003e array = {\n    {\n        {0, 0, 0},\n        {0, 0, 0}\n    },\n    {\n        {1, 1, 1},\n        {1, 1, 1}\n    }\n};\n```\n\n### Accessing Elements\n\nAccess elements with an intuitive function call syntax, similar to Python's NumPy:\n\n```cpp\narray(0, 1, 2) = 777; // Equivalent to array[0][1][2] = 777;\n```\n\n### Slicing\n\nPerform slicing operations with a Python-like syntax using the `Range` class:\n\n```cpp\nauto sliced_array = array[\"0:1, ::1\"];\n```\n\n### Printing Arrays\n\nPrint the array using the `\u003c\u003c` operator:\n\n```cpp\nstd::cout \u003c\u003c array \u003c\u003c std::endl;\n```\n\n### Example\n\n```cpp\n#include \"ndarray-11.hpp\"\n\nint main() {\n    pp::Ndarray\u003cint[3]\u003e array = {\n        {\n            {0, 0, 0},\n            {0, 0, 0}\n        },\n        {\n            {1, 1, 1},\n            {1, 1, 1}\n        }\n    };\n\n    // Set value at [0][1][2]\n    array(0, 1, 2) = 777;\n\n    // Print the array\n    std::cout \u003c\u003c array \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n## Limitations\n\n- Negative indices when slicing are not supported yet. https://github.com/yappy2000d/PPs-Ndarray/issues/1\n- Broadcasting is not supported yet.\n- Dimensions must remain the same after slicing. https://github.com/yappy2000d/PPs-Ndarray/issues/2\n- Dimensions must be specified at compile time.\n\n## Cooming not so soon\n\nCheck out the [Milestones](https://github.com/yappy2000d/PPs-Ndarray/milestones)\n\n## Contributions\n\nContributions are welcome! If you find bugs or have suggestions for improvements, feel free to open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.\n\n## Acknowledgements\n\n- [@rexwolflan](https://github.com/LeiwolfLanze) for technical guidance and code review.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyappy2000d%2Fpps-ndarray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyappy2000d%2Fpps-ndarray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyappy2000d%2Fpps-ndarray/lists"}