Boost.uBLAS: C++ linear and multilinear algebra library

Boost.uBLAS Linear Algebra Library

Boost.uBLAS is part of the Boost C++ Libraries. It is directed towards scientific computing on the level of basic linear algebra constructions with matrices and vectors and their corresponding abstract operations.

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

NamePurpose
docdocumentation
examplesexample files
includeheaders
testunit tests
benchmarkstiming and benchmarking

Download details:

Author: boostorg
Source: https://github.com/boostorg/ublas

#cpluplus 

Boost.uBLAS: C++ linear and multilinear algebra library
1.00 GEEK