Tensor A C++ expression template library for N dimensional tensor computations

Installation

Contents

Dependencies

  • Nano : A template metaprogramming library, which is used to offload some of the work to the compiler, for example things like index mapping for slicing and multiplication.
  • Boost.Test : For the unit testing component of the library. This is not necessary of you aren't running the tests.

Note: At present CUDA is not requires as the GPU component of the library has not yet been implemented.

Nano

You can get the nano library from here -- nano -- it is a header only library. By default it is installed to usr/include. If you install it somewhere else make sure that it is on your $PATH so that tensor can find it.

Boost

You can get the Boost test library from here -- Boost.Test -- and follow the Getting Started Guide to install the libraries.

Note: You only need the test library from Boost, but it is dynamically linked in the Makefile provided with the tensor library, so you should install it to allow dynamic linking (i.e the library needs to be installed and not just the header files).

Compilers

The following compilers have been tested:

g++ (version 4.9.1) clang++ (version 3.6.1)

Compiling

Since tensor is (currently) a header-only library, there is nothing to install if you would just like to use it in your own application. However, tests are provided with tensor so ensure that everything is qorking as expected as well as to provide examples of the usage of tensor.

To compile the tests, cd into tests/, at which point you are provided with a few options:

  • Make all the tests
  • Make an individual tests

All tests

To make all the tests, simply issue

make all (or make -jN all -- to make in parallel with N processes)

Individual tests

The following individual test components are provided

  • tensor : tests related to tensors specifically
  • traits : tests for the tensor traits
  • container : tests for the tensor containers
  • operations : tests for the operations (addition, subtraction etc..)

To make an individual tests, issuse

make <test_name>

with the appropriate test name, for example make container

Cleaning

To clean the tests, issue

make clean