https://github.com/boostorg/ublas
Boost.uBlas
https://github.com/boostorg/ublas
boost linear-algebra matrix tensor ublas vector
Last synced: 3 months ago
JSON representation
Boost.uBlas
- Host: GitHub
- URL: https://github.com/boostorg/ublas
- Owner: boostorg
- Created: 2013-02-07T20:04:10.000Z (over 12 years ago)
- Default Branch: develop
- Last Pushed: 2025-03-15T16:57:49.000Z (4 months ago)
- Last Synced: 2025-04-02T05:56:16.289Z (3 months ago)
- Topics: boost, linear-algebra, matrix, tensor, ublas, vector
- Language: C++
- Homepage: https://www.boost.org/doc/libs/release/libs/numeric/ublas
- Size: 46.9 MB
- Stars: 114
- Watchers: 14
- Forks: 151
- Open Issues: 60
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog
Awesome Lists containing this project
README
Boost Linear and Multilinear Algebra Library
=====[](https://en.wikipedia.org/wiki/C%2B%2B#Standardization)
[](https://opensource.org/licenses/BSL-1.0)
[](https://www.boost.org/doc/libs/1_69_0/libs/numeric/ublas/doc/index.html)
[](https://github.com/boostorg/ublas/wiki)
[](https://lists.boost.org/mailman/listinfo.cgi/ublas)
[](https://github.com/boostorg/ublas/discussions)
[](https://gitter.im/boostorg/ublas)
[](https://github.com/boostorg/ublas/wiki/Code-of-Conduct)[](https://github.com/boostorg/ublas/actions/workflows/windows.yml)
[](https://github.com/boostorg/ublas/actions/workflows/linux.yml)
[](https://github.com/boostorg/ublas/actions/workflows/apple.yml)
[](https://github.com/boostorg/ublas/actions/workflows/sanitizer.yml)
[](https://github.com/boostorg/ublas/actions/workflows/clangtidy.yml)
[](https://codecov.io/gh/boostorg/ublas/branch/master)Boost.uBlas is a header-only library and part of the [Boost C++ libraries](http://github.com/boostorg).
It provides a set of basic linear and multilinear algebra operations with tensors, matrices and vectors.
uBLAS is documented at [boost.org](https://www.boost.org/doc/libs/1_69_0/libs/numeric/ublas/doc/index.html) or in [docs](https://github.com/BoostGSoC21/ublas/blob/develop/doc/ublas.adoc).
Simple examples of the tensor extension is provided by the [wiki page](https://github.com/boostorg/ublas/wiki/Tensor).## Simple Example
```cpp
#include
#includeint main()
{
using namespace boost::numeric::ublas::index;
using tensor = boost::numeric::ublas::tensor_dynamic;
auto ones = boost::numeric::ublas::ones{};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](https://github.com/boostorg/ublas/wiki/Code-of-Conduct) and Boost's [discussion policy](http://www.boost.org/community/policy.html)
* Contributors and maintainers mainly use [Discussions](https://github.com/boostorg/ublas/discussions) (previously [Gitter](https://gitter.im/boostorg/ublas)) to discuss library design or governance topics.
* Users of the library can choose between the following platforms preferably [Gitter](https://gitter.im/boostorg/ublas), the [Boost developers mailing list](https://lists.boost.org/mailman/listinfo.cgi/ublas) using the `[ublas]` tag at the beginning of the subject line or [Stackoverflow](http://stackoverflow.com/questions/ask?tags=c%2B%2B,boost,boost-ublas) using `boost-ublas` or `ublas` tags
* Contact the maintainers [Cem](https://gitter.im/bassoy), [David](https://gitter.im/yimyom) or [Stefan](https://gitter.im/stefanseefeld) if you have suggestions## Contribution
* Be sure that you have read our [contribution guidelines](https://github.com/boostorg/ublas/wiki/Guidelines-for-Contribution) and our [code of conduct](https://github.com/boostorg/ublas/wiki/Code-of-Conduct)
* If you want to report a bug, create an [issue](https://github.com/boostorg/ublas/issues)
* 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 |