guanaqo 1.0.0-alpha.26
Utilities for scientific software
Loading...
Searching...
No Matches
guanaqo Namespace Reference

Namespaces

namespace  blas
namespace  detail
namespace  io
namespace  linalg
namespace  pcm
namespace  trace
namespace  tag_invoke_fn_ns
namespace  tag_invoke_ns

Classes

class  any_ptr
 Like std::any, but storing just the pointer, without any dynamic allocation. More...
class  shared_any_ptr
 Like std::any, but storing a shared_ptr, to allow for move-only types. More...
class  AtomicStopSignal
 Cancel a running solver or other job in a thread-safe and signal-safe way. More...
class  callback_streambuf
 An implementation of a std::streambuf that calls the given callback function with the characters that are written. More...
class  scoped_ostream_redirect
 Temporarily replaces the rdbuf of the given ostream. More...
struct  copyable_unique_ptr
 std::unique_ptr is move-only, this class wraps such a pointer and provides copy operations as well. More...
struct  DynamicLoadFlags
 Flags to be passed to dlopen. More...
struct  dynamic_load_error
 Failed to load a DLL or SO file, or failed to access a function in it. More...
struct  invalid_duration_value
struct  invalid_duration_units
struct  with_index_type_t
struct  enumerate_t
struct  is_complex_float
struct  is_complex_float< std::complex< T > >
struct  iter_range_adapter
struct  default_stride
 Get the default stride value for a given integer type (primary template). More...
struct  default_stride< S >
 Get the default stride value for a run-time integer type. More...
struct  MatrixView
 A lightweight view of a 2D matrix. More...
class  MaxHistory
 Keep track of the maximum value over a specified horizon length. More...
struct  noop_delete
 Deleter for std::unique_ptr that just destructs the object, without deallocating. More...
struct  not_implemented_error
class  PrintMatrixView
struct  PrintOpts
struct  CircularIndices
struct  CircularIndexIterator
struct  ReverseCircularIndexIterator
class  CircularRange
class  ReverseCircularRange
struct  set_intersection_iterable
struct  join_opt
struct  join_quote_opt
struct  TimingsCPU
 Measures the number of invocations of a specific piece of code and its run time. More...
struct  Timed< TimingsCPU >
 RAII class for measuring wall and CPU time. More...
struct  Timed
struct  Timed< std::chrono::duration< Rep, Period > >
struct  TraceLogger
 Class for recording trace logs, used when ITT or Perfetto tracing is not enabled. More...
class  bad_type_erased_type
class  bad_type_erased_constness
struct  CopyMoveDestroyVTable
struct  BasicVTable
 Struct that stores pointers to functions to copy, move or destroy a polymorphic object. More...
class  TypeErased
 Class for polymorphism through type erasure. More...
struct  class_from_member_ptr_impl
struct  class_from_member_ptr_impl< Ret(C::*)(Args...)>
struct  class_from_member_ptr_impl< Ret(C::*)(Args...) const >
struct  last_type
struct  last_type< Only >
struct  first_type_or_void
struct  first_type_or_void< First, Pack... >
struct  first_type_or_void<>

Concepts

concept  float_or_complex_float
concept  tag_invocable
concept  nothrow_tag_invocable
concept  derived_from_TypeErased
concept  no_leading_allocator

Typedefs

template<class T, class I = ptrdiff_t, class S = std::integral_constant<I, 1>>
using MatrixViewRM = MatrixView<T, I, S, StorageOrder::RowMajor>
 Convenience alias for a row-major MatrixView.
template<class NewAlias, class... PossibleAliases>
using possible_alias_t
 If NewAlias is not the same type as any of PossibleAliases, the result is NewAlias.
template<typename Tag, typename... Args>
using tag_invoke_result
template<typename Tag, typename... Args>
using tag_invoke_result_t
template<auto & Tag>
using tag_t = std::decay_t<decltype(Tag)>
template<class F>
using required_function_t = typename detail::required_function<F>::type
 A required function includes a void pointer to self, in addition to the arguments of F.
