Tannic
A C++ Tensor Library
Loading...
Searching...
No Matches
strides.hpp File Reference

Memory layout specification for tensor dimensions in the Tannic Tensor Library. More...

#include <array>
#include <cstddef>
#include <stdexcept>
#include <ostream>
#include "concepts.hpp"
#include "shape.hpp"
#include "indexing.hpp"
#include "exceptions.hpp"
Include dependency graph for strides.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tannic::Strides
 Represents the memory strides associated with a tensor shape. More...
 

Namespaces

namespace  tannic
 

Functions

constexpr bool tannic::operator== (Strides const &first, Strides const &second)
 Equality comparison for strides.
 
std::ostream & tannic::operator<< (std::ostream &os, Strides const &strides)
 

Detailed Description

Memory layout specification for tensor dimensions in the Tannic Tensor Library.

Author
Eric Hermosis
Date
2025

Defines tannic::Strides, which determines how elements are spaced in memory across tensor dimensions. Key features:

  • Memory layout control: Row-major (default), column-major, or custom striding.
  • Constexpr support: Compile-time stride computation.
  • Shape integration: Auto-computes contiguous strides from Shape.
  • Negative indexing: Python-style dimension access

All expression-like objects in the library expose an Strides as part of their interface, making this file central to the Tannic design.

See also
Shape.hpp (tensor dimensions), Indexing.hpp (negative index handling)