Loading...
Searching...
No Matches
Namespaces | Classes | Concepts | Typedefs | Enumerations | Functions | Variables
bbm Namespace Reference

Namespaces

namespace  col
 
namespace  concepts
 
namespace  embed
 
namespace  endian
 
namespace  fresnel
 
namespace  io
 
namespace  ior
 Namespace for 'ior' and 'reflectance' types.
 
namespace  maskingshadowing
 
namespace  ndf
 
namespace  precomputed
 
namespace  python
 
namespace  reflection
 
namespace  spherical
 
namespace  string
 
namespace  vec
 

Classes

struct  add_const
 
struct  add_const< T >
 
class  aggregatebsdf
 A BSDF that is the aggregate of different BSDFs. More...
 
struct  aggregatemodel_base
 The sum of different BSDF models. More...
 
struct  alternative
 Forward declaration of alternative. Should be specified if a model provides an alternative. More...
 
struct  arg
 Forward declaration of bbm::arg. More...
 
struct  arg< Type, Name, Default >
 
struct  arg< Type, Name, void >
 
struct  arg< void, Name, void >
 Untyped Argument (only a name) More...
 
struct  args
 Forward declaration. More...
 
struct  ashikhminshirley
 the Anisotropic Phong BSSF model by Ashikhmin and Shirley. This implements the specular component of the model. More...
 
struct  ashikhminshirleyfull
 the Anisotropic Phong BSSF model by Ashikhmin and Shirley. This implements the combined diffuse+specular component of the model. The combined model is implemented as a single model due to the dependence of the diffuse term on the specular fresnel reflectance. More...
 
struct  attribute
 Base declaration of attribute; further specialized below. More...
 
struct  attribute< PROP >
 Attributes for non-scalars (leverage inheritance) More...
 
struct  batch
 
struct  bieronL2
 bieronL2 loss function More...
 
struct  bieronL2_error
 Bieron and Peers cosine weighted l2 error. More...
 
struct  bieronLog
 bieronLog loss function More...
 
struct  bieronLog_error
 Bieron and Peers cosine weighted log error. More...
 
class  bitmap
 
class  bsdf
 BSDF implementation of a BSDF model. More...
 
struct  bsdf_base
 Forward declaration. More...
 
struct  bsdf_fresnel_properties
 
struct  bsdf_fresnel_properties< ior::bagher_reflectance< T >, Flag >
 Define a specialized bsdf_parameter for the 2d Bagher et al.'s reflectance. More...
 
struct  bsdf_fresnel_properties< ior::complex_ior< T >, Flag >
 
struct  bsdf_fresnel_properties< ior::ior< T >, Flag >
 
struct  bsdf_fresnel_properties< ior::reflectance< T >, Flag >
 
struct  bsdf_properties
 bsdf_parameter property More...
 
struct  bsdf_ptr
 
struct  bsdfsample
 Structure to hold a sample's direction and PDF. More...
 
class  cast_itr
 Cast iterator; cast the result after deferencing. More...
 
struct  cdf
 CDF data structure. More...
 
struct  compass
 Compass Search. More...
 
struct  constants
 
struct  dependent_false
 
struct  doublePacketRGB
 
struct  doubleRGB
 
struct  floatPacketRGB
 
struct  floatRGB
 
class  he_base
 The directional specular component of the He et al. BSDF model. More...
 
struct  is_named
 
struct  is_named< named< T, NAMES... > >
 
class  lafortune
 The Lafortune BRDF model. This implements the model in Eq. 4 in the original paper linked above: More...
 
struct  lambertian
 The classic diffuse Lambertian BSDF model. More...
 
struct  literal
 
class  loss
 LOSS implementation of a loss function. More...
 
struct  loss_base
 Forward declaration. More...
 
class  loss_ptr
 loss_ptr: a wrapper around a shared_ptr to a loss More...
 
struct  lowL2
 lowL2 loss function More...
 
struct  lowL2_error
 Low et al. cosine weighted l2 error. More...
 
struct  lowLog
 lowLog loss function More...
 
struct  lowLog_error
 Low et al.'s cosine weighted log error. More...
 
class  lowmicrofacet
 The Low et al. Microfacet BRDF model. More...
 
class  lowsmooth
 
class  merl_data
 MERL-MIT sampled reflectance. More...
 
struct  merl_linearizer
 
struct  microfacet
 General microfacet BRDF model. More...
 
struct  microfacet_n
 Predefined normalization factors. More...
 
struct  named
 named container More...
 
struct  named_equivalence
 
struct  named_equivalence< U, V >
 
class  ndf_sampler
 
struct  nganL2
 nganL2 loss function More...
 
struct  nganL2_error
 Standard cosine weighted l2 error. More...
 
class  nganlafortune
 Ngan's Lafortune: standard Lafortune times an additional normalization factor: More...
 
class  optimizer
 OPTIMIZER implementation of a optimization algorithm. More...
 
struct  optimizer_base
 Abstract optimizer base class. More...
 
class  optimizer_ptr
 optimizer_ptr: a wrapper around a shared_ptr to an optimizer More...
 
struct  option_parser
 
class  orennayar
 The Oren-Nayar BSDF microfacet model for diffuse surfaces. More...
 
struct  persistent_reference
 Declaration of persistent_reference specialized below. More...
 
struct  persistent_reference< T >
 Persistent reference (no difference for non const references) More...
 
class  phong
 The modified Phong BSDF model. This is the classic Phong BSDF model with appropriate normalization and sampling methods. More...
 
class  pointer
 Pointer wrapper that takes handle both shared as well as regular (unmanaged) pointers. More...
 
struct  reference
 Non-persistent reference (i.e., cannot take rvalues) More...
 
struct  remove_const
 
struct  remove_const< T >
 
struct  sampledloss_base
 Forward declaration. More...
 
struct  sampledlossfunction
 sampledlossfunction More...
 
struct  scaledmodel
 Scaled BSDF model. More...
 
struct  spherical_linearizer
 
struct  standardLog
 standardLog loss function More...
 
struct  standardLog_error
 Cosine weighted log error weighted by sin theta of in and out. More...
 
struct  string_converter
 forward decalaration More...
 
struct  string_converter< ARGS >
 convert args<...> More...
 
struct  string_converter< bbm::vector< T > >
 convert a bbm vector More...
 
struct  string_converter< bool >
 bool conversion More...
 
struct  string_converter< BSDF_PTR >
 converting a bsdf_ptr to and from a string More...
 
struct  string_converter< double >
 
struct  string_converter< float >
 
struct  string_converter< int >
 
struct  string_converter< long >
 
struct  string_converter< long double >
 
struct  string_converter< long long >
 
struct  string_converter< named< TUP, NAMES... > >
 convert a named tuple More...
 
struct  string_converter< std::array< T, N > >
 convert to a fixed length array More...
 
struct  string_converter< std::string >
 string conversion More...
 
struct  string_converter< std::tuple< Ts... > >
 convert tuple More...
 
struct  string_converter< std::vector< T > >
 convert a std::vector (forward to bbm::vector) More...
 
struct  string_converter< string_literal< N > >
 string_literal conversion (read only) More...
 
struct  string_converter< T >
 string convert of backbone types More...
 
struct  string_converter< unsigned int >
 
struct  string_converter< unsigned long >
 
struct  string_converter< unsigned long long >
 
struct  string_literal
 
struct  tab
 std::array wrapper for precomputed data with optional remapping of the indices. More...
 
struct  vec3dpair
 Structure to hold a pair of directions. More...
 
class  vector
 
class  vector< T >
 vector<bbm::reference> with casting on the inspectors and iterators More...
 
class  ward
 The anisotropic Ward BSDF model. More...
 
class  wardduer
 The anisotropic Ward-Duer BSDF model. More...
 
class  wardduergeislermoroder
 The anisotropic Ward-Duer-Geisler-Moroder BSDF model. More...
 

Concepts

concept  has_constfor_lambda
 Concept to check if a lambda function meets the required signature.
 
concept  has_constforeach_lambda
 Concept to check if a lambda functions meets the required signature.
 

Typedefs

template<symmetry_v V, typename Value >
using symmetry_t = std::conditional_t<(V==symmetry_v::Isotropic), Value, vec2d< Value > >
 Determine the data type for storing isotropic or anisotropic reflectance parameters.
 
template<typename T >
using get_config = typename std::decay_t< T >::Config
 get_config type trait
 
template<typename T >
using Value_t = typename get_config< T >::Value
 
template<typename T >
using Spectrum_t = typename get_config< T >::Spectrum
 
template<typename TUP >
using attribute_tuple_to_args_t = typename bbm::detail::attribute_tuple_to_args_t< std::decay_t< TUP > >::type
 Convert an attribute_tuple_t to a bbm::args.
 
template<typename... MODELS>
using aggregatemodel = aggregatemodel_base<"Aggregate"_sl, MODELS... >
 The sum of different BSDF models.
 
template<typename CONF , string_literal NAME = "Bagher">
using bagher = scaledmodel< microfacet< ndf::sgd< CONF >, maskingshadowing::uncorrelated< CONF >, fresnel::bagher< CONF >, microfacet_n::Cook, NAME >, bsdf_attr::SpecularScale >
 Bagher et al.'s Microfacet BSDF with Shifted Gamma Distribution.
 
template<typename CONF , string_literal NAME = "CookTorrance">
using cooktorrance = scaledmodel< microfacet< ndf::beckmann< CONF, symmetry_v::Isotropic, false >, maskingshadowing::vgroove< CONF >, fresnel::cook< CONF >, microfacet_n::Cook, NAME >, bsdf_attr::SpecularScale >
 Cook-Torrance microfacet BSDF model.
 
template<typename CONF , string_literal NAME = "CookTorranceHeitz">
using cooktorranceheitz = scaledmodel< microfacet< ndf::beckmann< CONF, symmetry_v::Anisotropic >, maskingshadowing::heightcorrelated< CONF >, fresnel::cook< CONF >, microfacet_n::Walter, NAME >, bsdf_attr::SpecularScale >
 Microfacet BSDF with Anisotropic Beckmann-based NDF.
 
template<typename CONF , string_literal NAME = "CookTorranceWalter">
using cooktorrancewalter = scaledmodel< microfacet< ndf::beckmann< CONF, symmetry_v::Isotropic >, maskingshadowing::uncorrelated< CONF >, fresnel::cook< CONF >, microfacet_n::Walter, NAME >, bsdf_attr::SpecularScale >
 Microfacet BSDF with Beckmann-based NDF.
 
template<typename CONF , string_literal NAME = "GGX">
using ggx = scaledmodel< microfacet< ndf::ggx< CONF, symmetry_v::Isotropic >, maskingshadowing::uncorrelated< CONF >, fresnel::cook< CONF >, microfacet_n::Walter, NAME >, bsdf_attr::SpecularScale >
 Microfacet BSDF with GGX-based NDF.
 
template<typename CONF , string_literal NAME = "GGXHeitz">
using ggxheitz = scaledmodel< microfacet< ndf::ggx< CONF, symmetry_v::Anisotropic >, maskingshadowing::heightcorrelated< CONF >, fresnel::cook< CONF >, microfacet_n::Walter, NAME >, bsdf_attr::SpecularScale >
 Microfacet BSDF with anisotropic GGX-based NDF with heigh correlated shadowing and masking.
 
template<typename CONF , ndf::epd_normalization NORMALIZATION = ndf::epd_normalization::Compute, string_literal NAME = "EPD">
using epd = microfacet< ndf::epd< CONF >, maskingshadowing::vanginneken< CONF >, fresnel::complex< CONF >, microfacet_n::Walter, NAME >
 Exponential Power Distribution microfacet model.
 
template<typename CONF , string_literal NAME = "LowAshikhminShirley">
using lowashikhminshirley = scaledmodel< ashikhminshirley< CONF, fresnel::cook< CONF, ior::ior< Value_t< CONF > > >, symmetry_v::Isotropic, NAME >, bsdf_attr::SpecularScale >
 Low et al.'s version of the specular component of the Ashikhmin-Shirley BSDF: uses the Cook-Torrance Fresnel component with index of refraction.
 
template<typename CONF , string_literal NAME = "LowCookTorrance">
using lowcooktorrance = cooktorrance< CONF, "LowCookTorrance">
 Low et al.'s version of the specular component of the Cook-Torrance BSDF; this directly mirrors the original Cook-Torrance implementation.
 
template<typename CONF , string_literal NAME = "LowMicrofacetFit">
using lowmicrofacetfit = lowmicrofacet< CONF, microfacet_n::Cook, NAME >
 Shorthand for the Low BSDF model compatible with the fits listed in their supplemental material which differs from the model in the paper by using a different normalization factor.
 
template<typename CONF , string_literal NAME = "NganWard">
using nganward = ward< CONF, symmetry_v::Isotropic, NAME >
 Ngan's Ward: standard Ward with isotropic roughness. This can be achieved with a simple alias.
 
template<typename CONF , string_literal NAME = "NganWardDuer">
using nganwardduer = wardduer< CONF, symmetry_v::Isotropic, NAME >
 Ngan's Ward-Duer: stanard Ward-Duer with isotropic roughness. This can be achieved with a simple alias.
 
template<typename CONF , string_literal NAME = "NganBlinnPhong">
using nganblinnphong = phong< CONF, NAME >
 Ngan's Blinn-Phong: same as modifed phong; a simple alias suffices.
 
template<typename CONF , string_literal NAME = "NganCookTorrance">
using ngancooktorrance = scaledmodel< microfacet< ndf::beckmann< CONF, symmetry_v::Isotropic >, maskingshadowing::vgroove< CONF >, fresnel::schlick< CONF >, microfacet_n::Cook, NAME >, bsdf_attr::SpecularScale >
 Ngan's Cook-Torrance is normalized by pi, is isotropic, and has vgroove masking and shadowing, schlick fresnel, F0 reflectance, and backman distribution.
 
template<typename CONF , string_literal NAME = "NganAshikhminShirley">
using nganashikhminshirley = scaledmodel< ashikhminshirley< CONF, fresnel::schlick< CONF, ior::reflectance< Value_t< CONF > > >, symmetry_v::Isotropic, NAME >, bsdf_attr::SpecularScale >
 Ngan's Ashkihmin-Shirley model; does not include Ashikhmin-Shirley's diffuse component, and it is isotropic. THis can be achieved with a simple alias.
 
template<typename CONF >
using nganhe = scaledmodel< ndf_sampler< he_base< CONF, fresnel::cook< CONF >, he_eq25::Errata, he_eq78::Westin, 4, 64, true, 18 >, 90, 1, "NganHe">, bsdf_attr::SpecularScale >
 Ngan's He et al.'s BSDF likely uses the Westin et al. formulation but with non-complex eta.
 
template<typename CONF , string_literal NAME = "PhongWalter">
using phongwalter = scaledmodel< microfacet< ndf::phong< CONF >, maskingshadowing::uncorrelated< CONF >, fresnel::cook< CONF >, microfacet_n::Walter, NAME >, bsdf_attr::SpecularScale >
 Microfacet BSDF with Phong-based NDF.
 
template<typename CONF , string_literal NAME = "Ribardiere">
using ribardiere = scaledmodel< microfacet< ndf::studentt< CONF, symmetry_v::Isotropic >, maskingshadowing::uncorrelated< CONF >, fresnel::cook< CONF >, microfacet_n::Walter, NAME >, bsdf_attr::SpecularScale >
 Microfacet BSDF with Student-T based NDF.
 
template<typename CONF , string_literal NAME = "RibardiereAnisotropic">
using ribardiereanisotropic = scaledmodel< microfacet< ndf::studentt< CONF, symmetry_v::Anisotropic >, maskingshadowing::uncorrelated< CONF >, fresnel::cook< CONF >, microfacet_n::Walter, NAME >, bsdf_attr::SpecularScale >
 Microfacet BSDF with the Anisotropic Student-T based NDF.
 
