tenno 0.1.0
Loading...
Searching...
No Matches
tenno Namespace Reference

Data Structures

struct  allocator
 
class  array
 A fixed-size array. More...
 
class  atomic
 The atomic class template provides operations on atomic types. More...
 
class  atomic< char >
 
class  atomic< int >
 
class  atomic< long >
 
class  atomic< U * >
 
struct  default_delete
 
class  expected
 An expected value. More...
 
class  jthread
 The jthread class is a wrapper around std::thread that automatically rejoins the thread on destruction. More...
 
class  lock_guard
 A simple lock guard implementation. More...
 
class  mutex
 A simple mutex implementation. More...
 
class  optional
 An optional value. More...
 
class  range
 A range of elements. More...
 
class  reference_wrapper
 A reference wrapper class. More...
 
class  shared_ptr
 A shared pointer. More...
 
class  unexpected
 An unexpected value. More...
 
class  unique_ptr
 A shared pointer. More...
 
class  vector
 
class  weak_ptr
 A weak pointer. More...
 

Typedefs

typedef size_t size
 
using nullptr_t = decltype(nullptr)
 

Enumerations

enum class  error { out_of_range = 0 , empty , not_initialized , _error_max }
 

Functions

template<typename InputIt , typename OutputIt >
constexpr OutputIt copy (InputIt first, InputIt last, OutputIt d_first)
 Copies the elements in the range [first, last) to the range beginning at d_first.
 
template<class InputIt , class UnaryFunc >
constexpr UnaryFunc for_each (InputIt first, InputIt last, UnaryFunc f)
 Applies the given function f to the result of dereferencing every element in the range [first, last).
 
template<class InputIt , class T >
constexpr T accumulate (InputIt first, InputIt last, T init) noexcept
 Applies the given function f to the result of dereferencing every element in the range [first, last) and returns the result.
 
template<class T >
void swap (T &a, T &b) noexcept
 Exchanges the values of a and b.
 
template<class T , class... Args>
std::enable_if<!std::is_array< T >::value, shared_ptr< T > >::type make_shared (Args &&... args)
 Create a shared pointer with the given arguments.
 
template<class T >
std::enable_if< std::is_array< T >::value, shared_ptr< T > >::type make_shared (tenno::size n)
 
template<class T >
shared_ptr< T > make_shared ()
 Default initialize a shared pointer.
 
template<class T , class Alloc , class... Args>
tenno::shared_ptr< T > allocate_shared (Alloc &alloc, Args &&...args) noexcept
 Create a shared pointer with the given arguments and allocator.
 
template<class T , class Alloc >
shared_ptr< T > allocate_shared (Alloc &alloc) noexcept
 Default initialize a shared pointer with the given allocator.
 
template<class T , class... Args>
constexpr unique_ptr< T > make_unique (Args &&...args)
 Create a unique pointer with the given arguments.
 
constexpr unsigned int lcg (const unsigned int seed)
 
template<const unsigned int it>
constexpr unsigned int gen (const unsigned int N)
 
template<>
constexpr unsigned int gen< 0 > (const unsigned int N)
 
template<const unsigned int it>
constexpr float uniform_real_distribution (const unsigned int seed, const float min=0, const float max=1)
 
template<const tenno::size N, const tenno::size it>
constexpr tenno::array< float, N > random_array_impl (const int seed, const float min, const float max, const tenno::array< float, N > vec)
 
template<const tenno::size N>
constexpr tenno::array< float, N > random_array (const int seed, const float min=0, const float max=1)
 
template<typename T >
constexpr std::remove_reference_t< T > && move (T &&t) noexcept
 Move a value from one location to another.
 

Typedef Documentation

◆ nullptr_t

using tenno::nullptr_t = decltype(nullptr)

Definition at line 14 of file types.hpp.

◆ size

typedef size_t tenno::size

Definition at line 13 of file types.hpp.

Enumeration Type Documentation

◆ error

enum class tenno::error
strong
Enumerator
out_of_range 
empty 
not_initialized 
_error_max 

Definition at line 11 of file error.hpp.

Function Documentation

◆ accumulate()

template<class InputIt , class T >
T tenno::accumulate ( InputIt first,
InputIt last,
T init )
constexprnoexcept

Applies the given function f to the result of dereferencing every element in the range [first, last) and returns the result.

Template Parameters
InputItThe type of the iterator to the first element in the range to apply the function to.
UnaryFuncThe type of the function to apply to the elements in the range.
TThe type of the result of the function.
Parameters
firstThe iterator to the first element in the range to apply the function to.
lastThe iterator to the element after the last element in the range to apply the function to.
fThe function to apply to the elements in the range.
initThe initial value of the result.
Returns
T The result of the function.

Definition at line 83 of file algorithm.hpp.

◆ allocate_shared() [1/2]

template<class T , class Alloc >
shared_ptr< T > tenno::allocate_shared ( Alloc & alloc)
noexcept

Default initialize a shared pointer with the given allocator.

Template Parameters
TThe type of the object to create
AllocThe type of the allocator to use
Parameters
allocThe allocator to use
Returns
shared_ptr<T> The shared pointer to the object

Definition at line 1108 of file memory.hpp.

◆ allocate_shared() [2/2]

