This version of Boost is under active development. The current version is 1.87.0.
C++
11
Added in Boost
1.57.0
Categories:
Math
uBLAS provides tensor, matrix, and vector classes as well as basic linear and multilinear algebra routines. Several dense, packed and sparse storage schemes are supported.
This Release
Boost Linear and Multilinear Algebra Library
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
- Be sure to have read our code of conduct and Boost's discussion policy
- Contributors and maintainers mainly use Discussions (previously Gitter) to discuss library design or governance topics.
- Users of the library can choose between the following platforms preferably Gitter, the Boost developers mailing list using the
[ublas]
tag at the beginning of the subject line or Stackoverflow usingboost-ublas
orublas
tags - Contact the maintainers Cem, David or Stefan if you have suggestions
Contribution
- Be sure that you have read our contribution guidelines and our code of conduct
- If you want to report a bug, create an issue
- If you want to submit a patch, create pull request against develop branch.
Directories
Name | Purpose |
---|---|
doc |
documentation |
examples |
example files |
include |
headers |
test |
unit tests |
benchmarks |
timing and benchmarking |