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.
#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;
}
[ublas]
tag at the beginning of the subject line or Stackoverflow using boost-ublas
or ublas
tagsName | Purpose |
---|---|
doc | documentation |
examples | example files |
include | headers |
test | unit tests |
benchmarks | timing and benchmarking |
Author: boostorg
Source: https://github.com/boostorg/ublas