GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - correaa/boost-multi: Multidimensional arrays for C++. (Not an official Boost library) \\ This is a mirror of gitlab.com/correaa/boost-multi

BranchesTags
Open more actions menu

Latest commit

 

History

16,859 Commits
16,859 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.gitlab/merge_request_templates
.gitlab/merge_request_templates
 
 
benchmark
benchmark
 
 
cmake
cmake
 
 
doc
doc
 
 
include
include
 
 
meta
meta
 
 
spack
spack
 
 
talk
talk
 
 
test
test
 
 
test_adaptors
test_adaptors
 
 
test_package
test_package
 
 
.clang-format
.clang-format
 
 
.clang-tidy
.clang-tidy
 
 
.cmake-format
.cmake-format
 
 
.cmake-format.yaml
.cmake-format.yaml
 
 
.codecov.yml
.codecov.yml
 
 
.cppcheck-suppressions
.cppcheck-suppressions
 
 
.deepsource.toml
.deepsource.toml
 
 
.gitignore
.gitignore
 
 
.gitlab-ci-correaa.yml
.gitlab-ci-correaa.yml
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
.iwyu-test.imp
.iwyu-test.imp
 
 
.valgrind-suppressions
.valgrind-suppressions
 
 
CMakeLists.txt
CMakeLists.txt
 
 
CPPLINT.cfg
CPPLINT.cfg
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
codecov.yml
codecov.yml
 
 
conanfile.py
conanfile.py
 
 
llms.txt
llms.txt
 
 
mrdocs.yml
mrdocs.yml
 
 
mull.yml
mull.yml
 
 
pre-commit
pre-commit
 
 
pre-push
pre-push
 
 
pre-push-remote
pre-push-remote
 
 
pre-push.ps1
pre-push.ps1
 
 
sonar-project.properties
sonar-project.properties
 
 

Repository files navigation

Boost.Multi

Boost.Multi provides owning multidimensional arrays containers and non-owning multidimensional views for C++17. It supports slicing, layout transformations, and CPU/GPU memory.

Project status: Boost.Multi is not an official or accepted Boost library. It is being proposed for inclusion in Boost and has no Boost-library dependencies.

© Alfredo A. Correa, 2018–2026

Why Boost.Multi?

  • Generic element type and dimensionality
  • Natural multidimensional access: write A[i][j]... or iterate recursively over rows, subarrays or elements.
  • Composable subarray views: slice, transpo se, rotate indices, and broadcast arrays without copying their elements.
  • Interoperability: use standard algorithms (iterators and ranges), allocators, and legacy libraries for strided arrays (BLAS, FFTW, CUDA, HIP, MPI, etc.)

Quick start

git clone https://github.com/correaa/boost-multi.git  # or gitlab.com/correaa/boost-multi.git
cd boost-multi
cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure

Read the documentation or explore test/.

First array and view

#include <cassert>
#include <multi/array.hpp>

namespace multi = boost::multi;

int main() {
    multi::array<int, 2> A = {
        {1, 2, 3},
        {4, 5, 6}
    };

    assert(A[1][1] == 5);  // ordinary multidimensional indexing

    using multi::_;
    auto&& second_column = A(_, 1);  // a non-owning view
    second_column[0] = 20;           // changes A[0][1]
    assert(A[0][1] == 20);
}

Learn about Multi

  • Online documentation

Use Boost.Multi

Try the library online with Godbolt's Compiler Explorer.

Header-only

Add the repository's include/ directory to your compiler's include path and include the headers you need:

#include <multi/array.hpp>

Alternatively, download the single amalgamated header and include it as #include <boost-multi.hpp>.

CMake: in-tree source

Add Multi from an in-tree source directory and link its interface target:

add_subdirectory(path/to/boost-multi)
target_link_libraries(my_target PRIVATE multi)

CMake: FetchContent

Fetch Multi on demand:

include(FetchContent)
FetchContent_Declare(multi GIT_REPOSITORY https://gitlab.com/correaa/boost-multi.git)
FetchContent_MakeAvailable(multi)
target_link_libraries(my_target PRIVATE multi)

Testing

Testing requires Boost.Test. For example, install libboost-test-dev on Debian/Ubuntu or boost-devel on Fedora.

cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure

Support

  • File a Gitlab issue or Github issue.
  • Join the #boost-multi discussion group at cpplang.slack.com

About

Multidimensional arrays for C++. (Not an official Boost library) \\ This is a mirror of gitlab.com/correaa/boost-multi

correaa.github.io/boost-multi/index.html

Topics

cppmultidimensional-arrays

Resources

Readme
BSL-1.0 license
Activity

Stars

24 stars

Watchers

4 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.