template<class T , class Alloc , class... Args>
tenno::shared_ptr< T > tenno::allocate_shared ( Alloc & alloc,
Args &&... args )
noexcept

Create a shared pointer with the given arguments and allocator.

Template Parameters
TThe type of the object to create
AllocThe type of the allocator to use
ArgsThe type of the arguments to pass to the constructor
Parameters
allocThe allocator to use
argsThe arguments to pass to the constructor
Returns
shared_ptr<T> The shared pointer to the object

Definition at line 1091 of file memory.hpp.

◆ copy()

template<typename InputIt , typename OutputIt >
OutputIt tenno::copy ( InputIt first,
InputIt last,
OutputIt d_first )
constexpr

Copies the elements in the range [first, last) to the range beginning at d_first.

Template Parameters
InputItThe type of the iterator to the first element in the range to copy.
OutputItThe type of the iterator to the first element in the range to copy to.
Parameters
firstThe iterator to the first element in the range to copy.
lastThe iterator to the element after the last element in the range to copy.
d_firstThe iterator to the first element in the range to copy to.
Returns
OutputIt The iterator to the element after the last element copied.

Definition at line 28 of file algorithm.hpp.

◆ for_each()

template<class InputIt , class UnaryFunc >
UnaryFunc tenno::for_each ( InputIt first,
InputIt last,
UnaryFunc f )
constexpr

Applies the given function f to the result of dereferencing every element in the range [first, last).

Template Parameters
InputItThe type of the iterator to the first element in the range to apply the function to.
UnaryFuncThe type of the function to apply to the elements in the range.
Parameters
firstThe iterator to the first element in the range to apply the function to.
lastThe iterator to the element after the last element in the range to apply the function to.
fThe function to apply to the elements in the range.
Returns
UnaryFunc The function f.

Definition at line 56 of file algorithm.hpp.

◆ gen()

template<const unsigned int it>
unsigned int tenno::gen ( const unsigned int N)
constexpr

Definition at line 23 of file random.hpp.

◆ gen< 0 >()

template<>
unsigned int tenno::gen< 0 > ( const unsigned int N)
constexpr

Definition at line 28 of file random.hpp.

◆ lcg()

unsigned int tenno::lcg ( const unsigned int seed)
inlineconstexpr

Definition at line 14 of file random.hpp.

◆ make_shared() [1/3]

template<class T >
shared_ptr< T > tenno::make_shared ( )
noexcept

Default initialize a shared pointer.

Template Parameters
TThe type of the object to create
Returns
shared_ptr<T> The shared pointer to the object

Definition at line 1061 of file memory.hpp.

◆ make_shared() [2/3]

template<class T , class... Args>
std::enable_if<!std::is_array< T >::value, shared_ptr< T > >::type tenno::make_shared ( Args &&... args)
noexcept

Create a shared pointer with the given arguments.

Template Parameters
TThe type of the object to create
ArgsThe type of the arguments to pass to the constructor
Parameters
argsThe arguments to pass to the constructor
Returns
shared_ptr<T> The shared pointer to the object
Note
Make shared takes care of the allocation of the object, while the shared pointer takes care of the allocation and deallocation of the internal control block, as well as the deallocation of the object.
The object must accept variadic arguments in the constructor

Definition at line 1017 of file memory.hpp.

◆ make_shared() [3/3]

template<class T >
std::enable_if< std::is_array< T >::value, shared_ptr< T > >::type tenno::make_shared ( tenno::size n)
noexcept

Definition at line 1037 of file memory.hpp.

◆ make_unique()

template<class T , class... Args>
unique_ptr< T > tenno::make_unique ( Args &&... args)
constexpr

Create a unique pointer with the given arguments.

Template Parameters
TThe type of the object to create
ArgsThe type of the arguments to pass to the constructor
Parameters
argsThe arguments to pass to the constructor
Returns
unique_ptr<T> The unique pointer to the object
Note
The object must accept variadic arguments in the constructor

Definition at line 1149 of file memory.hpp.

◆ move()

template<typename T >
std::remove_reference_t< T > && tenno::move ( T && t)
constexprnoexcept

Move a value from one location to another.

Template Parameters
TThe type of the value to move.
Parameters
tThe value to move.
Returns
T&& The moved value.

Definition at line 21 of file utility.hpp.

◆ random_array()

template<const tenno::size N>
tenno::array< float, N > tenno::random_array ( const int seed,
const float min = 0,
const float max = 1 )
constexpr

Definition at line 65 of file random.hpp.

◆ random_array_impl()

template<const tenno::size N, const tenno::size it>
tenno::array< float, N > tenno::random_array_impl ( const int seed,
const float min,
const float max,
const tenno::array< float, N > vec )
constexpr

Definition at line 46 of file random.hpp.

◆ swap()

template<class T >
void tenno::swap ( T & a,
T & b )
noexcept

Exchanges the values of a and b.

Template Parameters
TThe type of the values to swap.
Parameters
aThe first value to swap.
bThe second value to swap.

Definition at line 99 of file algorithm.hpp.

◆ uniform_real_distribution()

template<const unsigned int it>
float tenno::uniform_real_distribution ( const unsigned int seed,
const float min = 0,
const float max = 1 )
constexpr

Definition at line 34 of file random.hpp.