template<typename T >
using mat2d = bbm::detail::mat< vec2d< T >, 2 >
 2D matrix
 
template<typename T >
using mat3d = bbm::detail::mat< vec3d< T >, 3 >
 3D matrix
 
using dl_handle_t = void *
 
template<typename Config >
using merl = ndf_sampler< merl_data< Config, "Merl">, 90, 1 >
 Data-driven MERL BSDF model with data-driven backscatter based importance sampling.
 
template<typename T >
using attribute_value_t = bbm::detail::attribute_value< std::decay_t< T > >::type
 return the type of value(t)
 
template<typename T >
using value_copy_named_t = decltype(value_copy_named(std::declval< T >()))
 type of value copying a named typle
 
template<typename... T>
using named_cat_t = decltype(named_cat(std::declval< T >()...))
 type of concatting multiple named tuples.
 
template<size_t START, size_t COUNT, typename NAMED >
using subnamed_t = decltype(subnamed< START, COUNT, NAMED >(std::declval< NAMED >()))
 type of subnamed
 
template<string_literal PREFIX, typename T >
using prefix_names_t = decltype(prefix_names< PREFIX >(std::declval< T >()))
 type of named tuple with pre-fixed name.
 
template<string_literal POSTFIX, typename T >
using postfix_names_t = decltype(post_names< POSTFIX >(std::declval< T >()))
 type of named tuple with post-fixed name.
 
template<typename T >
using const_reference = reference< bbm::add_const_t< T > >
 const non-persistent reference
 
template<typename T >
using const_persistent_reference = persistent_reference< bbm::add_const_t< T > >
 const_persistent_reference
 
template<typename T >
using to_tuple_t = decltype(to_tuple(std::declval< T >()))
 type of converting a type that supports std::get to a tuple
 
template<typename T >
using value_copy_tuple_t = decltype(value_copy_tuple(std::declval< std::decay_t< T > >()))
 value-copy type of a tuple.
 
template<typename... Ts>
using tuple_cat_t = decltype(std::tuple_cat(std::declval< Ts >()...))
 tuple_cat_t
 
template<size_t START, size_t COUNT, typename TUP >
using subtuple_t = decltype(subtuple< START, COUNT >(std::declval< TUP >()))
 subtuple type
 
template<typename T >
using tuple_flatten_t = decltype(tuple_flatten(std::declval< std::decay_t< T > >()))
 flattened tuple type
 
template<typename T >
using tuple_add_const_t = decltype(tuple_add_const(std::declval< std::decay_t< T > >()))
 tuple_add_const type
 
template<typename T >
using tuple_remove_const_t = decltype(tuple_remove_const(std::declval< std::decay_t< T > >()))
 tuple_remove_const type
 
template<template< typename > typename TRAIT, typename... Ts>
using find_first = typename bbm::detail::find_first_impl< TRAIT, void, Ts... >::type
 Find first type that matches a type_trait.
 
Predefined Default BSDF attributes <br>
template<typename T , bsdf_attr Flag, literal Default = 1.0, literal UpperBound = std::numeric_limits<scalar_t<T>>::max(), literal LowerBound = 0.0>
using bsdf_parameter = attribute< bsdf_properties< T, Flag, Default, UpperBound, LowerBound > >
 
template<typename T , bsdf_attr Flag>
using bsdf_scale = attribute< bsdf_properties< T, Flag, 0.5, 1.0 > >
 
template<typename T >
using diffuse_scale = bsdf_scale< T, bsdf_attr::DiffuseScale >
 
template<typename T >
using specular_scale = bsdf_scale< T, bsdf_attr::SpecularScale >
 
template<typename T , bsdf_attr Flag>
using bsdf_roughness = attribute< bsdf_properties< T, Flag, 0.1, 1.0, constants< scalar_t< T > >::Epsilon()> >
 
template<typename T >
using diffuse_roughness = bsdf_roughness< T, bsdf_attr::DiffuseParameter >
 
template<typename T >
using specular_roughness = bsdf_roughness< T, bsdf_attr::SpecularParameter >
 
template<typename T , bsdf_attr Flag>
using bsdf_sharpness = attribute< bsdf_properties< T, Flag, 32.0 > >
 
template<typename T >
using diffuse_sharpness = bsdf_sharpness< T, bsdf_attr::DiffuseParameter >
 
template<typename T >
using specular_sharpness = bsdf_sharpness< T, bsdf_attr::SpecularParameter >
 
template<typename T , bsdf_attr Flag = bsdf_attr::SpecularParameter>
using fresnel_parameter = attribute< bsdf_fresnel_properties< T, Flag > >
 
He BSDF Variants with data-driven importance sampling
template<typename CONF , string_literal NAME = "He">
using he = ndf_sampler< he_base< CONF, fresnel::complex< CONF, Spectrum_t< CONF > >, he_eq25::WithoutExp, he_eq78::Regular, 4, 64, true, 18 >, 90, 1, NAME >
 
template<typename CONF , string_literal NAME = "HeWestin">
using hewestin = ndf_sampler< he_base< CONF, fresnel::complex< CONF, Spectrum_t< CONF > >, he_eq25::Errata, he_eq78::Westin, 4, 64, true, 18 >, 90, 1, NAME >
 
template<typename CONF , string_literal NAME = "HeHolzschuch">
using heholzschuch = ndf_sampler< he_base< CONF, fresnel::complex< CONF, Spectrum_t< CONF > >, he_eq25::Errata, he_eq78::Regular, 4, 10, false >, 90, 1, NAME >
 
Create a bbm::args type from either a list of bbm::arg or an bbm::args.
template<typename... Ts>
using add_args = detail::add_args_impl< Ts... >
 
template<typename... Ts>
using add_args_t = typename add_args< Ts... >::type
 
Iterable container type traits
template<typename T >
using iterable_value_t = std::decay_t< decltype(*bbm::begin(std::declval< T >()))>
 
add_const (reference and pointer robust)
template<typename T >
using add_const_t = typename add_const< T >::type
 
remove_const (reference and pointer robust)

@{

template<typename T >
using remove_const_t = typename remove_const< T >::type
 

Enumerations

enum struct  bsdf_attr {
  None = 0x0000 , DiffuseScale = 0x0001 , DiffuseParameter = 0x0002 , SpecularScale = 0x0004 ,
  SpecularParameter = 0x0008 , Dependent = 0x0010 , Diffuse = DiffuseScale | DiffuseParameter , Specular = SpecularScale | SpecularParameter ,
  Scale = DiffuseScale | SpecularScale , Parameter = DiffuseParameter | SpecularParameter , All = Specular | Diffuse
}
 Attribute Property Flags. More...
 
enum struct  bsdf_flag { None = 0x0000 , Diffuse = 0x0001 , Specular = 0x0002 , All = Diffuse | Specular }
 Reflectance Component Evaluation Flags. More...
 
enum struct  bsdf_prop {
  None = 0x0 , Static = 0x1000000 , Diffuse = 0x00000001 , Specular = 0x00000002 ,
  Combined = Diffuse | Specular , Depricated = 0x00000004 , Alternative = 0x00000008 | Depricated , Convertible = 0x00000010 | Alternative ,
  Unnormalized = 0x0000100 , NonReciprocal = 0x0000200 , GrazingAngle = 0x0000400 , NonEnergyConservative = 0x0000800 | GrazingAngle ,
  ApproximateReflectance = 000001000
}
 BSDF property flags. More...
 
enum struct  symmetry_v { Isotropic = 0x0001 , Anisotropic = 0x0002 }
 symmetry variants. More...
 
enum struct  unit_t { Radiance = 0x0000 , Importance = 0x0001 }
 Light Unit. More...
 
enum struct  he_eq25 { WithoutExp , Errata }
 Masking term scale in Eq 25. More...
 
enum struct  he_eq78 { Regular , Westin }
 Eq. 78 variants: More...
 

Functions

 BBM_CHECK_CONCEPT (concepts::sampledlossfunction, batch< concepts::archetype::sampledlossfunction<> >)
 
 BBM_CHECK_CONCEPT (concepts::bsdf, bsdf< bsdfmodel<> >)
 
 BBM_ENUM (bsdf_attr, None, DiffuseScale, DiffuseParameter, SpecularScale, SpecularParameter, Dependent, Diffuse, Specular, Scale, Parameter, All)
 
template<typename BSDF >
requires bbm::concepts::bsdf<BSDF>
std::ostream & operator<< (std::ostream &s, const BSDF &bsdf)
 
template<typename MODEL , typename CALLBACK >
requires concepts::bsdfmodel<MODEL>
void enumerate_parameters (bsdf_attr flag, MODEL &&model, CALLBACK &&callback)
 Enumerate the values of the attributes from a bsdf model.
 
template<typename MODEL , typename CALLBACK >
requires concepts::bsdfmodel<MODEL>
void enumerate_default_parameters (bsdf_attr flag, MODEL &&model, CALLBACK &&callback)
 Enumerate the default values of the attributes from a bsdf model.
 
template<typename MODEL , typename CALLBACK >
requires concepts::bsdfmodel<MODEL>
void enumerate_lower_bound (bsdf_attr flag, MODEL &&model, CALLBACK &&callback)
 Enumerate the lower bounds of the attributes from a bsdf model.
 
template<typename MODEL , typename CALLBACK >
requires concepts::bsdfmodel<MODEL>
void enumerate_upper_bound (bsdf_attr flag, MODEL &&model, CALLBACK &&callback)
 Enumerate the upper bounds of the attributes from a bsdf model.
 
template<typename MODEL >
requires (concepts::bsdfmodel<MODEL> && !concepts::bsdf<MODEL>)
auto parameter_values (MODEL &&model, bsdf_attr flag=bsdf_attr::All)
 Enumerate the parameters of a BSDF model in a vector.
 
template<typename BSDF >
requires concepts::bsdf<BSDF>
auto parameter_values (BSDF &bsdf, bsdf_attr flag=bsdf_attr::All)
 Enumerate the parameters of a BSDF in a vector.
 
template<typename MODEL >
requires (concepts::bsdfmodel<MODEL> && !concepts::bsdf<MODEL>)
auto parameter_default_values (MODEL &&model, bsdf_attr flag=bsdf_attr::All)
 Enumerate the default parameters of a BSDF model in a vector.
 
template<typename BSDF >
requires concepts::bsdf<BSDF>
auto parameter_default_values (const BSDF &bsdf, bsdf_attr flag=bsdf_attr::All)
 Enumerate the default parameters of a BSDF in a vector.
 
template<typename MODEL >
requires (concepts::bsdfmodel<MODEL> && !concepts::bsdf<MODEL>)
auto parameter_lower_bound (MODEL &&model, bsdf_attr flag=bsdf_attr::All)
 Enumerate the lower bound of the parameters of a BSDF model in a vector.
 
template<typename BSDF >
requires concepts::bsdf<BSDF>
auto parameter_lower_bound (const BSDF &bsdf, bsdf_attr flag=bsdf_attr::All)
 Enumerate the lower bound of the parameters of a BSDF in a vector.
 
template<typename MODEL >
requires (concepts::bsdfmodel<MODEL> && !concepts::bsdf<MODEL>)
auto parameter_upper_bound (MODEL &&model, bsdf_attr flag=bsdf_attr::All)
 Enumerate the upper bound of the parameters of a BSDF model in a vector.
 
template<typename BSDF >
requires concepts::bsdf<BSDF>
auto parameter_upper_bound (const BSDF &bsdf, bsdf_attr flag=bsdf_attr::All)
 Enumerate the upper bound of the parameters of a BSDF in a vector.
 
 BBM_ENUM (bsdf_flag, None, Diffuse, Specular, All)
 
template<typename BSDFMODEL >
alternative< BSDFMODEL >::type make_alternative (const BSDFMODEL &src)
 COnstruct an equivalent alternative BSDF. Should be specialized for each model that provides this option.
 
std::ostream & operator<< (std::ostream &s, const bbm::bsdf_prop &prop)
 
 BBM_CHECK_CONCEPT (concepts::bsdf_ptr, bsdf_ptr< config >)
 
template<typename BSDFTYPE , typename... ARGS>
requires concepts::bsdf<BSDFTYPE>
bsdf_ptr< get_config< BSDFTYPE > > make_bsdf_ptr (ARGS... args)
 Helper method for making a bsdf_ptr from a BSDF (new construction)
 
template<typename BSDFMODEL , typename... ARGS>
requires (concepts::bsdfmodel<BSDFMODEL> && !concepts::bsdf<BSDFMODEL>)
bsdf_ptr< get_config< BSDFMODEL > > make_bsdf_ptr (ARGS... args)
 Helper method for making a bsdf_ptr from a BSDF MODEL (new construction)
 
template<typename BSDFTYPE >
requires (concepts::bsdf<BSDFTYPE> && !concepts::bsdf_ptr<BSDFTYPE>)
bsdf_ptr< get_config< BSDFTYPE > > make_bsdf_ptr (const BSDFTYPE &arg)
 Helper method for making a bsdf_ptr from a BSDF (copy construction)
 
template<typename BSDFMODEL >
requires (concepts::bsdfmodel<BSDFMODEL> && !concepts::bsdf<BSDFMODEL>)
bsdf_ptr< get_config< BSDFMODEL > > make_bsdf_ptr (const BSDFMODEL &arg)
 Helper method for making a bsdf_ptr from a BSDF MODEL (copy construction)
 
template<typename CONF >
requires concepts::config<CONF>
bsdf_ptr< CONF > make_bsdf_ptr (const bsdf_ptr< CONF > &arg)
 Helper method for making a bsdf_ptr (avoid bsdf_ptr of bsdf_ptr)
 
template<typename BSDFMODEL >
requires bbm::concepts::bsdfmodel<BSDFMODEL>
std::ostream & operator<< (std::ostream &s, const BSDFMODEL &model)
 ostream output uses toString conversion
 
template<typename CONF >
std::ostream & operator<< (std::ostream &s, const bbm::bsdfsample< CONF > &ss)
 
 BBM_DECLARE_FORWARD_IMPORT (bsdfsample)
 
 BBM_DECLARE_FORWARD_IMPORT (vec3dpair)
 
 BBM_DECLARE_CORE_TYPE (Scalar, T, bbm::scalar_t< Value_t< T > >)
 
 BBM_DECLARE_CORE_TYPE (Mask, T, bbm::mask_t< Value_t< T > >)
 
 BBM_DECLARE_CORE_TYPE (Size, T, bbm::index_t< Value_t< T > >)
 
 BBM_DECLARE_CORE_TYPE (BsdfFlag, T, bbm::replace_scalar_t< bbm::remove_diff_t< Value_t< T > >, bbm::bsdf_flag >)
 
 BBM_DECLARE_CORE_TYPE (Constants, T, bbm::constants< Scalar_t< T > >)
 
 BBM_DECLARE_CORE_TYPE (Vec2d, T, bbm::vec2d< Value_t< T > >)
 
 BBM_DECLARE_CORE_TYPE (Mat2d, T, bbm::mat2d< Value_t< T > >)
 
 BBM_DECLARE_CORE_TYPE (Vec3d, T, bbm::vec3d< Value_t< T > >)
 
 BBM_DECLARE_CORE_TYPE (Mat3d, T, bbm::mat3d< Value_t< T > >)
 
 BBM_DECLARE_CORE_TYPE (Complex, T, bbm::complex< Value_t< T > >)
 
 BBM_DECLARE_SHORTHAND (BsdfSample_t, bsdfsample)
 
 BBM_DECLARE_SHORTHAND (Vec3dPair_t, vec3dpair)
 
template<typename PARAM >
requires concepts::diff_parameter<PARAM>
void track_gradients (PARAM &&param, bool toggle=true)
 Enable gradients for a parameter set.
 
template<typename PARAM >
requires concepts::diff_parameter<PARAM>
auto get_gradients (PARAM &&param)
 Get the gradient from a parameter set.
 
template<typename PARAM >
requires concepts::diff_parameter<PARAM>
auto detach_gradients (PARAM &&param)
 Get the detached values from a parameter set.
 
template<typename PARAM >
requires concepts::diff_parameter<PARAM>
void forward_gradients (PARAM &&param)
 Forward computation of gradients on a parameter set.
 
template<typename T >
void backward_gradients (T &&t)
 backward computations => passthrough to backbone
 
 BBM_CHECK_CONCEPT (concepts::loss, loss< lossfunction< config > >)
 
 BBM_CHECK_CONCEPT (concepts::loss_ptr, loss_ptr< config >)
 
template<typename LOSSTYPE , typename... ARGS>
requires concepts::loss<LOSSTYPE>
loss_ptr< get_config< LOSSTYPE > > make_loss_ptr (ARGS &&... args)
 Helper method for making loss_ptr from a LOSS (new construction)
 
template<typename LOSSFUNC , typename... ARGS>
requires (concepts::lossfunction<LOSSFUNC> && !concepts::loss<LOSSFUNC>)
loss_ptr< get_config< LOSSFUNC > > make_loss_ptr (ARGS &&... args)
 Helper method for making a loss_ptr from a LOSS FUNCTION (new construction)
 
template<typename LOSSTYPE >
requires (concepts::loss<LOSSTYPE> && !concepts::loss_ptr<LOSSTYPE>)
loss_ptr< get_config< LOSSTYPE > > make_loss_ptr (const LOSSTYPE &arg)
 Helper method for making a loss_ptr from a LOSS (copy construction)
 
template<typename LOSSFUNC >
requires (concepts::lossfunction<LOSSFUNC> && !concepts::loss<LOSSFUNC>)
loss_ptr< get_config< LOSSFUNC > > make_loss_ptr (const LOSSFUNC &arg)
 Helper method for making a loss_ptr from a LOSS FUNCTION (copy constructor)
 
template<typename CONF >
requires concepts::config<CONF>
loss_ptr< CONF > make_loss_ptr (const loss_ptr< CONF > &arg)
 Helper method for making loss_ptr (avoid loss_ptr of loss_ptr)
 
template<typename NDF >
requires bbm::concepts::ndf<NDF>
std::ostream & operator<< (std::ostream &s, const NDF &ndf)
 
 BBM_CHECK_CONCEPT (concepts::optimizer_ptr, optimizer_ptr< config >)
 
template<typename OPTIMIZER , typename... ARGS>
requires concepts::optimizer<OPTIMIZER>
optimizer_ptr< get_config< OPTIMIZER > > make_optimizer_ptr (ARGS &&... args)
 Helper method for making an optimizer_ptr from an optimizer (new construction)
 
template<typename OPTIMIZATION_ALGORITHM , typename... ARGS>
requires (concepts::optimization_algorithm<OPTIMIZATION_ALGORITHM> && !concepts::optimizer<OPTIMIZATION_ALGORITHM>)
optimizer_ptr< get_config< OPTIMIZATION_ALGORITHM > > make_optimizer_ptr (ARGS &&... args)
 Helper method for making an optimizer_ptr from a OPTIMIZATION_ALGORITHM.
 
template<typename OPTIMIZER >
requires concepts::optimizer<OPTIMIZER>
optimizer_ptr< get_config< OPTIMIZER > > make_optimizer_ptr (const OPTIMIZER &arg)
 Helper method for making an optimizer_ptr from a OPTIMZER (copy construction)
 
template<typename OPTIMIZATION_ALGORITHM >
requires (concepts::optimization_algorithm<OPTIMIZATION_ALGORITHM> && !concepts::optimizer<OPTIMIZATION_ALGORITHM>)
optimizer_ptr< get_config< OPTIMIZATION_ALGORITHM > > make_optimizer_ptr (const OPTIMIZATION_ALGORITHM &arg)
 Helper method for making an optimizer_ptr from a OPTIMIZATION_ALGORITHM (copy construction)
 
template<typename CONF >
requires concepts::config<CONF>
optimizer_ptr< CONF > make_optimizer_ptr (const optimizer_ptr< CONF > &arg)
 Helper method for making an optimizer_ptr (avoid optimizer_ptr of optimizer_ptr>)
 
 BBM_CHECK_CONCEPT (concepts::sampledlossfunction, bbm::sampledlossfunction< bsdfmodel<>, bsdfmodel<>, samplelossfunction<>, inout_linearizer<> >)
 
 BBM_ENUM (unit_t, Radiance, Importance)
 
template<typename CONF >
std::ostream & operator<< (std::ostream &s, const bbm::vec3dpair< CONF > &rs)
 
template<typename... MODELS>
requires (concepts::bsdfmodel<MODELS> && ...)
aggregatemodel< MODELS... > aggregate (const MODELS &... models)
 Method for simplifying the creation of an aggregate model.
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, ashikhminshirley< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, ashikhminshirleyfull< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, bagher< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, he_base< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, lafortune< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, lambertian< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, lowmicrofacetfit< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, lowsmooth< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, microfacet< ndf<>, maskingshadowing<>, concepts::archetype::fresnel<> >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, nganlafortune< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, orennayar< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, phong< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, ward< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, wardduer< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, wardduergeislermoroder< config >)
 
