{"id":19178299,"url":"https://github.com/pjessesco/peanut","last_synced_at":"2025-07-19T15:06:13.083Z","repository":{"id":37623958,"uuid":"495809251","full_name":"pjessesco/peanut","owner":"pjessesco","description":"🥜 Header-only C++20 matrix library using expression templates","archived":false,"fork":false,"pushed_at":"2025-04-13T08:40:46.000Z","size":8038,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T20:45:46.932Z","etag":null,"topics":["cpp20","expression-template","header-only","matrix","matrix-library","modern-cpp","template-metaprogramming"],"latest_commit_sha":null,"homepage":"https://pjessesco.github.io/peanut/","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/pjessesco.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}},"created_at":"2022-05-24T12:16:46.000Z","updated_at":"2025-04-01T14:44:18.000Z","dependencies_parsed_at":"2024-11-09T10:38:48.221Z","dependency_job_id":"bd8a2cdd-5e53-4b64-afca-3a4243063b1d","html_url":"https://github.com/pjessesco/peanut","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pjessesco/peanut","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjessesco%2Fpeanut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjessesco%2Fpeanut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjessesco%2Fpeanut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjessesco%2Fpeanut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pjessesco","download_url":"https://codeload.github.com/pjessesco/peanut/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjessesco%2Fpeanut/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265950818,"owners_count":23853839,"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":["cpp20","expression-template","header-only","matrix","matrix-library","modern-cpp","template-metaprogramming"],"created_at":"2024-11-09T10:38:45.643Z","updated_at":"2025-07-19T15:06:13.032Z","avatar_url":"https://github.com/pjessesco.png","language":"C++","readme":"# Peanut\n\n[![Unit Test (macOS, AppleClang)](https://github.com/pjessesco/peanut/actions/workflows/unittest_macos_appleclang.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/unittest_macos_appleclang.yml) \n[![Unit Test (macOS, Clang)](https://github.com/pjessesco/peanut/actions/workflows/unittest_macos_clang.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/unittest_macos_clang.yml) \n[![Unit Test (Windows MSVC)](https://github.com/pjessesco/peanut/actions/workflows/unittest_windows_msvc.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/unittest_windows_msvc.yml)\n[![Unit Test (Windows Clang)](https://github.com/pjessesco/peanut/actions/workflows/unittest_windows_clang.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/unittest_windows_clang.yml) \n[![Deploy doxygen documents](https://github.com/pjessesco/peanut/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/docs.yml)\n\n**Peanut** is a header-only matrix library using C++20 without any external dependencies, (except unit test), following a `expression templates` concept. It first constructs matrix expression as a user provides, and evaluates it using an automatically generated code in a compile-time.\n\n```\nMatrix\u003cint, 4, 4\u003e mat1{1,2,3,4,\n                       1,2,3,4,\n                       1,2,3,4,\n                       1,2,3,4};\n\nMatrix\u003cint, 3, 5\u003e mat2{1,2,3,4,5,\n                       1,2,3,4,5,\n                       1,2,3,4,5};\n\n// Peanut first build expression tree,\n// `result` type is `MatrixMult\u003cMatrixSubtract\u003cMatrixSum\u003cMatrix\u003cint, 4, 4\u003e, MatrixInverse\u003cMatrix\u003cint, 4, 4\u003e\u003e\u003e, MatrixMinor\u003cMatrix\u003cint, 4, 4\u003e\u003e\u003e, MatrixSub\u003c2, 1, MatrixMult\u003cMatrixTranspose\u003cMatrix\u003cint, 3, 5\u003e\u003e, Matrix\u003cint, 3, 5\u003e\u003e\u003e\u003e`.\nauto result = (mat1 + Inverse(mat1) - Minor(mat1)) * SubMat\u003c2, 1\u003e(T(mat2) * mat2);\n\n// then evaluate it when `eval()` is called or assigned to `Matrix` type variable.\n/* Matrix\u003cint, 4, 4\u003e */ auto e1 = result.eval();\nMatrix\u003cint, 4, 4\u003e e2 = result;\n```\n\n### Features\n- Arbitrary size matrix expression\n- Lazy evaluation\n- Unit test\n\n### Usage\nCopy `Peanut` directory to your project, and add and its path to the include path. If you're using CMake, add :\n\n    add_subdirectory(ext/peanut)\n    include_directories(ext/peanut/include)\n\nThen include as below :\n\n    #include \u003cPeanut/Peanut.h\u003e\n\nRefer [documentation](https://pjessesco.github.io/peanut/) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjessesco%2Fpeanut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjessesco%2Fpeanut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjessesco%2Fpeanut/lists"}