template<class F, class VTable>
using optional_function_t = typename detail::optional_function<F, VTable>::type
 An optional function includes a void pointer to self, the arguments of F, and an additional reference to the VTable, so that it can be implemented in terms of other functions.
template<class M>
using class_from_member_ptr_impl_t
template<auto M>
using class_from_member_ptr_t = class_from_member_ptr_impl_t<decltype(M)>
template<class... Pack>
using last_type_t = typename last_type<Pack...>::type
template<class... Pack>
using first_type_or_void_t = typename first_type_or_void<Pack...>::type

Enumerations

enum class  LoopDir : bool { LoopDir::Forward , LoopDir::Backward }
 Direction for chunked iteration. More...
enum class  StorageOrder : bool { StorageOrder::ColMajor , StorageOrder::RowMajor }
 Storage order of matrices. More...
enum class  Triangular { Triangular::Lower , Triangular::StrictlyLower , Triangular::Upper , Triangular::StrictlyUpper }
 Triangular matrix structure. More...

Functions

std::string demangled_typename (const std::type_info &t)
 Get the pretty name of the given type as a string.
std::shared_ptr< void > load_lib (const std::filesystem::path &so_filename, DynamicLoadFlags flags)
 Load a DLL or DSO file.
void * load_func (void *lib_handle, const std::string &name)
 Get a pointer to a function inside of a loaded DLL or SO file.
template<class Rep, class Period>
std::string_view parse_single_duration (std::chrono::duration< Rep, Period > &t, std::string_view s)
 Adds the first duration in the string s to the duration t.
template<class Rep, class Period>
void parse_duration (std::chrono::duration< Rep, Period > &t, std::string_view s)
 Adds the sum of the durations in the string s to the duration t.
template<class Derived>
auto as_span (Eigen::DenseBase< Derived > &v)
 Convert an Eigen vector view to a std::span.
template<class Derived>
auto as_span (Eigen::DenseBase< Derived > &&v)
 Convert an Eigen vector view to a std::span.
template<class Derived>
auto as_span (const Eigen::DenseBase< Derived > &v)
 Convert an Eigen vector view to a std::span.
template<class T, size_t E>
auto as_eigen (std::span< T, E > s)
 Convert a std::span to an Eigen::Vector view.
template<class T, size_t E>
auto as_vec (std::span< T, E > s)
template<class Derived, class I = typename Derived::Index>
auto as_view (Eigen::DenseBase< Derived > &M, with_index_type_t< I >={})
 Convert an Eigen matrix view to a guanaqo::MatrixView.
template<class Derived, class I = typename Derived::Index>
auto as_view (const Eigen::DenseBase< Derived > &M, with_index_type_t< I >={})
 Convert an Eigen matrix view to a guanaqo::MatrixView.
template<class Derived, class I = typename Derived::Index>
auto as_view (Eigen::DenseBase< Derived > &&M, with_index_type_t< I >={})
 Convert an Eigen matrix view to a guanaqo::MatrixView.
template<class Derived, class I = typename Derived::Index>
auto as_view (const Eigen::DenseBase< Derived > &&M, with_index_type_t< I >={})
 Convert an Eigen matrix view to a guanaqo::MatrixView.
template<class T, class I, class S, StorageOrder O>
auto as_eigen (MatrixView< T, I, S, O > M)
 Convert a guanaqo::MatrixView to an Eigen::Matrix view.