template<typename T , bbm::string_literal N, typename D >
std::ostream & operator<< (std::ostream &s, const bbm::arg< T, N, D > &arg)
 Print bbm::arg.
 
template<string_literal NAME>
arg< void, NAME > operator""_arg (void)
 arg literal
 
template<typename... ARGS>
requires (bbm::is_arg_v<ARGS> && ...)
std::ostream & operator<< (std::ostream &s, const bbm::args< ARGS... > &args)
 Print bbm::args.
 
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.
 
template<typename VALUE , typename T , typename CALLBACK >
requires (std::convertible_to<T&, VALUE> && std::invocable<CALLBACK, VALUE>)
void enumerate (T &&value, CALLBACK &&callback)
 Convertible to VALUE => callback.
 
template<typename VALUE , typename T , typename CALLBACK >
requires (std::ranges::range<T> && !std::convertible_to<T&, VALUE> && std::invocable<CALLBACK, VALUE>)
void enumerate (T &&obj, CALLBACK &&callback)
 iterable object => enumerate(begin(), ..., end())
 
template<typename M >
constexpr M identity (void)
 create an identity matrix
 
template<typename M >
constexpr M transpose (const M &m)
 Bring 'transpose' in the bbm namespace.
 
template<typename T >
mat3d< std::decay_t< T > > toGlobalShadingFrame (const vec3d< T > &normal)
 Construct a local shading frame to global frame transformation given a normal direction.
 
template<typename T >
auto toLocalShadingFrame (const vec3d< T > &normal)
 Construct a global to local shading frame transformation.
 
template<typename T >
mat3d< std::decay_t< T > > rotationX (const vec2d< T > &cossin)
 Rotation around the X-axis.
 
template<typename T >
mat3d< std::decay_t< T > > rotationX (T angle)
 Rotation around the X-axis.
 
template<typename T >
mat3d< std::decay_t< T > > rotationY (const vec2d< T > &cossin)
 Rotation around the Y-axis.
 
template<typename T >
mat3d< std::decay_t< T > > rotationY (T angle)
 Rotation around the Y-axis.
 
template<typename T >
mat3d< std::decay_t< T > > rotationZ (const vec2d< T > &cossin)
 Rotation around the Z-axis.
 
template<typename T >
mat3d< std::decay_t< T > > rotationZ (T angle)
 Rotation around the Z-axis.
 
template<typename T >
mat2d< std::decay_t< T > > rotation2d (const vec2d< T > &cossin)
 2D rotation matrix
 
template<typename T >
mat2d< std::decay_t< T > > rotation2d (T angle)
 2D rotation matrix
 
template<typename T >
vec2d< T > perp (const vec2d< T > &v)
 Returns the lefthand (clockwise) perpendicular vector of a 2D vector.
 
template<typename T >
vec2d< T > cperp (const vec2d< T > &v)
 Returns the righthand (counterclockwise) perpendicular vector of a 2D vector.
 
template<typename T >
vec3d< T > reflect (const vec3d< T > &v, const vec3d< T > &normal)
 Reflects a 3D vector.
 
template<typename T >
vec3d< T > reflect (const vec3d< T > &v)
 Reflects a 3D vector around Z=1.
 
template<typename T >
constexpr vec3d< T > cross (const vec3d< T > &a, const vec3d< T > &b)
 Cross product of two 3D vectors.
 
template<typename T >
vec3d< T > halfway (const vec3d< T > &a, const vec3d< T > &b)
 Halfway vector (3D)
 
template<typename T >
std::pair< vec3d< T >, vec3d< T > > convertToHalfwayDifference (const vec3d< T > &a, const vec3d< T > &b)
 Convert fro Canonical to the Halfway-Difference parameterization.
 
template<typename T >
vec3d< T > difference (const vec3d< T > &a, const vec3d< T > &b)
 Difference vector.
 
template<typename T >
std::pair< vec3d< T >, vec3d< T > > convertFromHalfwayDifference (const vec3d< T > &half, const vec3d< T > &diff)
 Convert from Halfway-Difference to Canonical parameterization.
 
dl_handle_t loadDynamicLibrary (const std::string &name)
 
void closeDynamicLibrary (dl_handle_t handle)
 
 BBM_CHECK_CONCEPT (concepts::inout_linearizer, merl_linearizer< config >)
 
 BBM_CHECK_CONCEPT (concepts::samplelossfunction, nganL2_error< config >)
 
 BBM_CHECK_CONCEPT (concepts::samplelossfunction, lowL2_error< config >)
 
 BBM_CHECK_CONCEPT (concepts::samplelossfunction, bieronL2_error< config >)
 
 BBM_CHECK_CONCEPT (concepts::samplelossfunction, lowLog_error< config >)
 
 BBM_CHECK_CONCEPT (concepts::samplelossfunction, bieronLog_error< config >)
 
 BBM_CHECK_CONCEPT (concepts::samplelossfunction, standardLog_error< config >)
 
 BBM_CHECK_CONCEPT (concepts::optimization_algorithm, compass< lossfunction<>, parameter<> >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, merl_data< config >)
 
 BBM_CHECK_CONCEPT (concepts::bsdfmodel, merl< config >)
 
