Active the current backbone. More...
#include "concepts/util.h"#include "util/tuple.h"#include "util/named.h"#include "util/reflection.h"#include "util/apply_all.h"#include "concepts/macro.h"#include "concepts/backbone/type_traits.h"#include "concepts/backbone/ordered.h"#include "concepts/backbone/math.h"#include "concepts/backbone/horizontal.h"#include "concepts/backbone/control.h"#include "concepts/backbone/gradient.h"#include "concepts/backbone/complex.h"#include "concepts/backbone/random.h"#include "concepts/backbone/stringconvert.h"Go to the source code of this file.
Classes | |
| struct | string_converter< T > |
| string convert of backbone types More... | |
Namespaces | |
| namespace | backbone |
| Random number generator; built on top of Drjit. | |
| namespace | bbm |
Macros | |
| #define | BBM_BACKBONE_IMPORT(Config) |
| BBM_BACKBONE_IMPORT: will be called each time BBM_IMPORT_CONFIG is called; default do nothing. | |
| #define | BBM_VALIDATE_BACKBONE(TYPE) |
| Helper Macro to validate the backbone for a given type. | |
| #define | BBM_CALL_BACKBONE_OP(OpName) |
| Helper macro: extend existing methods to support attribute types. | |
control methods | |
| #define | BBM_CALL_BACKBONE_FUNC(FuncName) |
Functions | |
| template<typename T > | |
| remove_diff_t< T > & | detach_gradient (T &) |
| template<typename T > | |
| void | track_gradient (T &, bool) |
| template<typename T > | |
| bool | is_gradient_tracked (T &) |
| template<typename T > | |
| const remove_diff_t< T > & | gradient (T &) |
| template<typename T > | |
| void | forward_gradient (T &) |
| template<typename T > | |
| void | backward_gradient (T &) |
| template<typename T > requires false | |
| std::string | toString (const T &) |
| regular drjit::array types | |
| template<typename T > requires false | |
| T | fromString (const std::string &) |
| template<typename RET , typename C , typename Index > requires std::ranges::range<C> && ((std::constructible_from<RET> && // (trivially constructible AND ((is_tuple_v<RET> && is_tuple_v<std::ranges::range_value_t<C>>) || // (tuple OR (named_equivalence_v<RET, std::ranges::range_value_t<C>>) || // named OR (concepts::reflection::supported<RET> && concepts::reflection::supported<std::ranges::range_value_t<C>>))) || // unnamed)) OR requires(C&& c, Index i, index_mask_t<Index> m) {{backbone::lookup<RET>(c,i,m)};}) | |
| RET | lookup (C &&container, const Index &idx, const index_mask_t< Index > &mask=true) |
| Generalize backbone::lookup to include containers of tuples/named tuples/reflection-supported types. | |
| template<typename Value , typename C , typename Index > | |
| void | set (C &&container, const Index &idx, Value &&value, const index_mask_t< Index > &mask=true) |
| Generalization of backbone::set to include tuples/named/reflection-supported objects. | |
math functions | |
| BBM_CALL_BACKBONE_OP (cossin) | |
| BBM_CALL_BACKBONE_OP (eq) | |
| BBM_CALL_BACKBONE_OP (neq) | |
| BBM_CALL_BACKBONE_OP (isnan) | |
| BBM_CALL_BACKBONE_OP (isinf) | |
| BBM_CALL_BACKBONE_OP (isfinite) | |
complex functions | |
| BBM_CALL_BACKBONE_OP (real) | |
| BBM_CALL_BACKBONE_OP (imag) | |
| BBM_CALL_BACKBONE_OP (conj) | |
horizontal methods | |
| BBM_CALL_BACKBONE_OP (hsum) | |
| BBM_CALL_BACKBONE_OP (hprod) | |
| BBM_CALL_BACKBONE_OP (hmax) | |
| BBM_CALL_BACKBONE_OP (hmin) | |
| BBM_CALL_BACKBONE_OP (dot) | |
| BBM_CALL_BACKBONE_OP (norm) | |
| BBM_CALL_BACKBONE_OP (squared_norm) | |
| BBM_CALL_BACKBONE_OP (normalize) | |
| BBM_CALL_BACKBONE_OP (all) | |
| BBM_CALL_BACKBONE_OP (any) | |
| BBM_CALL_BACKBONE_OP (none) | |
| BBM_CALL_BACKBONE_OP (count) | |
select generalization to (named) tuples and types with reflection support | |
| template<typename MASK , typename A > requires (concepts::reflection::supported<A> || is_tuple_v<anonymize_t<A>>) | |
| constexpr auto | select (MASK &&mask, const A &a, const A &b) |
| template<typename MASK , typename A , typename B > requires requires(MASK m, A a, B b) {{bbm::detail::select(m,a,b)};} | |
| constexpr auto | select (MASK &&mask, A &&a, B &&b) |
Gradient methods | |
| template<typename T > | |
| auto | detach_gradient (T &t) |
| Detach the value from the gradient computations. | |
| template<typename T > | |
| auto | gradient (T &t) |
| Return the gradient. | |
| template<typename T > | |
| bool | is_gradient_tracked (const T &t) |
| Checks if gradients are enabled for a variable. | |
| template<typename T > | |
| void | track_gradient (T &t, bool toggle=true) |
| Enable/disable tracking of gradients for a variable. | |
| template<typename T > | |
| void | forward_gradient (T &t) |
| Enable forward gradient tracking. | |
| template<typename T > | |
| void | backward_gradient (T &t) |
| Enable backward/reverse gradient tracking. | |
Active the current backbone.
| #define BBM_BACKBONE_IMPORT | ( | Config | ) |
BBM_BACKBONE_IMPORT: will be called each time BBM_IMPORT_CONFIG is called; default do nothing.
| #define BBM_CALL_BACKBONE_FUNC | ( | FuncName | ) |
| #define BBM_CALL_BACKBONE_OP | ( | OpName | ) |
Helper macro: extend existing methods to support attribute types.
| #define BBM_VALIDATE_BACKBONE | ( | TYPE | ) |
Helper Macro to validate the backbone for a given type.