Boost Linear and Multilinear Algebra Library

Language License Documentation Wiki Mailing List Gitter

Windows Linux Apple MacOS Clang Sanitizer Clang Tidy Codecov

Boost.uBLAS is part of the Boost C++ Libraries. It is directed towards scientific computing on the level of basic linear and multilinear algebra operations with tensors, matrices and vectors.

Documentation

uBLAS is documented at boost.org. The tensor extension has also a wiki page.

License

Distributed under the Boost Software License, Version 1.0.

Properties

  • header-only
  • requires C++20 compatible compiler
    • gcc version >= 10.x.x
    • clang version >= 10.x.x
    • msvc version >= 14.28
  • Unit-tests require Boost.Test

Simple Example

#include <boost/numeric/ublas/tensor.hpp> 
#include <iostream>

int main()
{
  using namespace boost::numeric::ublas::index;
  using tensor  = boost::numeric::ublas::tensor_dynamic<float>;
  auto ones     = boost::numeric::ublas::ones<float>{};

  tensor A = ones(3,4,5);
  tensor B = ones(4,6,3,2);

  tensor C = 2*ones(5,6,2) + A(_i,_j,_k)*B(_j,_l,_i,_m) + 5;
  
  // Matlab Compatible Formatted Output
  std::cout << "C=" << C << ";" << std::endl;
}

Directories

Name Purpose
doc documentation
examples example files
include headers
test unit tests
benchmarks timing and benchmarking

More information

  • If you would like to test the library, contribute new feature or a bug fix, see contribution.
  • Ask questions in stackoverflow with boost-ublas or ublas tags.
  • Report bugs and be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
  • Submit your patches as pull requests against develop branch. Note that by submitting patches you agree to license your modifications under the Boost Software License, Version 1.0.
  • Developer discussions about the library are held on the Boost developers mailing list. Be sure to read the discussion policy before posting and add the [ublas] tag at the beginning of the subject line
  • For any other questions, you can contact David, Stefan or Cem: david.bellot-AT-gmail-DOT-com, cem.bassoy-AT-gmail-DOT-com stefan-AT-seefeld-DOT-name