template<typename FUNC , typename... T>
requires ( !std::is_void_v< find_first<bbm::detail::has_reflection, T...> > || // is reflection type OR !std::is_void_v< find_first<bbm::detail::is_gettable, T...> > || // is gettable type OR requires(const FUNC& func, const T&... t) {{func(value(t)...)};} // supports direct call )
auto apply_all (const FUNC &func, const T &... t)
 Apply a function.
 
template<typename T >
decltype(auto) value (T &&t)
 return the value of an attribute, or if not an attribute the object
 
template<typename F , size_t... IDX>
requires (sizeof...(IDX) == 0 || has_constfor_lambda<F>)
constexpr void constfor (F &&f, std::index_sequence< IDX... >)
 constfor given an index sequence of indexes.
 
template<size_t NumItr, typename F >
requires (NumItr == 0 || has_constfor_lambda<F>)
constexpr void constfor (F &&f)
 constfor given the number of iterations
 
template<typename... T, typename F >
requires has_constforeach_lambda<F, T...>
constexpr void constforeach (F &&f)
 constforeach over all typenames in T.
 
template<typename T = unsigned long long int>
requires std::integral<T> || std::floating_point<T>
consteval size_t max_factorial (void)
 Returns the largest possible factorial index for a given type that does not result in an overflow.
 
template<typename T = unsigned long long int>
constexpr T factorial (size_t n)
 Compute n!
 
template<typename ENUM >
requires concepts::reflection::enumerate<ENUM>
std::ostream & operator<< (std::ostream &s, ENUM e)
 ostream output uses toString conversion
 
template<typename TA , typename TX , size_t MaxTerm = 100>
auto tgamma_lower (const TA &a, const TX &x)
 Unnormalized incomplete lower gamma function.
 
template<typename TA , typename TX , size_t MaxTerm = 100>
auto gamma_p (const TA &a, const TX &x)
 Normalized incomplete lower gamma function.
 
template<typename TA , typename TX , size_t MaxTerm = 100>
auto tgamma (const TA &a, const TX &x)
 Unnormalized incomplete upper gamma function.
 
template<typename TA , typename TX , size_t MaxTerm = 100>
auto gamma_q (const TA &a, const TX &x)
 Normalized incomplete upper gamma function.
 
template<typename TA , typename TX , size_t MaxTerm = 100>
auto gamma_pq (const TA &a, const TX &x)
 Normalized incomplete upper and lower gamma function.
 
template<typename TA , typename TP >
auto gamma_p_inv (const TA &a, const TP &p)
 the inverse of the normalized upper incomplete gamma function
 
template<typename TA , typename TQ >
auto gamma_q_inv (const TA &a, const TQ &q)
 the inverse of the normalized lower incomplete gamma function
 
template<typename T , literal... V>
requires std::constructible_from<T, decltype(V.value)...> && (!(is_array_v<decltype(V.value)> && ...))
constexpr T make_from ()
 Make an object T from a series of non-array template literals.
 
template<typename T , literal A>
requires bbm::is_array_v<decltype(A.value)>
constexpr T make_from ()
 Make an object T from the values passed in a array literal.
 
template<typename T , typename... Args>
constexpr T make_from (Args &&... args)
 Make an object T from a pack of arguments.
 
template<typename FUNC , typename... Ts>
void multirange_for (FUNC &&func, Ts &&... containers)
 ranged for loop over multiple containers at once
 
template<string_literal... NAMES, typename T >
requires (sizeof...(NAMES) == 0) || (concepts::gettable<T> && (sizeof...(NAMES) == std::tuple_size_v<std::decay_t<T>>))
constexpr named< anonymize_t< T >, NAMES... > make_named (T &&t)
 Make a named of a gettable type (with size == #NAMES); renames if the type is a named container.
 
template<string_literal... NAMES, typename... Ts>
requires (sizeof...(NAMES) == sizeof...(Ts))
constexpr auto make_named (Ts &&... ts)
 Make a named tuple from a list of arguments (number of arguments == #NAMES)
 
template<string_literal... NAMES, typename T >
requires is_named_v<T>
constexpr auto pick (T &&t)
 Pick a subset/reshuffle a named container T and return as a named tuple.
 
template<string_literal... NAMES, typename... Ts>
requires (sizeof...(NAMES) == sizeof...(Ts))
named< std::tuple< Ts &... >, NAMES... > tie (Ts &&... src)
 Tie by name.
 
template<typename TUP , string_literal... NAMES>
requires bbm::is_tuple_v<TUP>
constexpr auto value_copy_named (const named< TUP, NAMES... > &src)
 value copy a named tuple
 
template<typename... T>
requires (is_named_v<T> && ...)
constexpr auto named_cat (T &&... t)
 cat named types
 
template<size_t START, size_t COUNT, typename NAMED >
requires is_named_v<NAMED> && ((START+COUNT) <= std::decay_t<NAMED>::size)
constexpr auto subnamed (NAMED &&named)
 get a subset of a named tuple
 
template<string_literal PREFIX, typename T , string_literal... NAMES>
constexpr auto prefix_names (named< T, NAMES... > t)
 prefix names in type
 
template<string_literal POSTFIX, typename T , string_literal... NAMES>
constexpr auto postfix_names (named< T, NAMES... > t)
 postfix names in type
 
template<typename T >
requires is_named_v<T>
constexpr auto named_flatten (T &&t)
 flatten a named type without merging names
 
template<string_literal SEP = ".", typename T >
requires is_named_v<T>
constexpr auto merge_named_flatten (T &&t)
 flatten a named type with merging names
 
template<typename NAMED , size_t IDX = 0, typename PARTIAL = named<std::tuple<>>>
constexpr auto sort_named (NAMED &&named, PARTIAL &&partial=PARTIAL{})
 sort a named tuple by name using insert-sort.
 
template<typename NAMED , typename PROCESS , typename... Ts>
requires is_named_v<NAMED> && is_named_sorted_v<NAMED> && requires(PROCESS&& p) { p.template operator()<size_t(0)>(std::declval<std::string>(), std::declval<NAMED>(), std::declval<Ts>()...); }
auto binary_search_named (const std::string &str, NAMED &&named, PROCESS &&process, Ts &&... context)
 Run-time binary search for a matching name in a named tuple based on a string. The (index of the) found element is forwarded to a processing lambda.
 
template<typename NAMED , typename PROCESS , typename... Ts>
requires is_named_v<NAMED> && requires(PROCESS&& p) { p.template operator()<size_t(0)>(std::declval<std::string>(), std::declval<NAMED>(), std::declval<Ts>()...); }
auto linear_search_named (const std::string &str, NAMED &&named, PROCESS &&process, Ts &&... context)
 linear search for unsorted named tuples
 
template<typename T , typename T0 , typename... Ts>
constexpr auto poly (T &&x, T0 &&c0, Ts &&... c)
 Compute a polynomial \( p(x) = \sum_{i=0} x^i * c_i \).
 
template<size_t N, typename T , typename T0 , typename... Ts>
constexpr auto poly (T &&x, T0 &&c0, Ts &&... c)
 Compute a polynomial \( p(x) = \sum_{i=0}^N x^i * c_i \).
 
template<string_literal LIT>
constexpr decltype(LIT) operator""_sl (void)
 custom literal operator for string_literals
 
template<auto N, int base = 10>
requires std::integral<decltype(N)> && (base <= 16)
constexpr auto to_string_literal (void)
 convert integrals to string_literal
 
template<typename T >
requires concepts::gettable<T>
auto to_tuple (T &&t)
 Create a tuple from any other type that supports std::get.
 
template<typename... ARGS>
constexpr auto make_ref_tuple (ARGS &&... args)
 Make a tuple of references.
 
template<typename... ARGS>
constexpr auto value_copy_tuple (const std::tuple< ARGS... > &tup)
 Value-copy a tuple.
 
template<size_t START, size_t COUNT, typename TUP >
requires is_tuple_v<TUP> && ((START+COUNT) <= std::tuple_size_v<std::decay_t<TUP>>)
constexpr auto subtuple (TUP &&tup)
 subtuple
 
template<typename T >
constexpr auto tuple_flatten (T &&t)
 Recursively flatten a tuple.
 
template<typename T >
constexpr auto tuple_add_const (T &&t)
 tuple_add_const to each element
 
template<typename T >
constexpr auto tuple_remove_const (T &&t)
 tuple_remove_const from each element
 
template<typename T >
std::ostream & operator<< (std::ostream &s, const std::vector< T > &vec)
 
template<typename... BSDFMODELs>
requires (concepts::bsdfmodel<BSDFMODELs> && ...)
auto aggregate (const bsdf< BSDFMODELs > &... src)
 Helper methods for simplifying the creation of a aggregate bsdf.
 
template<typename... CONFs>
requires (concepts::config<CONFs> && ...)
auto aggregate (const bsdf_ptr< CONFs > &... src)
 
template<typename ITR >
requires (std::input_or_output_iterator<ITR> && concepts::bsdf_ptr<std::iter_reference_t<ITR>>)
auto aggregate (const ITR &begin, const ITR &end)
 
Helper Methods for extracting default value / bounds
template<typename T >
requires concepts::bsdf_attribute<T>
constexpr auto default_value (T)
 
template<typename T >
requires concepts::bsdf_attribute<T>
constexpr auto lower_bound (T)
 
template<typename T >
requires concepts::bsdf_attribute<T>
constexpr auto upper_bound (T)
 
template<typename T >
requires concepts::bsdf_attribute<T>
constexpr auto bsdf_attr_flag (T)
 
template<typename PARAM >
requires concepts::diff_parameter<PARAM>
bool all_gradients_tracked (PARAM &&param)
 Check if gradients are tracked.
 
template<typename PARAM >
requires concepts::diff_parameter<PARAM>
bool any_gradients_tracked (PARAM &&param)
 
forward declarations of toString and fromString
template<typename T >
requires concepts::from_stringconvert<T>
fromString (const std::string &str)
 fromString alias
 
template<typename T >
requires concepts::to_stringconvert<T>
std::string toString (const T &obj)
 toString alias
 
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.
 
Core Enum Operations
template<typename FLAGNAME >
requires std::is_enum_v<FLAGNAME>
constexpr FLAGNAME operator| (FLAGNAME a, FLAGNAME b)
 Concat two flags.
 
template<typename FLAGNAME >
requires std::is_enum_v<FLAGNAME>
constexpr FLAGNAME operator+ (FLAGNAME a, FLAGNAME b)
 Conact two flags.
 
template<typename FLAGNAME >
requires std::is_enum_v<FLAGNAME>
constexpr FLAGNAME operator& (FLAGNAME a, FLAGNAME b)
 Get the shared flags.
 
template<typename FLAGNAME >
requires std::is_enum_v<FLAGNAME>
constexpr FLAGNAME operator^ (FLAGNAME a, FLAGNAME b)
 Get the flags from 'a' that are not in 'b'.
 
template<typename FLAGNAME >
requires std::is_enum_v<FLAGNAME>
constexpr FLAGNAME operator~ (FLAGNAME a)
 Set/unset flag that are unset/set respectively.
 
template<typename FLAGNAME >
requires std::is_enum_v<FLAGNAME>
constexpr FLAGNAME & operator&= (FLAGNAME &a, FLAGNAME b)
 Update 'a' with a & b.
 
template<typename FLAGNAME >
requires std::is_enum_v<FLAGNAME>
constexpr FLAGNAME & operator|= (FLAGNAME &a, FLAGNAME b)
 Update 'a' with a | b.
 
template<typename FLAGNAME >
requires std::is_enum_v<FLAGNAME>
constexpr FLAGNAME & operator+= (FLAGNAME &a, FLAGNAME b)
 Update 'a' with a+b.
 
template<typename FLAGNAME >
requires std::is_enum_v<FLAGNAME>
constexpr FLAGNAME & operator^= (FLAGNAME &a, FLAGNAME b)
 Update 'a' with a^b,.
 
template<typename FLAGNAME , typename FLAG >
requires std::is_enum_v<FLAG> && std::is_same_v<scalar_t<FLAGNAME>, FLAG>
constexpr auto is_set (const FLAGNAME &a, const FLAG &flag)
 Check if all in 'flag' are also set in 'a'; compatible with packet types.
 
Extensions of size, begin, and end to non-iterable types
template<typename T >
size_t size (T &&t)
 
template<typename T >
auto begin (T &&t)
 
template<typename T >
auto cbegin (T &&t)
 
template<typename T >
auto end (T &&t)
 
template<typename T >
auto cend (T &&t)
 
Get by name
template<string_literal NAME, string_literal... SUBNAME, typename T >
requires is_named_v<T>
constexpr decltype(auto) get (T &&src)
 
template<string_literal NAME, string_literal... SUBNAME, typename T >
requires is_named_v<T>
constexpr decltype(auto) get (const T &src)
 
Math operators

@{

template<typename T , typename U >
auto & operator+= (vector< T > &v, const U &u)
 
template<typename T , typename U >
auto operator+ (const vector< T > &v, const U &u)
 
template<typename T , typename U >
requires (!is_vector_v<T> && !is_bbm_vector_v<T>)
auto operator+ (const T &v, const vector< U > &u)
 
template<typename T , typename U >
auto & operator-= (vector< T > &v, const U &u)
 
template<typename T , typename U >
auto operator- (const vector< T > &v, const U &u)
 
template<typename T , typename U >
auto & operator*= (vector< T > &v, const U &u)
 
template<typename T , typename U >
auto operator* (const vector< T > &v, const U &u)
 
template<typename T , typename U >
requires (!is_vector_v<T> && !is_bbm_vector_v<T>)
auto operator* (const T &v, const vector< U > &u)
 
template<typename T , typename U >
auto & operator/= (vector< T > &v, const U &u)
 
template<typename T , typename U >
auto operator/ (const vector< T > &v, const U &u)
 
template<typename T , typename U >
auto & operator%= (vector< T > &v, const U &u)
 
template<typename T , typename U >
auto operator% (const vector< T > &v, const U &u)
 

Variables

template<typename... T>
static constexpr bool dependent_false_v = dependent_false<T...>::value
 
template<typename... T>
static constexpr bool dependent_true_v = !dependent_false<T...>::value
 
template<typename NAMED >
static constexpr bool is_named_sorted_v = detail::is_named_sorted<NAMED>()
 true if named tuple is sorted by name
 
template<string_literal NAME, typename NAMED >
static constexpr size_t binary_search_named_v = detail::binary_search_named<NAME, std::decay_t<NAMED>>()
 binary search a sorted named tuple
 
template<typename T >
static constexpr std::string_view typestring = bbm::detail::typestring_impl<T>()
 
named_equivalence trait: do two types have the same set of names?
template<typename U , typename V >
static constexpr bool named_equivalence_v = named_equivalence<U,V>::value
 

type traits

@{

template<typename T >
using is_arg = bbm::detail::is_arg_impl< std::decay_t< T > >
 
template<typename T >
using is_args = detail::is_args_impl< std::decay_t< T > >
 
template<typename T >
using is_bbm_reference = bbm::detail::is_bbm_reference_impl< std::decay_t< T > >
 
template<typename T >
constexpr bool is_arg_v = is_arg<T>::value
 
template<typename T >
constexpr bool is_args_v = is_args<T>::value
 
template<typename T >
constexpr bool is_named_v = is_named<std::decay_t<T>>::value
 
template<typename T >
constexpr bool is_bbm_reference_v = is_bbm_reference<T>::value
 

is_enumerable

template<typename VALUE , typename T >
using is_enumerable = bbm::detail::is_enumerable_impl< VALUE, T >
 
template<typename VALUE , typename T >
constexpr bool is_enumerable_v = is_enumerable<VALUE,T>::value
 
template<typename T >
using is_cast_itr = bbm::detail::is_cast_itr_impl< std::decay_t< T > >
 
template<typename T >
using underlying_itr_t = typename bbm::detail::underlying_itr_impl< std::decay_t< T > >::type
 
template<typename T >
constexpr bool is_cast_itr_v = is_cast_itr<T>::value
 

anonymize trait: remove the names

template<typename T >
using anonymize_t = std::decay_t< decltype(anonymize_v(std::declval< T >()))>
 
template<typename T >
constexpr decltype(auto) anonymize_v (T &&t)
 

is_string_literal type trait

template<typename T >
using is_string_literal = bbm::detail::is_string_literal_impl< std::decay_t< T > >
 
template<typename T >
constexpr bool is_string_literal_v = is_string_literal<T>::value
 

is_const (reference robust)

template<typename T >
using is_const = std::is_const< std::remove_reference_t< std::remove_pointer_t< T > > >
 
template<typename T >
constexpr bool is_const_v = is_const<T>::value
 

type-trait for detecting string_types: char*, char[], string

template<typename T >
using is_string_type = bbm::detail::is_string_type_impl< std::remove_const_t< std::decay_t< T > > >
 
template<typename T >
constexpr bool is_string_type_v = is_string_type<T>::value
 

type-trait for detecting vectors

template<typename T >
using is_vector = bbm::detail::is_vector_impl< std::decay_t< T > >
 
template<typename T >
constexpr bool is_vector_v = is_vector<T>::value
 

type-trait for detecting tuples

template<typename T >
using is_tuple = bbm::detail::is_tuple_impl< std::decay_t< T > >
 
template<typename T >
constexpr bool is_tuple_v = is_tuple<T>::value
 

type-trait for detecting arrays

template<typename T >
using is_array = bbm::detail::is_array_impl< std::decay_t< T > >
 
template<typename T >
constexpr bool is_array_v = is_array<T>::value
 

type traits for bbm::vector

template<typename T >
using is_bbm_vector = bbm::detail::is_bbm_vector_impl< std::decay_t< T > >
 
template<typename T >
constexpr bool is_bbm_vector_v = is_bbm_vector<T>::value
 

Class Documentation

◆ bbm::add_const

struct bbm::add_const
template<typename T>
struct bbm::add_const< T >
Class Members
typedef add_const_t< T > type

◆ bbm::add_const< T >

struct bbm::add_const< T >
template<typename T>
requires std::is_lvalue_reference_v<T>
struct bbm::add_const< T >
Class Members
typedef add_lvalue_reference_t< typename add_const< remove_reference_t< T > >::type > type
typedef add_rvalue_reference_t< typename add_const< remove_reference_t< T > >::type > type
typedef add_pointer_t< typename add_const< remove_pointer_t< T > >::type > type

◆ bbm::alternative

struct bbm::alternative
template<typename BSDFMODEL>
struct bbm::alternative< BSDFMODEL >

Forward declaration of alternative. Should be specified if a model provides an alternative.

Class Members
typedef BSDFMODEL type

◆ bbm::arg

struct bbm::arg
template<typename Type, string_literal Name, typename Default = void>
struct bbm::arg< Type, Name, Default >

Forward declaration of bbm::arg.

Template Parameters
Type= type of the argument
Name= argument name
Default= invocable type that returns the default value

◆ bbm::attribute

struct bbm::attribute
template<typename CONF>
struct bbm::attribute< CONF >

Base declaration of attribute; further specialized below.

◆ bbm::bsdf_fresnel_properties

struct bbm::bsdf_fresnel_properties
template<typename T, bsdf_attr Flag = bsdf_attr::SpecularParameter>
struct bbm::bsdf_fresnel_properties< T, Flag >

◆ bbm::persistent_reference

struct bbm::persistent_reference
template<typename T>
struct bbm::persistent_reference< T >

Declaration of persistent_reference specialized below.

◆ bbm::remove_const

struct bbm::remove_const
template<typename T>
struct bbm::remove_const< T >
Class Members
typedef remove_const_t< T > type

◆ bbm::remove_const< T >

struct bbm::remove_const< T >
template<typename T>
requires std::is_lvalue_reference_v<T>
struct bbm::remove_const< T >
Class Members
typedef add_lvalue_reference_t< typename remove_const< remove_reference_t< T > >::type > type
typedef add_rvalue_reference_t< typename remove_const< remove_reference_t< T > >::type > type
typedef add_pointer_t< typename remove_const< remove_pointer_t< T > >::type > type

◆ bbm::sampledloss_base

struct bbm::sampledloss_base
template<typename CONF>
requires concepts::config<CONF>
struct bbm::sampledloss_base< CONF >

Forward declaration.

Typedef Documentation

◆ add_args

using add_args = detail::add_args_impl<Ts...>

◆ add_args_t

using add_args_t = typename add_args<Ts...>::type

◆ add_const_t

using add_const_t = typename add_const<T>::type

◆ aggregatemodel

using aggregatemodel = aggregatemodel_base<"Aggregate"_sl, MODELS...>

The sum of different BSDF models.

Template Parameters
MODELS= list of BSDF models over which this model aggregates

◆ anonymize_t

using anonymize_t = std::decay_t<decltype(anonymize_v(std::declval<T>()))>

◆ attribute_tuple_to_args_t

using attribute_tuple_to_args_t = typename bbm::detail::attribute_tuple_to_args_t<std::decay_t<TUP> >::type

Convert an attribute_tuple_t to a bbm::args.

Template Parameters
TUP= attribute_tuple_t (named tuple)

Each attribute type and name in the named tuple is converted to an bbm::arg and wrapped in a bbm::args. Each type,name combination is converted according to the following policies:

  • default: bbm::arg<const type&, name>
  • bsdf_attribute: bbm::arg<const type&, name, bsdf_attribute::default_value> Other policies can be added to 'attribute_to_arg_impl.

◆ attribute_value_t

using attribute_value_t = bbm::detail::attribute_value<std::decay_t<T> >::type

return the type of value(t)

◆ bagher

Bagher et al.'s Microfacet BSDF with Shifted Gamma Distribution.

Template Parameters
CONF= bbm configuration
NAME= model name (default = Bagher)

◆ bsdf_parameter

using bsdf_parameter = attribute<bsdf_properties<T, Flag, Default, UpperBound, LowerBound> >

◆ bsdf_roughness

using bsdf_roughness = attribute<bsdf_properties<T, Flag, 0.1, 1.0, constants<scalar_t<T> >::Epsilon()> >

◆ bsdf_scale

using bsdf_scale = attribute<bsdf_properties<T, Flag, 0.5, 1.0> >

◆ bsdf_sharpness

using bsdf_sharpness = attribute<bsdf_properties<T, Flag, 32.0> >

◆ const_persistent_reference

const_persistent_reference

◆ const_reference

const non-persistent reference

◆ cooktorrance

Cook-Torrance microfacet BSDF model.

Template Parameters
CONF= type configuration to use
NAME= model name (default = CookTorrance)

This is a microfacet model set to mimic the original BSDF model as proposed by Cook and Torrance.

Implements: concepts::bsdfmodel

◆ cooktorranceheitz

Microfacet BSDF with Anisotropic Beckmann-based NDF.

Template Parameters
CONF= bbm configuration
NAME= model name (default = CookTorranceHeitz)

Note: the differences with the regular Cook-Torrance BSSF model are:

  • the 1/4 normalization missing from the original Cook-Torrance BSDF
  • using the Beckmann-derived monodirectional shadowing-masking G1
  • height correlated joint shadowing-masking
  • using the anisotropic Beckmann distribition

Implements: concepts::bsdfmodel

◆ cooktorrancewalter

Microfacet BSDF with Beckmann-based NDF.

Template Parameters
CONF= bbm configuration
NAME= model name (default = CookTorranceWalter)

Note: the differences with the regular Cook-Torrance BSSF model are:

  • the 1/4 normalization missing from the original Cook-Torrance BSDF
  • using the Beckmann-derived monodirectional shadowing-masking G1
  • using uncorrelated joint masking and shadowing.

Implements: concepts::bsdfmodel

◆ diffuse_roughness

◆ diffuse_scale

◆ diffuse_sharpness

◆ dl_handle_t

using dl_handle_t = void*

◆ epd

Exponential Power Distribution microfacet model.

This microfacet EPD BSDF does not include the specular albedo term (Eq 25).

◆ find_first

using find_first = typename bbm::detail::find_first_impl<TRAIT, void, Ts...>::type

Find first type that matches a type_trait.

◆ fresnel_parameter

◆ get_config

using get_config = typename std::decay_t<T>::Config

get_config type trait

Get the config struct type

◆ ggx

Microfacet BSDF with GGX-based NDF.

Template Parameters
CONF= bbm configuration
NAME= model name (default = GGX)

Implements: concepts::bsdfmodel

◆ ggxheitz

Microfacet BSDF with anisotropic GGX-based NDF with heigh correlated shadowing and masking.

Template Parameters
CONF= bbm configuration
NAME= model name (default = GGXHeitz)

Implements: concepts::bsdfmodel

◆ he

using he = ndf_sampler<he_base<CONF, fresnel::complex<CONF, Spectrum_t<CONF> >, he_eq25::WithoutExp, he_eq78::Regular, 4, 64, true, 18>, 90, 1, NAME>

◆ heholzschuch

using heholzschuch = ndf_sampler<he_base<CONF, fresnel::complex<CONF, Spectrum_t<CONF> >, he_eq25::Errata, he_eq78::Regular, 4, 10, false>, 90, 1, NAME>

◆ hewestin

using hewestin = ndf_sampler<he_base<CONF, fresnel::complex<CONF, Spectrum_t<CONF> >, he_eq25::Errata, he_eq78::Westin, 4, 64, true, 18>, 90, 1, NAME>

◆ is_arg

using is_arg = bbm::detail::is_arg_impl<std::decay_t<T> >

◆ is_args

using is_args = detail::is_args_impl<std::decay_t<T> >

◆ is_array

using is_array = bbm::detail::is_array_impl<std::decay_t<T> >

◆ is_bbm_reference

using is_bbm_reference = bbm::detail::is_bbm_reference_impl<std::decay_t<T> >

◆ is_bbm_vector

using is_bbm_vector = bbm::detail::is_bbm_vector_impl<std::decay_t<T> >

◆ is_cast_itr

using is_cast_itr = bbm::detail::is_cast_itr_impl<std::decay_t<T> >

Type traits

◆ is_const

using is_const = std::is_const<std::remove_reference_t<std::remove_pointer_t<T> >>

◆ is_enumerable

using is_enumerable = bbm::detail::is_enumerable_impl<VALUE, T>

◆ is_string_literal

using is_string_literal = bbm::detail::is_string_literal_impl<std::decay_t<T> >

◆ is_string_type

using is_string_type = bbm::detail::is_string_type_impl<std::remove_const_t<std::decay_t<T> >>

◆ is_tuple

using is_tuple = bbm::detail::is_tuple_impl<std::decay_t<T> >

◆ is_vector

using is_vector = bbm::detail::is_vector_impl<std::decay_t<T> >

◆ iterable_value_t

using iterable_value_t = std::decay_t<decltype( *bbm::begin(std::declval<T>()) )>

◆ lowashikhminshirley

Low et al.'s version of the specular component of the Ashikhmin-Shirley BSDF: uses the Cook-Torrance Fresnel component with index of refraction.

◆ lowcooktorrance

using lowcooktorrance = cooktorrance<CONF, "LowCookTorrance">

Low et al.'s version of the specular component of the Cook-Torrance BSDF; this directly mirrors the original Cook-Torrance implementation.

◆ lowmicrofacetfit

Shorthand for the Low BSDF model compatible with the fits listed in their supplemental material which differs from the model in the paper by using a different normalization factor.

◆ mat2d

using mat2d = bbm::detail::mat<vec2d<T>, 2>

2D matrix

◆ mat3d

using mat3d = bbm::detail::mat<vec3d<T>, 3>

3D matrix

◆ merl

using merl = ndf_sampler<merl_data<Config, "Merl">, 90, 1>

Data-driven MERL BSDF model with data-driven backscatter based importance sampling.

◆ named_cat_t

using named_cat_t = decltype( named_cat(std::declval<T>()...) )

type of concatting multiple named tuples.

◆ nganashikhminshirley

Ngan's Ashkihmin-Shirley model; does not include Ashikhmin-Shirley's diffuse component, and it is isotropic. THis can be achieved with a simple alias.

◆ nganblinnphong

using nganblinnphong = phong<CONF, NAME>

Ngan's Blinn-Phong: same as modifed phong; a simple alias suffices.

◆ ngancooktorrance

Ngan's Cook-Torrance is normalized by pi, is isotropic, and has vgroove masking and shadowing, schlick fresnel, F0 reflectance, and backman distribution.

This is achieved by a defining a custom microfacet model.

◆ nganhe

using nganhe = scaledmodel<ndf_sampler<he_base<CONF, fresnel::cook<CONF>, he_eq25::Errata, he_eq78::Westin, 4, 64, true, 18>, 90, 1, "NganHe">, bsdf_attr::SpecularScale>

Ngan's He et al.'s BSDF likely uses the Westin et al. formulation but with non-complex eta.

◆ nganward

using nganward = ward<CONF, symmetry_v::Isotropic, NAME>

Ngan's Ward: standard Ward with isotropic roughness. This can be achieved with a simple alias.

◆ nganwardduer

Ngan's Ward-Duer: stanard Ward-Duer with isotropic roughness. This can be achieved with a simple alias.

◆ phongwalter

Microfacet BSDF with Phong-based NDF.

Template Parameters
CONF= bbm configuration
NAME= model name (default = PhongWalter)

Implements: concepts::bsdfmodel

◆ postfix_names_t

using postfix_names_t = decltype(post_names<POSTFIX>(std::declval<T>()))

type of named tuple with post-fixed name.

◆ prefix_names_t

using prefix_names_t = decltype(prefix_names<PREFIX>(std::declval<T>()))

type of named tuple with pre-fixed name.

◆ remove_const_t

using remove_const_t = typename remove_const<T>::type

◆ ribardiere

Microfacet BSDF with Student-T based NDF.

Template Parameters
CONF= bbm configuration
NAME= model name (default = Ribadiere)

Implements: concepts::bsdfmodel

◆ ribardiereanisotropic

Microfacet BSDF with the Anisotropic Student-T based NDF.

Template Parameters
CONF= bbm configuration
NAME= model name (default = RibadiereAnisotripic)

Implements: concepts::bsdfmodel

◆ Spectrum_t

using Spectrum_t = typename get_config<T>::Spectrum

◆ specular_roughness

◆ specular_scale

◆ specular_sharpness

◆ subnamed_t

using subnamed_t = decltype( subnamed<START,COUNT,NAMED>( std::declval<NAMED>() ) )

type of subnamed

◆ subtuple_t

using subtuple_t = decltype( subtuple<START,COUNT>(std::declval<TUP>()) )

subtuple type

◆ symmetry_t

using symmetry_t = std::conditional_t<(V == symmetry_v::Isotropic), Value, vec2d<Value> >

Determine the data type for storing isotropic or anisotropic reflectance parameters.

◆ to_tuple_t

using to_tuple_t = decltype( to_tuple(std::declval<T>()) )

type of converting a type that supports std::get to a tuple

◆ tuple_add_const_t

using tuple_add_const_t = decltype( tuple_add_const( std::declval<std::decay_t<T> >() ) )

tuple_add_const type

◆ tuple_cat_t

using tuple_cat_t = decltype( std::tuple_cat( std::declval<Ts>()... ) )

tuple_cat_t

Returns the type of std::tuple_cat

◆ tuple_flatten_t

using tuple_flatten_t = decltype( tuple_flatten( std::declval<std::decay_t<T> >() ) )

flattened tuple type

◆ tuple_remove_const_t

using tuple_remove_const_t = decltype( tuple_remove_const( std::declval<std::decay_t<T> >() ) )

tuple_remove_const type

◆ underlying_itr_t

using underlying_itr_t = typename bbm::detail::underlying_itr_impl<std::decay_t<T> >::type

◆ value_copy_named_t

using value_copy_named_t = decltype( value_copy_named(std::declval<T>()) )

type of value copying a named typle

◆ value_copy_tuple_t

using value_copy_tuple_t = decltype( value_copy_tuple( std::declval<std::decay_t<T> >() ) )

value-copy type of a tuple.

◆ Value_t

using Value_t = typename get_config<T>::Value

Enumeration Type Documentation

◆ bsdf_attr

enum struct bsdf_attr
strong

Attribute Property Flags.

Enumerator
None 
DiffuseScale 
DiffuseParameter 
SpecularScale 
SpecularParameter 
Dependent 
Diffuse 
Specular 
Scale 
Parameter 
All 

◆ bsdf_flag

enum struct bsdf_flag
strong

Reflectance Component Evaluation Flags.

Enumerator
None 
Diffuse 
Specular 
All 

◆ bsdf_prop

enum struct bsdf_prop
strong

BSDF property flags.

Enumerator
None 
Static 
Diffuse 
Specular 
Combined 
Depricated 
Alternative 
Convertible 
Unnormalized 
NonReciprocal 
GrazingAngle 
NonEnergyConservative 
ApproximateReflectance 

◆ he_eq25

enum struct he_eq25
strong

Masking term scale in Eq 25.

  • WithoutExp = 1.0 (following [He et al. 1991]) + Regular = exp(- (tau*cot(theta) / 2sigma0)^2 ) (following the errata, as well as the reference implementations of Westin et al. and of Holzschuch and Pacanowski)
Enumerator
WithoutExp 
Errata 

◆ he_eq78

enum struct he_eq78
strong

Eq. 78 variants:

  • Regular: follows He et al. exactly (also in Holzschuch and Pacanowksi).
  • Westin: uses exp(-g - v_xy2 * (tau/lambda)^2 * Pi^2 / m) instead of exp(-g -v_xy2 * tau^2 / 4m) in Eq. 78.
Enumerator
Regular 
Westin 

◆ symmetry_v

enum struct symmetry_v
strong

symmetry variants.

symmetry_type = value type of isotropic and anisotropic roughness/sharpness

Enumerator
Isotropic 
Anisotropic 

◆ unit_t

enum struct unit_t
strong

Light Unit.

Enumerator
Radiance 
Importance 

Function Documentation

◆ aggregate() [1/4]

auto aggregate ( const bsdf< BSDFMODELs > &...  src)

Helper methods for simplifying the creation of a aggregate bsdf.

This is a companion method to aggregate in aggregatemodel.h. Based on the available information at compile time, aggrgate chooses the most optimal aggregate bsdf defintion:

  • If all arguments are BSDF models, then the result is an aggregatemodel
  • If all arguments are bsdf<BSDFMODEL>, then the result is an bsdf<aggregatemodel>
  • If all arguments are bsdf_ptr, then the result is an aggregatebsdf
  • If all arguments are pased via an iterator, then the result is an aggregatebsdf.

In the latter two cases, the underlying BSDFMODEL information is only known at run-time, and hence, the run-time aggregatebsdf is required. In the first case, because the user specifies models directly, the result is expected to be a model too. Finally, a bsdf<aggregatemodel> is less overhead than an aggregatebsdf, and hence, it is preferred when at compile time the BSDF models are known.

Note: ownership of the data depenends on the underlying model. In the case of aggregate bsdfs, ownership still lies with the original BSDF.

◆ aggregate() [2/4]

auto aggregate ( const bsdf_ptr< CONFs > &...  src)

◆ aggregate() [3/4]

auto aggregate ( const ITR &  begin,
const ITR &  end 
)

◆ aggregate() [4/4]

aggregatemodel< MODELS... > aggregate ( const MODELS &...  models)

Method for simplifying the creation of an aggregate model.

Parameters
models= comma separated list of models.

Based on the list of BSDF models, an aggregate model is created and initialized with the parameters of the models in the parameter list.

◆ all_gradients_tracked()

bool all_gradients_tracked ( PARAM &&  param)
inline

Check if gradients are tracked.

◆ anonymize_v()

constexpr decltype(auto) anonymize_v ( T &&  t)
constexpr

◆ any_gradients_tracked()

bool any_gradients_tracked ( PARAM &&  param)
inline

◆ apply_all()

auto apply_all ( const FUNC &  func,
const T &...  t 
)
inline

Apply a function.

Applies a function to a series of arguments. The following rules are used to determine the return type:

  • if any type support reflection AND all reflection types are the same AND reflection type supports empty construction, then call func on each reflection element.
  • if any type is gettable AND all gettable types have the same size, then apply func to all gettable elements. Try to keep the return type the same, or return a tuple.
  • else pass on to func directly

◆ backward_gradient()

void backward_gradient ( T &  t)

Enable backward/reverse gradient tracking.

Parameters
t= variable to track

static_assert if T is not differentiable.

◆ backward_gradients()

void backward_gradients ( T &&  t)
inline

backward computations => passthrough to backbone

◆ BBM_CALL_BACKBONE_OP() [1/21]

BBM_CALL_BACKBONE_OP ( all  )

◆ BBM_CALL_BACKBONE_OP() [2/21]

BBM_CALL_BACKBONE_OP ( any  )

◆ BBM_CALL_BACKBONE_OP() [3/21]

BBM_CALL_BACKBONE_OP ( conj  )

◆ BBM_CALL_BACKBONE_OP() [4/21]

BBM_CALL_BACKBONE_OP ( cossin  )

◆ BBM_CALL_BACKBONE_OP() [5/21]

BBM_CALL_BACKBONE_OP ( count  )

◆ BBM_CALL_BACKBONE_OP() [6/21]

BBM_CALL_BACKBONE_OP ( dot  )

◆ BBM_CALL_BACKBONE_OP() [7/21]

BBM_CALL_BACKBONE_OP ( eq  )

◆ BBM_CALL_BACKBONE_OP() [8/21]

BBM_CALL_BACKBONE_OP ( hmax  )

◆ BBM_CALL_BACKBONE_OP() [9/21]

BBM_CALL_BACKBONE_OP ( hmin  )

◆ BBM_CALL_BACKBONE_OP() [10/21]

BBM_CALL_BACKBONE_OP ( hprod  )

◆ BBM_CALL_BACKBONE_OP() [11/21]

BBM_CALL_BACKBONE_OP ( hsum  )

◆ BBM_CALL_BACKBONE_OP() [12/21]

BBM_CALL_BACKBONE_OP ( imag  )

◆ BBM_CALL_BACKBONE_OP() [13/21]

BBM_CALL_BACKBONE_OP ( isfinite  )

◆ BBM_CALL_BACKBONE_OP() [14/21]

BBM_CALL_BACKBONE_OP ( isinf  )

◆ BBM_CALL_BACKBONE_OP() [15/21]

BBM_CALL_BACKBONE_OP ( isnan  )

◆ BBM_CALL_BACKBONE_OP() [16/21]

BBM_CALL_BACKBONE_OP ( neq  )

◆ BBM_CALL_BACKBONE_OP() [17/21]

BBM_CALL_BACKBONE_OP ( none  )

◆ BBM_CALL_BACKBONE_OP() [18/21]

BBM_CALL_BACKBONE_OP ( norm  )

◆ BBM_CALL_BACKBONE_OP() [19/21]

BBM_CALL_BACKBONE_OP ( normalize  )

◆ BBM_CALL_BACKBONE_OP() [20/21]

BBM_CALL_BACKBONE_OP ( real  )

◆ BBM_CALL_BACKBONE_OP() [21/21]

BBM_CALL_BACKBONE_OP ( squared_norm  )

◆ BBM_CHECK_CONCEPT() [1/32]

BBM_CHECK_CONCEPT ( concepts::bsdf  ,
bsdf< bsdfmodel<> >   
)

◆ BBM_CHECK_CONCEPT() [2/32]

BBM_CHECK_CONCEPT ( concepts::bsdf_ptr  ,
bsdf_ptr< config >   
)

◆ BBM_CHECK_CONCEPT() [3/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
ashikhminshirley< config >   
)

◆ BBM_CHECK_CONCEPT() [4/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
ashikhminshirleyfull< config >   
)

◆ BBM_CHECK_CONCEPT() [5/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
bagher< config >   
)

◆ BBM_CHECK_CONCEPT() [6/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
he_base< config >   
)

◆ BBM_CHECK_CONCEPT() [7/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
lafortune< config >   
)

◆ BBM_CHECK_CONCEPT() [8/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
lambertian< config >   
)

◆ BBM_CHECK_CONCEPT() [9/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
lowmicrofacetfit< config >   
)

◆ BBM_CHECK_CONCEPT() [10/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
lowsmooth< config >   
)

◆ BBM_CHECK_CONCEPT() [11/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
merl< config >   
)

◆ BBM_CHECK_CONCEPT() [12/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
merl_data< config >   
)

◆ BBM_CHECK_CONCEPT() [13/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
microfacet< ndf<>, maskingshadowing<>, concepts::archetype::fresnel<> >   
)

◆ BBM_CHECK_CONCEPT() [14/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
nganlafortune< config >   
)

◆ BBM_CHECK_CONCEPT() [15/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
orennayar< config >   
)

◆ BBM_CHECK_CONCEPT() [16/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
phong< config >   
)

◆ BBM_CHECK_CONCEPT() [17/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
ward< config >   
)

◆ BBM_CHECK_CONCEPT() [18/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
wardduer< config >   
)

◆ BBM_CHECK_CONCEPT() [19/32]

BBM_CHECK_CONCEPT ( concepts::bsdfmodel  ,
wardduergeislermoroder< config >   
)

◆ BBM_CHECK_CONCEPT() [20/32]

BBM_CHECK_CONCEPT ( concepts::inout_linearizer  ,
merl_linearizer< config >   
)

◆ BBM_CHECK_CONCEPT() [21/32]

BBM_CHECK_CONCEPT ( concepts::loss  ,
loss< lossfunction< config > >   
)

◆ BBM_CHECK_CONCEPT() [22/32]

BBM_CHECK_CONCEPT ( concepts::loss_ptr  ,
loss_ptr< config >   
)

◆ BBM_CHECK_CONCEPT() [23/32]

BBM_CHECK_CONCEPT ( concepts::optimization_algorithm  ,
compass< lossfunction<>, parameter<> >   
)

◆ BBM_CHECK_CONCEPT() [24/32]

BBM_CHECK_CONCEPT ( concepts::optimizer_ptr  ,
optimizer_ptr< config >   
)

◆ BBM_CHECK_CONCEPT() [25/32]

BBM_CHECK_CONCEPT ( concepts::sampledlossfunction  ,
batch< concepts::archetype::sampledlossfunction<> >   
)

◆ BBM_CHECK_CONCEPT() [26/32]

BBM_CHECK_CONCEPT ( concepts::sampledlossfunction  ,
bbm::sampledlossfunction< bsdfmodel<>, bsdfmodel<>, samplelossfunction<>, inout_linearizer<> >   
)

◆ BBM_CHECK_CONCEPT() [27/32]

BBM_CHECK_CONCEPT ( concepts::samplelossfunction  ,
bieronL2_error< config >   
)

◆ BBM_CHECK_CONCEPT() [28/32]

BBM_CHECK_CONCEPT ( concepts::samplelossfunction  ,
bieronLog_error< config >   
)

◆ BBM_CHECK_CONCEPT() [29/32]

BBM_CHECK_CONCEPT ( concepts::samplelossfunction  ,
lowL2_error< config >   
)

◆ BBM_CHECK_CONCEPT() [30/32]

BBM_CHECK_CONCEPT ( concepts::samplelossfunction  ,
lowLog_error< config >   
)

◆ BBM_CHECK_CONCEPT() [31/32]

BBM_CHECK_CONCEPT ( concepts::samplelossfunction  ,
nganL2_error< config >   
)

◆ BBM_CHECK_CONCEPT() [32/32]

BBM_CHECK_CONCEPT ( concepts::samplelossfunction  ,
standardLog_error< config >   
)

◆ BBM_DECLARE_CORE_TYPE() [1/10]

BBM_DECLARE_CORE_TYPE ( BsdfFlag  ,
,
bbm::replace_scalar_t< bbm::remove_diff_t< Value_t< T > >, bbm::bsdf_flag  
)

◆ BBM_DECLARE_CORE_TYPE() [2/10]

BBM_DECLARE_CORE_TYPE ( Complex  ,
,
bbm::complex< Value_t< T > >   
)

◆ BBM_DECLARE_CORE_TYPE() [3/10]

BBM_DECLARE_CORE_TYPE ( Constants  ,
,
bbm::constants< Scalar_t< T > >   
)

◆ BBM_DECLARE_CORE_TYPE() [4/10]

BBM_DECLARE_CORE_TYPE ( Mask  ,
,
bbm::mask_t< Value_t< T > >   
)

◆ BBM_DECLARE_CORE_TYPE() [5/10]

BBM_DECLARE_CORE_TYPE ( Mat2d  ,
,
bbm::mat2d< Value_t< T > >   
)

◆ BBM_DECLARE_CORE_TYPE() [6/10]

BBM_DECLARE_CORE_TYPE ( Mat3d  ,
,
bbm::mat3d< Value_t< T > >   
)

◆ BBM_DECLARE_CORE_TYPE() [7/10]

BBM_DECLARE_CORE_TYPE ( Scalar  ,
,
bbm::scalar_t< Value_t< T > >   
)

◆ BBM_DECLARE_CORE_TYPE() [8/10]

BBM_DECLARE_CORE_TYPE ( Size  ,
,
bbm::index_t< Value_t< T > >   
)

◆ BBM_DECLARE_CORE_TYPE() [9/10]

BBM_DECLARE_CORE_TYPE ( Vec2d  ,
,
bbm::vec2d< Value_t< T > >   
)

◆ BBM_DECLARE_CORE_TYPE() [10/10]

BBM_DECLARE_CORE_TYPE ( Vec3d  ,
,
bbm::vec3d< Value_t< T > >   
)

◆ BBM_DECLARE_FORWARD_IMPORT() [1/2]

BBM_DECLARE_FORWARD_IMPORT ( bsdfsample  )

◆ BBM_DECLARE_FORWARD_IMPORT() [2/2]

BBM_DECLARE_FORWARD_IMPORT ( vec3dpair  )

◆ BBM_DECLARE_SHORTHAND() [1/2]

BBM_DECLARE_SHORTHAND ( BsdfSample_t  ,
bsdfsample   
)

◆ BBM_DECLARE_SHORTHAND() [2/2]

BBM_DECLARE_SHORTHAND ( Vec3dPair_t  ,
vec3dpair   
)

◆ BBM_ENUM() [1/3]

BBM_ENUM ( bsdf_attr  ,
None  ,
DiffuseScale  ,
DiffuseParameter  ,
SpecularScale  ,
SpecularParameter  ,
Dependent  ,
Diffuse  ,
Specular  ,
Scale  ,
Parameter  ,
All   
)

◆ BBM_ENUM() [2/3]

BBM_ENUM ( bsdf_flag  ,
None  ,
Diffuse  ,
Specular  ,
All   
)

◆ BBM_ENUM() [3/3]

BBM_ENUM ( unit_t  ,
Radiance  ,
Importance   
)

◆ begin()

auto begin ( T &&  t)

◆ binary_search_named()

auto binary_search_named ( const std::string &  str,
NAMED &&  named,
PROCESS &&  process,
Ts &&...  context 
)
inline

Run-time binary search for a matching name in a named tuple based on a string. The (index of the) found element is forwarded to a processing lambda.

Parameters
str= string of name to find
named= (sorted) named tuple
process= lambda function to process the found element
context...= additional parameters to pass to process

Q&A:

  • Why call a processing lambda? Each element in the tuple can potentially have a different type. Hence we cannot just return the found result.
  • Why not return an index to the found element? The returned index would not be a constexpr, and hence you cannot use it to get the corresponding element with std::get.
  • What is the signature of the process lambda: The lambda takes the index of the found element as a template parameter (size_t), and it takes the following run-time arguments: a 'const std::string&' of the searched for string, the named tuple, and all context variables.
  • What if no match is found? the process lambda is expected to check if (index < NAMED::size) and that (str == std::get<IDX>(named))
  • What is the goal of the 'context' variables? To give the processing lambda access to any data that it needs to complete its task (including variables to store results in).
  • Can process return a result? Yes, as long as the return type is the same regardless of the index of the found element. Consider using std::any or context variables if this is not possible.

◆ bsdf_attr_flag()

constexpr auto bsdf_attr_flag ( )
inlineconstexpr

◆ cbegin()

auto cbegin ( T &&  t)

◆ cend()

auto cend ( T &&  t)

◆ closeDynamicLibrary()

void closeDynamicLibrary ( dl_handle_t  handle)
inline

◆ constfor() [1/2]

constexpr void constfor ( F &&  f)
inlineconstexpr

constfor given the number of iterations

◆ constfor() [2/2]

constexpr void constfor ( F &&  f,
std::index_sequence< IDX... >   
)
inlineconstexpr

constfor given an index sequence of indexes.

◆ constforeach()

constexpr void constforeach ( F &&  f)
inlineconstexpr

constforeach over all typenames in T.

◆ convertFromHalfwayDifference()

std::pair< vec3d< T >, vec3d< T > > convertFromHalfwayDifference ( const vec3d< T > &  half,
const vec3d< T > &  diff 
)

Convert from Halfway-Difference to Canonical parameterization.

Parameters
a= first vector
b= second vector

◆ convertToHalfwayDifference()

std::pair< vec3d< T >, vec3d< T > > convertToHalfwayDifference ( const vec3d< T > &  a,
const vec3d< T > &  b 
)

Convert fro Canonical to the Halfway-Difference parameterization.

Parameters
a= first vector
b= second vector

◆ cperp()

vec2d< T > cperp ( const vec2d< T > &  v)
inline

Returns the righthand (counterclockwise) perpendicular vector of a 2D vector.

Parameters
vInput vector
Returns
(-y, x)

◆ cross()

constexpr vec3d< T > cross ( const vec3d< T > &  a,
const vec3d< T > &  b 
)
inlineconstexpr

Cross product of two 3D vectors.

Parameters
a= first vector
b= second vector

◆ default_value()

constexpr auto default_value ( )
inlineconstexpr

◆ detach_gradient()

auto detach_gradient ( T &  t)

Detach the value from the gradient computations.

Parameters
t= variable to detach
Returns
a reference to the raw value

Note: if the variable does not support gradients, then the value is returned unchanged.

◆ detach_gradients()

auto detach_gradients ( PARAM &&  param)
inline

Get the detached values from a parameter set.

◆ difference()

vec3d< T > difference ( const vec3d< T > &  a,
const vec3d< T > &  b 
)

Difference vector.

Parameters
a= first vector
b= second vector

◆ end()

auto end ( T &&  t)

◆ enumerate() [1/2]

void enumerate ( T &&  obj,
CALLBACK &&  callback 
)

iterable object => enumerate(begin(), ..., end())

◆ enumerate() [2/2]

void enumerate ( T &&  value,
CALLBACK &&  callback 
)

Convertible to VALUE => callback.

◆ enumerate_default_parameters()

void enumerate_default_parameters ( bsdf_attr  flag,
MODEL &&  model,
CALLBACK &&  callback 
)
inline

Enumerate the default values of the attributes from a bsdf model.

◆ enumerate_lower_bound()

void enumerate_lower_bound ( bsdf_attr  flag,
MODEL &&  model,
CALLBACK &&  callback 
)
inline

Enumerate the lower bounds of the attributes from a bsdf model.

◆ enumerate_parameters()

void enumerate_parameters ( bsdf_attr  flag,
MODEL &&  model,
CALLBACK &&  callback 
)
inline

Enumerate the values of the attributes from a bsdf model.

◆ enumerate_upper_bound()

void enumerate_upper_bound ( bsdf_attr  flag,
MODEL &&  model,
CALLBACK &&  callback 
)
inline

Enumerate the upper bounds of the attributes from a bsdf model.

◆ factorial()

constexpr T factorial ( size_t  n)
constexpr

Compute n!

Template Parameters
T= type to return (default = unsigned long long int)
Returns
n!

Throws an exception if n > max_factorial<T>.

◆ forward_gradient()

void forward_gradient ( T &  t)

Enable forward gradient tracking.

Parameters
t= variable to track

static_assert if T is not differentiable.

◆ forward_gradients()

void forward_gradients ( PARAM &&  param)
inline

Forward computation of gradients on a parameter set.

◆ fromString()

T fromString ( const std::string &  str)
inline

fromString alias

◆ gamma_p()

auto gamma_p ( const TA &  a,
const TX &  x 
)
inline

Normalized incomplete lower gamma function.

\( P(a,x) = \frac{\gamma(a,x)}{\Gamma(a)} = \frac{1}{\Gamma(a)} \int^x_0 e^{-t} t^{a-1} dt \)

◆ gamma_p_inv()

auto gamma_p_inv ( const TA &  a,
const TP &  p 
)
inline

the inverse of the normalized upper incomplete gamma function

\( x = P^{-1}(a, p)\)

such that \( p = P(a, x) \).

◆ gamma_pq()

auto gamma_pq ( const TA &  a,
const TX &  x 
)
inline

Normalized incomplete upper and lower gamma function.

◆ gamma_q()

auto gamma_q ( const TA &  a,
const TX &  x 
)
inline

Normalized incomplete upper gamma function.

\( Q(a,x) = 1 - P(a,x) = \frac{\Gamma(a,x)}{\Gamma(a)} = \frac{1}{\Gamma(a)} \int^\infty_x e^{-t} t^{a-1} dt \)

◆ gamma_q_inv()

auto gamma_q_inv ( const TA &  a,
const TQ &  q 
)
inline

the inverse of the normalized lower incomplete gamma function

\( x = Q^{-1}(a, q)\)

such that \( q = Q(a, x) \).

◆ get() [1/2]

constexpr decltype(auto) get ( const T &  src)
inlineconstexpr

◆ get() [2/2]

constexpr decltype(auto) get ( T &&  src)
inlineconstexpr

◆ get_gradients()

auto get_gradients ( PARAM &&  param)
inline

Get the gradient from a parameter set.

◆ gradient()

auto gradient ( T &  t)

Return the gradient.

Parameters
t= variable to return the tracked gradient
Returns
tracked gradient (const reference)

static_assert if T is not differentiable.

◆ halfway()

vec3d< T > halfway ( const vec3d< T > &  a,
const vec3d< T > &  b 
)

Halfway vector (3D)

Parameters
a= first vector
b= second vector

◆ identity()

constexpr M identity ( void  )
inlineconstexpr

create an identity matrix

◆ is_gradient_tracked()

bool is_gradient_tracked ( const T &  t)

Checks if gradients are enabled for a variable.

Parameters
t= variable to check
Returns
true if the variable is tracked.

◆ is_set()

constexpr auto is_set ( const FLAGNAME &  a,
const FLAG &  flag 
)
inlineconstexpr

Check if all in 'flag' are also set in 'a'; compatible with packet types.

◆ linear_search_named()

auto linear_search_named ( const std::string &  str,
NAMED &&  named,
PROCESS &&  process,
Ts &&...  context 
)
inline

linear search for unsorted named tuples

Parameters
str= string to find
named= named tuple to search
process= lambda function to process the found element
context...= additional parameters to pass to process

Process will be called with IDX == NAMED::size if not found.

◆ loadDynamicLibrary()

dl_handle_t loadDynamicLibrary ( const std::string &  name)
inline

◆ lookup()

RET lookup ( C &&  container,
const Index &  idx,
const index_mask_t< Index > &  mask = true 
)
inline

Generalize backbone::lookup to include containers of tuples/named tuples/reflection-supported types.

Template Parameters
RET= return type; must support reflection
Parameters
container= a container to lookup from
idx= index of the elements to lookup
mask= enable/disable lanes

When tuple/named or reflection supported type, we lookup each element seperately to support packet data structures.

◆ lower_bound()

constexpr auto lower_bound ( )
inlineconstexpr

◆ make_alternative()

alternative< BSDFMODEL >::type make_alternative ( const BSDFMODEL &  src)

COnstruct an equivalent alternative BSDF. Should be specialized for each model that provides this option.

◆ make_bsdf_ptr() [1/5]

bsdf_ptr< get_config< BSDFTYPE > > make_bsdf_ptr ( ARGS...  args)

Helper method for making a bsdf_ptr from a BSDF (new construction)

Template Parameters
BSDFTYPE= BSDF type that the ptr will point to.
Parameters
args= constuctor arguments of the BSDF type.

This method allocates a new BSDF of BSDFTYPE, and constructs it with the given arguments. The bsdf_ptr owns the BSDF type object.

◆ make_bsdf_ptr() [2/5]

bsdf_ptr< get_config< BSDFMODEL > > make_bsdf_ptr ( ARGS...  args)

Helper method for making a bsdf_ptr from a BSDF MODEL (new construction)

Template Parameters
BSDFMODEL= BSDF model that the ptr will point to.
Parameters
args= constuctor arguments of the BSDF type.

This method allocates a new BSDF of bsdf<BSDFMODEL>, and constructs it with the given arguments. The bsdf_ptr owns the BSDF type object.

◆ make_bsdf_ptr() [3/5]

bsdf_ptr< CONF > make_bsdf_ptr ( const bsdf_ptr< CONF > &  arg)

Helper method for making a bsdf_ptr (avoid bsdf_ptr of bsdf_ptr)

Parameters
arg= bsdf_ptr object we want to copy

◆ make_bsdf_ptr() [4/5]

bsdf_ptr< get_config< BSDFMODEL > > make_bsdf_ptr ( const BSDFMODEL &  arg)

Helper method for making a bsdf_ptr from a BSDF MODEL (copy construction)

Parameters
arg= BSDF model object we want to copy and have the bsdf_ptr point to.

This method allocates a bsdf<BSDFMODEL> object (copy from arg). The bsdf_ptr owns the copied object.

◆ make_bsdf_ptr() [5/5]

bsdf_ptr< get_config< BSDFTYPE > > make_bsdf_ptr ( const BSDFTYPE &  arg)

Helper method for making a bsdf_ptr from a BSDF (copy construction)

Parameters
arg= BSDF object we want to copy and have the bsdf_ptr point to.

This method allocates a copy of the BSDFTYPE object (arg). The bsdf_ptr owns the copied object.

◆ make_from() [1/3]

constexpr T make_from ( )
inlineconstexpr

Make an object T from a series of non-array template literals.

Template Parameters
T= object-type to create
V= template literals to pass as constructor arguments.
Returns
T(V...)

Will be at compile time if the constructor of T is constexpr.

◆ make_from() [2/3]

constexpr T make_from ( )
inlineconstexpr

Make an object T from the values passed in a array literal.

Template Parameters
T= object-type to create
A= std::array<arg_type, N>, i.e., N arguments to be passed to T.
Returns
T(A[0], A[1], ...., A[N])

◆ make_from() [3/3]

constexpr T make_from ( Args &&...  args)
inlineconstexpr

Make an object T from a pack of arguments.

Template Parameters
T= object type to construct
Parameters
args= argument pack
Returns
T(args...)

This function is essentially identical to directly calling T(args...) except for one key difference: this method will compile even if T is not constructible from 'args'. At run-time an exeption is thrown in the latter case.

◆ make_loss_ptr() [1/5]

loss_ptr< get_config< LOSSTYPE > > make_loss_ptr ( ARGS &&...  args)

Helper method for making loss_ptr from a LOSS (new construction)

Template Parameters
LOSSTYPE= LOSS type that the pointer will point to.
Parameters
args= constructor arguments for the LOSS type consructor

This method allocates a new LOSS of LOSSTYPE, and constructs it with the given arguments. The loss_ptr owns the created object.

◆ make_loss_ptr() [2/5]

loss_ptr< get_config< LOSSFUNC > > make_loss_ptr ( ARGS &&...  args)

Helper method for making a loss_ptr from a LOSS FUNCTION (new construction)

Template Parameters
LOSSFUNCTION= loss function to encapsulate
Parameters
args= constructor arguments

Allocates a new loss<LOSSFUNCTION> and constructs it with the given args. The bsdf_ptr owns the BSDF object.

◆ make_loss_ptr() [3/5]

loss_ptr< CONF > make_loss_ptr ( const loss_ptr< CONF > &  arg)

Helper method for making loss_ptr (avoid loss_ptr of loss_ptr)

Parameters
arg= loss_ptr object we want to copy

◆ make_loss_ptr() [4/5]

loss_ptr< get_config< LOSSFUNC > > make_loss_ptr ( const LOSSFUNC &  arg)

Helper method for making a loss_ptr from a LOSS FUNCTION (copy constructor)

Parameters
arg= LOSS FUNCTION object we want to copy

A copy of the loss<LOSSFUNCTION> is allocated (copied from arg). The loss_ptr owns the copied object

◆ make_loss_ptr() [5/5]

loss_ptr< get_config< LOSSTYPE > > make_loss_ptr ( const LOSSTYPE &  arg)

Helper method for making a loss_ptr from a LOSS (copy construction)

Parameters
arg= LOSS object we want to copy

A copy of the loss is allocated. The loss_ptr owns the copied object

◆ make_named() [1/2]

constexpr named< anonymize_t< T >, NAMES... > make_named ( T &&  t)
constexpr

Make a named of a gettable type (with size == #NAMES); renames if the type is a named container.

◆ make_named() [2/2]

constexpr auto make_named ( Ts &&...  ts)
constexpr

Make a named tuple from a list of arguments (number of arguments == #NAMES)

◆ make_optimizer_ptr() [1/5]

optimizer_ptr< get_config< OPTIMIZER > > make_optimizer_ptr ( ARGS &&...  args)

Helper method for making an optimizer_ptr from an optimizer (new construction)

Template Parameters
OPTIMIZER= optimizer type that the pointer will point to.
Parameters
args= constructor arguments for the OPTIMIZER

The method allocates a new OPTIMIZER and constructs it with the given arguments. The optimizer_ptr owns the created object.

◆ make_optimizer_ptr() [2/5]

optimizer_ptr< get_config< OPTIMIZATION_ALGORITHM > > make_optimizer_ptr ( ARGS &&...  args)

Helper method for making an optimizer_ptr from a OPTIMIZATION_ALGORITHM.

Template Parameters
OPTIMIZATION_ALGORITHM= algorithm to point to
Parameters
args= constructor arguments

Allocates a new optmizer<OPTIMIZATION_ALGORITHM> and constructs it with the given args. The optimizer_ptr owns the OPTIMIZER object.

◆ make_optimizer_ptr() [3/5]

optimizer_ptr< get_config< OPTIMIZATION_ALGORITHM > > make_optimizer_ptr ( const OPTIMIZATION_ALGORITHM &  arg)

Helper method for making an optimizer_ptr from a OPTIMIZATION_ALGORITHM (copy construction)

Parameters
arg= optimization algorithm to copy

A copy of the optimizer<OPTIMIZATION_ALGORITHM> is allocated (copied from arg). The optimizer_ptr owns the copied object.

◆ make_optimizer_ptr() [4/5]

optimizer_ptr< get_config< OPTIMIZER > > make_optimizer_ptr ( const OPTIMIZER &  arg)

Helper method for making an optimizer_ptr from a OPTIMZER (copy construction)

Parameters
arg= optimizer to copy

A copy of the optimizer is allocated. The optimizer_ptr owns the copied object

◆ make_optimizer_ptr() [5/5]

optimizer_ptr< CONF > make_optimizer_ptr ( const optimizer_ptr< CONF > &  arg)

Helper method for making an optimizer_ptr (avoid optimizer_ptr of optimizer_ptr>)

Parameters
arg= optimizer_ptr object we want to copy

◆ make_ref_tuple()

constexpr auto make_ref_tuple ( ARGS &&...  args)
inlineconstexpr

Make a tuple of references.

Returns std::tuple<ARGS...>, and therefore this method differs from:

  • std::make_tuple which returns a std::tuple<std::decay_t<ARGS>...>
  • std::forward_as_tuple which returns a std::tuple<ARGS&&...>

◆ max_factorial()

consteval size_t max_factorial ( void  )

Returns the largest possible factorial index for a given type that does not result in an overflow.

Template Parameters
T= type to compute factorial in (default = unsigned long long int)
Returns
max factorial index

◆ merge_named_flatten()

constexpr auto merge_named_flatten ( T &&  t)
inlineconstexpr

flatten a named type with merging names

merge_named_flatten( named< std::tuple<named<std::tuple<float, char>, "A", "B">, int>, "C", "D" > )

yields

named<std::tuple<float, char, int>, "C.A", "C.B", "D">

The default seperator symbol is ".", but this can be changed by passing a different symbols as the first template argument.

◆ multirange_for()

void multirange_for ( FUNC &&  func,
Ts &&...  containers 
)
inline

ranged for loop over multiple containers at once

Parameters
func= function to call in each loop. The function is expected to return void, and takes as many arguments as there are containers. For each call, a reference to the corresponding element in each container is passed.
containers...= containers. If not iterable, then the value is passed to each call of FUNC.

Example:

multirange_for( [&](auto& a_element, auto& b_element)
{
a += b;
}, a_container, b_container);
void multirange_for(FUNC &&func, Ts &&... containers)
ranged for loop over multiple containers at once
Definition: multirange_for.h:43

This method will compute 'a_container += b_container'.

Note: all containers must either have size==1 or the same size.

◆ named_cat()

constexpr auto named_cat ( T &&...  t)
inlineconstexpr

cat named types

named_cat( named<std::tuple<...>, "A", "B">{a,b}, named<std::tuple<...>, "C">{c} )

yields

named<std::tuple<...>, "A", B", "C">{a,b,c}

◆ named_flatten()

constexpr auto named_flatten ( T &&  t)
inlineconstexpr

flatten a named type without merging names

named_flatten( named< std::tuple<named<std::tuple<float, char>, "A", "B">, int>, "C", "D" > )

yields

named<std::tuple<float, char, int>, "A", "B", "D">

◆ operator""_arg()

arg< void, NAME > operator""_arg ( void  )

arg literal

◆ operator""_sl()

constexpr decltype(LIT) operator""_sl ( void  )
constexpr

custom literal operator for string_literals

◆ operator%()

auto operator% ( const vector< T > &  v,
const U &  u 
)
inline

◆ operator%=()

auto & operator%= ( vector< T > &  v,
const U &  u 
)
inline

◆ operator&()

constexpr FLAGNAME operator& ( FLAGNAME  a,
FLAGNAME  b 
)
inlineconstexpr

Get the shared flags.

◆ operator&=()

constexpr FLAGNAME & operator&= ( FLAGNAME &  a,
FLAGNAME  b 
)
inlineconstexpr

Update 'a' with a & b.

◆ operator*() [1/2]

auto operator* ( const T &  v,
const vector< U > &  u 
)
inline

◆ operator*() [2/2]

auto operator* ( const vector< T > &  v,
const U &  u 
)
inline

◆ operator*=()

auto & operator*= ( vector< T > &  v,
const U &  u 
)
inline

◆ operator+() [1/3]

auto operator+ ( const T &  v,
const vector< U > &  u 
)
inline

◆ operator+() [2/3]

auto operator+ ( const vector< T > &  v,
const U &  u 
)
inline

◆ operator+() [3/3]

constexpr FLAGNAME operator+ ( FLAGNAME  a,
FLAGNAME  b 
)
inlineconstexpr

Conact two flags.

◆ operator+=() [1/2]

constexpr FLAGNAME & operator+= ( FLAGNAME &  a,
FLAGNAME  b 
)
inlineconstexpr

Update 'a' with a+b.

◆ operator+=() [2/2]

auto & operator+= ( vector< T > &  v,
const U &  u 
)
inline

◆ operator-()

auto operator- ( const vector< T > &  v,
const U &  u 
)
inline

◆ operator-=()

auto & operator-= ( vector< T > &  v,
const U &  u 
)
inline

◆ operator/()

auto operator/ ( const vector< T > &  v,
const U &  u 
)
inline

◆ operator/=()

auto & operator/= ( vector< T > &  v,
const U &  u 
)
inline

◆ operator<<() [1/10]

std::ostream & operator<< ( std::ostream &  s,
const bbm::arg< T, N, D > &  arg 
)

Print bbm::arg.

◆ operator<<() [2/10]

std::ostream & operator<< ( std::ostream &  s,
const bbm::args< ARGS... > &  args 
)

Print bbm::args.

◆ operator<<() [3/10]

std::ostream & operator<< ( std::ostream &  s,
const bbm::bsdf_prop prop 
)

◆ operator<<() [4/10]

std::ostream & operator<< ( std::ostream &  s,
const bbm::bsdfsample< CONF > &  ss 
)

◆ operator<<() [5/10]

std::ostream & operator<< ( std::ostream &  s,
const bbm::vec3dpair< CONF > &  rs 
)

◆ operator<<() [6/10]

std::ostream & operator<< ( std::ostream &  s,
const BSDF &  bsdf 
)

◆ operator<<() [7/10]

std::ostream & operator<< ( std::ostream &  s,
const BSDFMODEL &  model 
)

ostream output uses toString conversion

◆ operator<<() [8/10]

std::ostream & operator<< ( std::ostream &  s,
const NDF &  ndf 
)

◆ operator<<() [9/10]

std::ostream & operator<< ( std::ostream &  s,
const std::vector< T > &  vec 
)

◆ operator<<() [10/10]

std::ostream & operator<< ( std::ostream &  s,
ENUM  e 
)

ostream output uses toString conversion

◆ operator^()

constexpr FLAGNAME operator^ ( FLAGNAME  a,
FLAGNAME  b 
)
inlineconstexpr

Get the flags from 'a' that are not in 'b'.

◆ operator^=()

constexpr FLAGNAME & operator^= ( FLAGNAME &  a,
FLAGNAME  b 
)
inlineconstexpr

Update 'a' with a^b,.

◆ operator|()

constexpr FLAGNAME operator| ( FLAGNAME  a,
FLAGNAME  b 
)
inlineconstexpr

Concat two flags.

◆ operator|=()

constexpr FLAGNAME & operator|= ( FLAGNAME &  a,
FLAGNAME  b 
)
inlineconstexpr

Update 'a' with a | b.

◆ operator~()

constexpr FLAGNAME operator~ ( FLAGNAME  a)
inlineconstexpr

Set/unset flag that are unset/set respectively.

◆ parameter_default_values() [1/2]

auto parameter_default_values ( const BSDF &  bsdf,
bsdf_attr  flag = bsdf_attr::All 
)
inline

Enumerate the default parameters of a BSDF in a vector.

Parameters
model= bsdf model to extract default parameters from
flag= bsdf_attr flag to select a subset of the parameters
Returns
vector of references to the bsdf parameter values

◆ parameter_default_values() [2/2]

auto parameter_default_values ( MODEL &&  model,
bsdf_attr  flag = bsdf_attr::All 
)
inline

Enumerate the default parameters of a BSDF model in a vector.

Parameters
model= bsdf model to extract default parameters from
flag= bsdf_attr flag to select a subset of the parameters
Returns
vector of references to the bsdf parameter values

◆ parameter_lower_bound() [1/2]

auto parameter_lower_bound ( const BSDF &  bsdf,
bsdf_attr  flag = bsdf_attr::All 
)
inline

Enumerate the lower bound of the parameters of a BSDF in a vector.

Parameters
model= bsdf model to extract lower bound from
flag= bsdf_attr flag to select a subset of the parameters
Returns
vector of references to the bsdf parameter values

◆ parameter_lower_bound() [2/2]

auto parameter_lower_bound ( MODEL &&  model,
bsdf_attr  flag = bsdf_attr::All 
)
inline

Enumerate the lower bound of the parameters of a BSDF model in a vector.

Parameters
model= bsdf model to extract lower bound from
flag= bsdf_attr flag to select a subset of the parameters
Returns
vector of references to the bsdf parameter values

◆ parameter_upper_bound() [1/2]

auto parameter_upper_bound ( const BSDF &  bsdf,
bsdf_attr  flag = bsdf_attr::All 
)
inline

Enumerate the upper bound of the parameters of a BSDF in a vector.

Parameters
model= bsdf model to extract upper bound from
flag= bsdf_attr flag to select a subset of the parameters
Returns
vector of references to the bsdf parameter values

◆ parameter_upper_bound() [2/2]

auto parameter_upper_bound ( MODEL &&  model,
bsdf_attr  flag = bsdf_attr::All 
)
inline

Enumerate the upper bound of the parameters of a BSDF model in a vector.

Parameters
model= bsdf model to extract upper bound from
flag= bsdf_attr flag to select a subset of the parameters
Returns
vector of references to the bsdf parameter values

◆ parameter_values() [1/2]

auto parameter_values ( BSDF &  bsdf,
bsdf_attr  flag = bsdf_attr::All 
)
inline

Enumerate the parameters of a BSDF in a vector.

Parameters
model= bsdf model to extract parameters from
flag= bsdf_attr flag to select a subset of the parameters
Returns
vector of references to the bsdf parameter values

◆ parameter_values() [2/2]

auto parameter_values ( MODEL &&  model,
bsdf_attr  flag = bsdf_attr::All 
)
inline

Enumerate the parameters of a BSDF model in a vector.

Parameters
model= bsdf model to extract parameters from
flag= bsdf_attr flag to select a subset of the parameters
Returns
vector of references to the bsdf parameter values

◆ perp()

vec2d< T > perp ( const vec2d< T > &  v)
inline

Returns the lefthand (clockwise) perpendicular vector of a 2D vector.

Parameters
vInput vector
Returns
(y, -x)

◆ pick()

constexpr auto pick ( T &&  t)
constexpr

Pick a subset/reshuffle a named container T and return as a named tuple.

◆ poly() [1/2]

constexpr auto poly ( T &&  x,
T0 &&  c0,
Ts &&...  c 
)
inlineconstexpr

Compute a polynomial \( p(x) = \sum_{i=0} x^i * c_i \).

Parameters
x= value to evaluate the polynomial at
c0= constant coefficient
c...= remainder of coefficients.
Returns
the evaluation of the polynomial

Determins the max degree based on the number of coefficients.

◆ poly() [2/2]

constexpr auto poly ( T &&  x,
T0 &&  c0,
Ts &&...  c 
)
inlineconstexpr

Compute a polynomial \( p(x) = \sum_{i=0}^N x^i * c_i \).

Template Parameters
N= max polynomial degree
Parameters
x= value to evaluate the polynomial at
c0= constant coefficient
c...= remainder of coefficients.
Returns
the evaluation of the polynomial

Will only evaluate the coefficients less than max degree+1.

◆ postfix_names()

constexpr auto postfix_names ( named< T, NAMES... >  t)
inlineconstexpr

postfix names in type

postfix_names<"_BLA", named<std::tuple<...>, "A", "B">{a,b}

yields

named<std::tuple<...>, "A_BLA", "B_BLA">{a,b}

◆ prefix_names()

constexpr auto prefix_names ( named< T, NAMES... >  t)
inlineconstexpr

prefix names in type

prefix_names<"BLA_", named<std::tuple<...>, "A", "B">{a,b}

yields

named<std::tuple<...>, "BLA_A", "BLA_B">{a,b}

◆ reflect() [1/2]

vec3d< T > reflect ( const vec3d< T > &  v)
inline

Reflects a 3D vector around Z=1.

Parameters
vInput vector to reflect

◆ reflect() [2/2]

vec3d< T > reflect ( const vec3d< T > &  v,
const vec3d< T > &  normal 
)
inline

Reflects a 3D vector.

Parameters
vInput vector to reflect
normalNormal to reflect around

◆ rotation2d() [1/2]

mat2d< std::decay_t< T > > rotation2d ( const vec2d< T > &  cossin)
inline

2D rotation matrix

Parameters
cossin= (cos, sin)

◆ rotation2d() [2/2]

mat2d< std::decay_t< T > > rotation2d ( angle)

2D rotation matrix

Parameters
angle= rotation angle

◆ rotationX() [1/2]

mat3d< std::decay_t< T > > rotationX ( const vec2d< T > &  cossin)

Rotation around the X-axis.

Parameters
angle= rotation angle

◆ rotationX() [2/2]

mat3d< std::decay_t< T > > rotationX ( angle)

Rotation around the X-axis.

Parameters
angle= rotation angle

◆ rotationY() [1/2]

mat3d< std::decay_t< T > > rotationY ( const vec2d< T > &  cossin)

Rotation around the Y-axis.

Parameters
angle= rotation angle

◆ rotationY() [2/2]

mat3d< std::decay_t< T > > rotationY ( angle)

Rotation around the Y-axis.

Parameters
angle= rotation angle

◆ rotationZ() [1/2]

mat3d< std::decay_t< T > > rotationZ ( const vec2d< T > &  cossin)

Rotation around the Z-axis.

Parameters
angle= rotation angle

◆ rotationZ() [2/2]

mat3d< std::decay_t< T > > rotationZ ( angle)

Rotation around the Z-axis.

Parameters
angle= rotation angle

◆ select() [1/2]

constexpr auto select ( MASK &&  mask,
A &&  a,
B &&  b 
)
inlineconstexpr

◆ select() [2/2]

constexpr auto select ( MASK &&  mask,
const A &  a,
const A &  b 
)
inlineconstexpr

◆ set()

void set ( C &&  container,
const Index &  idx,
Value &&  value,
const index_mask_t< Index > &  mask = true 
)
inline

Generalization of backbone::set to include tuples/named/reflection-supported objects.

Parameters
containercontainer to set data in
indxindex at which to set the data
valuevalue to store
maskenable/disbale lanes

When tuple/named or reflection-type, we set each element seperately to support packet data structures.

◆ size()

size_t size ( T &&  t)

◆ sort_named()

constexpr auto sort_named ( NAMED &&  named,
PARTIAL &&  partial = PARTIAL{} 
)
inlineconstexpr

sort a named tuple by name using insert-sort.

Parameters
named= named tuple to sort
Template Parameters
IDX= start index of elements to sort; recommended default value = 0
PARTIAL= partial solution to insert into; recommended default value = empty named tuple
Returns
sorted(NAMED[IDX..END], PARTIAL)

Details: this is a constexpr recursive method. It will attempt to insert the IDX-th element in PARTIAL, and then recurse to the IDX+1 element, until all elements are inserted.

◆ subnamed()

constexpr auto subnamed ( NAMED &&  named)
inlineconstexpr

get a subset of a named tuple

Template Parameters
START= index of first element
COUNT= number of elements
Parameters
named= named tuple
Returns
named tuple with elements [START, START+1, ..., START+COUNT-1

◆ subtuple()

constexpr auto subtuple ( TUP &&  tup)
inlineconstexpr

subtuple

Template Parameters
START= start index of elements to include in the new tuple
COUNT= number of elements to include

◆ tgamma()

auto tgamma ( const TA &  a,
const TX &  x 
)
inline

Unnormalized incomplete upper gamma function.

\( \gamma(a,x) = \int^\infty_x e^{-t} t^{a-1} dt \)

◆ tgamma_lower()

auto tgamma_lower ( const TA &  a,
const TX &  x 
)
inline

Unnormalized incomplete lower gamma function.

\( \gamma(a,x) = \int^x_0 e^{-t} t^{a-1} dt \)

◆ tie()

named< std::tuple< Ts &... >, NAMES... > tie ( Ts &&...  src)

Tie by name.

◆ to_string_literal()

constexpr auto to_string_literal ( void  )
constexpr

convert integrals to string_literal

Template Parameters
N= (integer) literal to covert into a string_literal
base= conversion base; must be less than 16. Default base=10.

◆ to_tuple()

auto to_tuple ( T &&  t)
inline

Create a tuple from any other type that supports std::get.

◆ toGlobalShadingFrame()

mat3d< std::decay_t< T > > toGlobalShadingFrame ( const vec3d< T > &  normal)

Construct a local shading frame to global frame transformation given a normal direction.

Parameters
normal= local shading frame normal direction
Returns
shading frame transformation matrix from local to global frame.

Create a shading frame transformation from the local to the global shading frame determined by the surface normal. The tangent vector is randomly selected.

◆ toLocalShadingFrame()

auto toLocalShadingFrame ( const vec3d< T > &  normal)
inline

Construct a global to local shading frame transformation.

◆ toString()

std::string toString ( const T &  obj)
inline

toString alias

◆ track_gradient()

void track_gradient ( T &  t,
bool  toggle = true 
)

Enable/disable tracking of gradients for a variable.

Parameters
t= variable to track
toggle= enable/disable

static_assert if T is not differentiable.

◆ track_gradients()

void track_gradients ( PARAM &&  param,
bool  toggle = true 
)
inline

Enable gradients for a parameter set.

◆ transpose()

constexpr M transpose ( const M &  m)
inlineconstexpr

Bring 'transpose' in the bbm namespace.

◆ tuple_add_const()

constexpr auto tuple_add_const ( T &&  t)
inlineconstexpr

tuple_add_const to each element

◆ tuple_flatten()

constexpr auto tuple_flatten ( T &&  t)
inlineconstexpr

Recursively flatten a tuple.

The resulting tuple is the concatenation of all elements of child tuples.

◆ tuple_remove_const()

constexpr auto tuple_remove_const ( T &&  t)
inlineconstexpr

tuple_remove_const from each element

◆ upper_bound()

constexpr auto upper_bound ( )
inlineconstexpr

◆ value()

decltype(auto) value ( T &&  t)

return the value of an attribute, or if not an attribute the object

◆ value_copy_named()

constexpr auto value_copy_named ( const named< TUP, NAMES... > &  src)
inlineconstexpr

value copy a named tuple

Parameters
src= named tuple, possibly with references
Returns
a copy of the named tuple without references

◆ value_copy_tuple()

constexpr auto value_copy_tuple ( const std::tuple< ARGS... > &  tup)
inlineconstexpr

Value-copy a tuple.

Parameters
tup= tuple, possibly with references
Returns
a copy of the tuple without references.

For example std::tuple<int&, int> will be converted to std::tuple<int, int>

Variable Documentation

◆ binary_search_named_v

constexpr size_t binary_search_named_v = detail::binary_search_named<NAME, std::decay_t<NAMED>>()
staticconstexpr

binary search a sorted named tuple

Template Parameters
NAME= name to search for
NAMED= named tuple
Returns
index of best matching name (index of first name that is equal or larger)

◆ dependent_false_v

constexpr bool dependent_false_v = dependent_false<T...>::value
staticconstexpr

◆ dependent_true_v

constexpr bool dependent_true_v = !dependent_false<T...>::value
staticconstexpr

◆ is_arg_v

constexpr bool is_arg_v = is_arg<T>::value
inlineconstexpr

◆ is_args_v

constexpr bool is_args_v = is_args<T>::value
inlineconstexpr

◆ is_array_v

constexpr bool is_array_v = is_array<T>::value
inlineconstexpr

◆ is_bbm_reference_v

constexpr bool is_bbm_reference_v = is_bbm_reference<T>::value
inlineconstexpr

◆ is_bbm_vector_v

constexpr bool is_bbm_vector_v = is_bbm_vector<T>::value
inlineconstexpr

◆ is_cast_itr_v

constexpr bool is_cast_itr_v = is_cast_itr<T>::value
inlineconstexpr

◆ is_const_v

constexpr bool is_const_v = is_const<T>::value
inlineconstexpr

◆ is_enumerable_v

constexpr bool is_enumerable_v = is_enumerable<VALUE,T>::value
inlineconstexpr

◆ is_named_sorted_v

constexpr bool is_named_sorted_v = detail::is_named_sorted<NAMED>()
staticconstexpr

true if named tuple is sorted by name

◆ is_named_v

constexpr bool is_named_v = is_named<std::decay_t<T>>::value
constexpr

◆ is_string_literal_v

constexpr bool is_string_literal_v = is_string_literal<T>::value
inlineconstexpr

◆ is_string_type_v

constexpr bool is_string_type_v = is_string_type<T>::value
inlineconstexpr

◆ is_tuple_v

constexpr bool is_tuple_v = is_tuple<T>::value
inlineconstexpr

◆ is_vector_v

constexpr bool is_vector_v = is_vector<T>::value
inlineconstexpr

◆ named_equivalence_v

constexpr bool named_equivalence_v = named_equivalence<U,V>::value
staticconstexpr

◆ typestring

constexpr std::string_view typestring = bbm::detail::typestring_impl<T>()
staticconstexpr