Skip to content

boostorg/ublas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8934b49 · Nov 22, 2023
Jul 12, 2020
Aug 2, 2022
Sep 9, 2021
Jul 11, 2020
Sep 9, 2021
Sep 9, 2021
Feb 6, 2022
Jan 23, 2021
Feb 3, 2022
Jul 11, 2020
Sep 9, 2021
Sep 14, 2002
Apr 14, 2020
Nov 22, 2023
Sep 16, 2014
Sep 12, 2021
Oct 29, 2018
May 18, 2019
Sep 9, 2021
Oct 29, 2018

Repository files navigation

Boost Linear and Multilinear Algebra Library

Language License Documentation Wiki Mailing List Discussions Gitter Contributor Covenant

Windows Linux Apple MacOS Clang Sanitizer Clang Tidy Codecov

Boost.uBlas is a header-only library and part of the Boost C++ libraries. It provides a set of basic linear and multilinear algebra operations with tensors, matrices and vectors. uBLAS is documented at boost.org or in docs. Simple examples of the tensor extension is provided by the wiki page.

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;
}

Requirements

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

Discussions and Questions

Contribution

Directories

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