template<class Rng>
auto enumerate (Rng &&rng)
template<class T>
std::from_chars_result from_chars (const char *first, const char *last, T &value, std::chars_format fmt=std::chars_format::general)
template<class T>
std::from_chars_result from_chars (const char *first, const char *last, T &value, int base=10)
template<class T, class... Args>
std::from_chars_result from_chars (const char *first, const char *last, T &value, std::chars_format fmt=std::chars_format::general)
template<class T, class... Args>
std::from_chars_result from_chars (const char *first, const char *last, T &value, int base=10)
template<std::floating_point F>
std::string float_to_str (F value, int precision)
template<std::floating_point F>
void print_elem (std::span< char > buf, F value, std::ostream &os)
template<std::integral I>
void print_elem (auto &, I value, std::ostream &os)
template<std::floating_point F>
void print_elem (std::span< char > buf, std::complex< F > value, std::ostream &os)
template<class T>
T * start_lifetime_as_array (void *p, size_t n) noexcept
template<class T>
const T * start_lifetime_as_array (const void *p, size_t n) noexcept
template<class T>
T * start_lifetime_as (void *p) noexcept
template<class T>
const T * start_lifetime_as (const void *p) noexcept
template<class I>
void foreach_chunked (I i_begin, I i_end, auto chunk_size, auto func_chunk, auto func_rem, LoopDir dir=LoopDir::Forward)
template<class I>
void foreach_chunked_merged (I i_begin, I i_end, auto chunk_size, auto func_chunk, LoopDir dir=LoopDir::Forward)
template<class I, I R, I C, class F>
consteval auto make_2d_lut (F f)
 Returns a 2D array of the form:
template<class I, I N, class F>
consteval auto make_1d_lut (F f)
 Returns an array of the form:
template<auto... Ranges, class F>
consteval auto make_lut (F f)
 Generalization of make_1d_lut and make_2d_lut.
constexpr StorageOrder transpose (StorageOrder o)
 Transpose the storage order (swaps row and column major).
 PERFETTO_USE_CATEGORIES_FROM_NAMESPACE (guanaqo::trace)
template<std::floating_point F>
std::string_view float_to_str_vw (std::span< char > buf, F value, int precision=std::numeric_limits< F >::max_digits10)
template<class T, std::size_t E>
std::ostream & print_csv (std::ostream &os, std::span< T, E > x, PrintOpts opts={})
template<class T, class I, class S, StorageOrder O>
std::ostream & print_csv (std::ostream &os, MatrixView< T, I, S, O > X, PrintOpts opts={})
template<class T, std::size_t E>
std::ostream & print_matlab (std::ostream &os, std::span< T, E > x, std::string_view end=";\n")
template<class T, class I, class S, StorageOrder O>
std::ostream & print_matlab (std::ostream &os, MatrixView< T, I, S, O > X, std::string_view end=";\n")
template<class T, std::size_t E>
std::ostream & print_python (std::ostream &os, std::span< T, E > x, std::string_view end="\n", bool squeeze=true)
template<class T, class I, class S, StorageOrder O>
std::ostream & print_python (std::ostream &os, MatrixView< T, I, S, O > X, std::string_view end="\n", bool squeeze=true)
template<std::ranges::viewable_range R1, std::ranges::viewable_range R2, class Comp = std::ranges::less, class Proj1 = std::identity, class Proj2 = std::identity>
set_intersection_iterable< std::ranges::views::all_t< R1 >, std::ranges::views::all_t< R2 >, Comp, Proj1, Proj2 > iter_set_intersection (R1 &&r1, R2 &&r2, Comp comp={}, Proj1 proj1={}, Proj2 proj2={})
auto split (std::string_view full, std::string_view tok)
 Split the string full on the first occurrence of tok.
auto split_second (std::string_view full, std::string_view tok)
 Split the string s on the first occurrence of tok.
std::string join (std::ranges::input_range auto strings, join_opt opt={})
 Join the list of strings into a single string, using the separator given by opt.
std::string join_quote (std::ranges::input_range auto strings, join_quote_opt opt={})
 Join the list of strings into a single string, using the separator given by opt.
void sort_case_insensitive (auto &range)
 Sort the given range of strings in-place in a case-insensitive manner.
std::ostream & operator<< (std::ostream &, TimingsCPU)
template<class T, class F, class... Args>
decltype(auto) timed (T &time, F &&func, Args &&...args)
TraceLoggerget_trace_logger ()
 Get a reference to the global trace logger instance.
template<class Class, auto Method, class... ExtraArgs>
constexpr auto type_erased_wrapped ()
 Returns a function that accepts a void pointer, casts it to the class type of the member function Method, launders it, and then invokes Method with it, passing on the arguments to Method.
template<class VTable, class Allocator>
constexpr size_t default_te_buffer_size ()
template<class... Types>
constexpr size_t required_te_buffer_size_for ()
template<class IndexT>
bool operator== (CircularIndices< IndexT > a, CircularIndices< IndexT > b)
template<class IndexT>
bool operator!= (CircularIndices< IndexT > a, CircularIndices< IndexT > b)
template<class IndexT>
bool operator== (CircularIndexIterator< IndexT > a, CircularIndexIterator< IndexT > b)
template<class IndexT>
bool operator!= (CircularIndexIterator< IndexT > a, CircularIndexIterator< IndexT > b)
template<class IndexT>
bool operator== (ReverseCircularIndexIterator< IndexT > a, ReverseCircularIndexIterator< IndexT > b)
template<class IndexT>
bool operator!= (ReverseCircularIndexIterator< IndexT > a, ReverseCircularIndexIterator< IndexT > b)

Variables

template<class I>
constexpr with_index_type_t< I > with_index_type
template<class T>
constexpr bool is_complex_float_v = is_complex_float<T>::value
constexpr tag_invoke_fn_ns::tag_invoke_fn guanaqo_tag_invoke = {}
 The tag_invoke customization point object.
template<typename Tag, typename... Args>
constexpr bool is_tag_invocable_v = tag_invocable<Tag, Args...>
template<typename Tag, typename... Args>
constexpr bool is_nothrow_tag_invocable_v
template<class T>
constexpr CopyMoveDestroyVTable copy_move_destroy_vtable

Class Documentation

◆ guanaqo::with_index_type_t

struct guanaqo::with_index_type_t
Collaboration diagram for guanaqo::with_index_type_t< I >:

◆ guanaqo::class_from_member_ptr_impl

struct guanaqo::class_from_member_ptr_impl
Collaboration diagram for guanaqo::class_from_member_ptr_impl< M >:

◆ guanaqo::class_from_member_ptr_impl< Ret(C::*)(Args...)>

struct guanaqo::class_from_member_ptr_impl< Ret(C::*)(Args...)>
Collaboration diagram for guanaqo::class_from_member_ptr_impl< Ret(C::*)(Args...)>:
Class Members
typedef C type C

◆ guanaqo::class_from_member_ptr_impl< Ret(C::*)(Args...) const >

struct guanaqo::class_from_member_ptr_impl< Ret(C::*)(Args...) const >
Collaboration diagram for guanaqo::class_from_member_ptr_impl< Ret(C::*)(Args...) const >:
Class Members
typedef add_const_t< C > type std::add_const_t<C>

Typedef Documentation

◆ class_from_member_ptr_impl_t

Function Documentation

◆ print_elem() [1/3]

template<std::floating_point F>
void guanaqo::print_elem ( std::span< char > buf,
F value,
std::ostream & os )

Definition at line 21 of file print.tpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_elem() [2/3]

template<std::integral I>
void guanaqo::print_elem ( auto & ,
I value,
std::ostream & os )

Definition at line 26 of file print.tpp.

◆ print_elem() [3/3]

template<std::floating_point F>
void guanaqo::print_elem ( std::span< char > buf,
std::complex< F > value,
std::ostream & os )

Definition at line 31 of file print.tpp.

Here is the call graph for this function:

◆ PERFETTO_USE_CATEGORIES_FROM_NAMESPACE()

guanaqo::PERFETTO_USE_CATEGORIES_FROM_NAMESPACE ( guanaqo::trace )

Variable Documentation

◆ with_index_type

template<class I>
with_index_type_t<I> guanaqo::with_index_type
constexpr

Definition at line 17 of file view.hpp.

◆ is_complex_float_v

template<class T>
bool guanaqo::is_complex_float_v = is_complex_float<T>::value
inlineconstexpr

Definition at line 19 of file float.hpp.