piranha  0.10
Namespaces | Classes | Typedefs | Enumerations | Functions
piranha Namespace Reference

Root piranha namespace. More...

Namespaces

 literals
 Inline namespace for the definition of user-defined literals.
 
 math
 Math namespace.
 

Classes

class  array_key
 Array key. More...
 
class  base_series_multiplier
 Base series multiplier. More...
 
struct  boost_load_impl
 Default implementation of piranha::boost_load(). More...
 
struct  boost_load_impl< Archive, boost_s11n_key_wrapper< divisor< T > >, divisor_boost_load_enabler< Archive, T > >
 Specialisation of piranha::boost_load() for piranha::divisor. More...
 
struct  boost_load_impl< Archive, boost_s11n_key_wrapper< kronecker_monomial< T > >, k_monomial_boost_load_enabler< Archive, T > >
 Specialisation of piranha::boost_load() for piranha::kronecker_monomial. More...
 
struct  boost_load_impl< Archive, boost_s11n_key_wrapper< monomial< T, S > >, monomial_boost_load_enabler< Archive, T, S > >
 Specialisation of piranha::boost_load() for piranha::monomial. More...
 
struct  boost_load_impl< Archive, boost_s11n_key_wrapper< real_trigonometric_kronecker_monomial< T > >, rtk_monomial_boost_load_enabler< Archive, T > >
 Specialisation of piranha::boost_load() for piranha::real_trigonometric_kronecker_monomial. More...
 
struct  boost_load_impl< Archive, hash_set< T, Hash, Pred >, hash_set_boost_load_enabler< Archive, T, Hash, Pred > >
 Specialisation of piranha::boost_load() for piranha::hash_set. More...
 
struct  boost_load_impl< Archive, mp_integer< SSize >, mp_integer_boost_load_enabler< Archive > >
 Specialisation of piranha::boost_load() for piranha::mp_integer. More...
 
struct  boost_load_impl< Archive, mp_rational< SSize >, mp_rational_boost_load_enabler< Archive, SSize > >
 Specialisation of piranha::boost_load() for piranha::mp_rational. More...
 
struct  boost_load_impl< Archive, real, real_boost_load_enabler< Archive > >
 Specialisation of piranha::boost_load() for piranha::real. More...
 
struct  boost_load_impl< Archive, Series, series_boost_load_enabler< Archive, Series > >
 Specialisation of piranha::boost_load() for piranha::series. More...
 
struct  boost_load_impl< Archive, small_vector< T, std::integral_constant< std::size_t, Size > >, boost_load_vector_enabler< Archive, small_vector< T, std::integral_constant< std::size_t, Size > > > >
 Specialisation of piranha::boost_load() for piranha::small_vector. More...
 
struct  boost_load_impl< Archive, static_vector< T, S >, boost_load_vector_enabler< Archive, static_vector< T, S > > >
 Specialisation of piranha::boost_load() for piranha::static_vector. More...
 
struct  boost_load_impl< Archive, std::string, boost_load_string_enabler< Archive > >
 Specialisation of piranha::boost_load() for std::string. More...
 
struct  boost_load_impl< Archive, T, boost_load_arithmetic_enabler< Archive, T > >
 Specialisation of piranha::boost_load() for arithmetic types. More...
 
struct  boost_load_via_boost_api
 Implementation of piranha::boost_load() via the Boost API. More...
 
struct  boost_s11n_key_wrapper
 Wrapper for the serialization of keys via Boost. More...
 
struct  boost_save_impl
 Default implementation of piranha::boost_save(). More...
 
struct  boost_save_impl< Archive, boost_s11n_key_wrapper< divisor< T > >, divisor_boost_save_enabler< Archive, T > >
 Specialisation of piranha::boost_save() for piranha::divisor. More...
 
struct  boost_save_impl< Archive, boost_s11n_key_wrapper< kronecker_monomial< T > >, k_monomial_boost_save_enabler< Archive, T > >
 Specialisation of piranha::boost_save() for piranha::kronecker_monomial. More...
 
struct  boost_save_impl< Archive, boost_s11n_key_wrapper< monomial< T, S > >, monomial_boost_save_enabler< Archive, T, S > >
 Specialisation of piranha::boost_save() for piranha::monomial. More...
 
struct  boost_save_impl< Archive, boost_s11n_key_wrapper< real_trigonometric_kronecker_monomial< T > >, rtk_monomial_boost_save_enabler< Archive, T > >
 Specialisation of piranha::boost_save() for piranha::real_trigonometric_kronecker_monomial. More...
 
struct  boost_save_impl< Archive, hash_set< T, Hash, Pred >, hash_set_boost_save_enabler< Archive, T, Hash, Pred > >
 Specialisation of piranha::boost_save() for piranha::hash_set. More...
 
struct  boost_save_impl< Archive, mp_integer< SSize >, mp_integer_boost_save_enabler< Archive > >
 Specialisation of piranha::boost_save() for piranha::mp_integer. More...
 
struct  boost_save_impl< Archive, mp_rational< SSize >, mp_rational_boost_save_enabler< Archive, SSize > >
 Specialisation of piranha::boost_save() for piranha::mp_rational. More...
 
struct  boost_save_impl< Archive, real, real_boost_save_enabler< Archive > >
 Specialisation of piranha::boost_save() for piranha::real. More...
 
struct  boost_save_impl< Archive, Series, series_boost_save_enabler< Archive, Series > >
 Specialisation of piranha::boost_save() for piranha::series. More...
 
struct  boost_save_impl< Archive, small_vector< T, std::integral_constant< std::size_t, Size > >, boost_save_vector_enabler< Archive, small_vector< T, std::integral_constant< std::size_t, Size > > > >
 Specialisation of piranha::boost_save() for piranha::small_vector. More...
 
struct  boost_save_impl< Archive, static_vector< T, S >, boost_save_vector_enabler< Archive, static_vector< T, S > > >
 Specialisation of piranha::boost_save() for piranha::static_vector. More...
 
struct  boost_save_impl< Archive, std::string, boost_save_string_enabler< Archive > >
 Specialisation of piranha::boost_save() for std::string. More...
 
struct  boost_save_impl< Archive, T, boost_save_arithmetic_enabler< Archive, T > >
 Specialisation of piranha::boost_save() for arithmetic types. More...
 
struct  boost_save_via_boost_api
 Implementation of piranha::boost_save() via the Boost API. More...
 
class  cache_aligning_allocator
 Allocator that tries to align memory to the cache line size. More...
 
struct  convert_to_impl
 Default functor for the implementation of piranha::convert_to(). More...
 
class  debug_access
 Debug class. More...
 
class  divisor
 Divisor class. More...
 
class  divisor_series
 Divisor series. More...
 
class  dynamic_aligning_allocator
 Memory allocator with runtime alignment support. More...
 
struct  enable_noexcept_checks
 Enable noexcept checks. More...
 
struct  enable_noexcept_checks< term< Cf, Key > >
 Specialisation of piranha::enable_noexcept_checks for piranha::term. More...
 
class  future_list
 Class to store a list of futures. More...
 
class  has_abs
 Type trait to detect the presence of the piranha::math::abs() function. More...
 
class  has_add3
 Detect piranha::math::add3(). More...
 
class  has_binomial
 Type trait to detect the presence of the piranha::math::binomial() function. More...
 
class  has_boost_load
 Detect the presence of piranha::boost_load(). More...
 
class  has_boost_save
 Detect the presence of piranha::boost_save(). More...
 
class  has_convert_to
 Type trait to detect piranha::convert_to(). More...
 
class  has_cosine
 Type trait to detect piranha::math::cos(). More...
 
class  has_degree
 Type trait to detect if type has a degree property. More...
 
class  has_div3
 Detect piranha::math::div3(). More...
 
class  has_gcd
 Detect piranha::math::gcd(). More...
 
class  has_gcd3
 Detect piranha::math::gcd3(). More...
 
class  has_input_begin_end
 Detect the availability of std::begin() and std::end(). More...
 
class  has_ipow_subs
 Type trait to detect the availability of the piranha::math::ipow_subs() function. More...
 
class  has_is_unitary
 Type trait to detect the presence of the piranha::math::is_unitary() function. More...
 
class  has_is_zero
 Type trait to detect the presence of the piranha::math::is_zero() function. More...
 
class  has_lambdify
 Detect the presence of piranha::math::lambdify(). More...
 
class  has_ldegree
 Type trait to detect if type has a low degree property. More...
 
class  has_left_shift
 Left-shift type trait. More...
 
class  has_left_shift_in_place
 In-place left-shift type trait. More...
 
class  has_msgpack_convert
 Detect the presence of piranha::msgpack_convert(). More...
 
class  has_msgpack_pack
 Detect the presence of piranha::msgpack_pack(). More...
 
class  has_mul3
 Detect piranha::math::mul3(). More...
 
class  has_multiply_accumulate
 Type trait to detect the availability of piranha::math::multiply_accumulate(). More...
 
class  has_negate
 Type trait to detect the presence of the piranha::math::negate function. More...
 
class  has_pbracket
 Detect piranha::math::pbracket(). More...
 
class  has_print_coefficient
 Type trait for classes implementing piranha::print_coefficient. More...
 
class  has_print_tex_coefficient
 Type trait for classes implementing piranha::print_tex_coefficient. More...
 
class  has_right_shift
 Right-shift type trait. More...
 
class  has_right_shift_in_place
 In-place right-shift type trait. More...
 
class  has_safe_cast
 Type trait to detect piranha::safe_cast(). More...
 
class  has_sine
 Type trait to detect piranha::math::sin(). More...
 
class  has_sub3
 Detect piranha::math::sub3(). More...
 
class  has_subs
 Type trait to detect the presence of the piranha::math::subs function. More...
 
class  has_t_degree
 Type trait to detect if type has a trigonometric degree property. More...
 
class  has_t_ldegree
 Type trait to detect if type has a trigonometric low degree property. More...
 
class  has_t_lorder
 Type trait to detect if type has a trigonometric low order property. More...
 
class  has_t_order
 Type trait to detect if type has a trigonometric order property. More...
 
class  has_t_subs
 Type trait to detect the presence of the piranha::math::t_subs function. More...
 
class  has_transformation_is_canonical
 Detect piranha::math::transformation_is_canonical(). More...
 
class  has_truncate_degree
 Type trait to detect if types can be used in piranha::math::truncate_degree(). More...
 
class  hash_set
 Hash set. More...
 
class  ipow_substitutable_series
 Toolbox for series suitable for integral power substitution. More...
 
class  is_addable
 Addable type trait. More...
 
class  is_addable_in_place
 In-place addable type trait. More...
 
class  is_boost_loading_archive
 Detect Boost loading archives. More...
 
class  is_boost_saving_archive
 Detect Boost saving archives. More...
 
class  is_cf
 Type trait to detect coefficient types. More...
 
struct  is_container_element
 Type trait for well-behaved container elements. More...
 
class  is_differentiable
 Type trait for differentiable types. More...
 
class  is_divisible
 Divisible type trait. More...
 
class  is_divisible_in_place
 In-place divisible type trait. More...
 
class  is_equality_comparable
 Equality-comparable type trait. More...
 
class  is_equality_function_object
 Type trait to detect equality function objects. More...
 
class  is_evaluable
 Type trait to detect the availability of piranha::math::evaluate(). More...
 
class  is_exponentiable
 Type trait for exponentiable types. More...
 
class  is_forward_iterator
 Forward iterator type trait. More...
 
class  is_function_object
 Function object type trait. More...
 
class  is_greater_than_comparable
 Greater-than-comparable type trait. More...
 
class  is_hash_function_object
 Type trait to detect hash function objects. More...
 
class  is_hashable
 Hashable type trait. More...
 
class  is_input_iterator
 Input iterator type trait. More...
 
class  is_integrable
 Type trait for integrable types. More...
 
class  is_invertible
 Type trait for invertible types. More...
 
class  is_iterator
 Iterator type trait. More...
 
class  is_key
 Key type concept check. More...
 
class  is_less_than_comparable
 Less-than-comparable type trait. More...
 
class  is_msgpack_stream
 Detect msgpack stream. More...
 
class  is_multipliable
 Multipliable type trait. More...
 
class  is_multipliable_in_place
 In-place multipliable type trait. More...
 
class  is_ostreamable
 Type trait for classes that can be output-streamed. More...
 
class  is_returnable
 Detect if type can be returned from a function. More...
 
class  is_series
 Type trait to detect series types. More...
 
class  is_subtractable
 Subtractable type trait. More...
 
class  is_subtractable_in_place
 In-place subtractable type trait. More...
 
class  key_has_degree
 Type trait to detect if a key type has a degree property. More...
 
class  key_has_ipow_subs
 Type trait to detect the presence of the integral power substitution method in keys. More...
 
class  key_has_ldegree
 Type trait to detect if a key type has a low degree property. More...
 
class  key_has_msgpack_convert
 Detect the presence of the msgpack_convert() method in keys. More...
 
class  key_has_msgpack_pack
 Detect the presence of the msgpack_pack() method in keys. More...
 
class  key_has_subs
 Type trait to detect the presence of the substitution method in keys. More...
 
class  key_has_t_degree
 Type trait to detect if a key type has a trigonometric degree property. More...
 
class  key_has_t_ldegree
 Type trait to detect if a key type has a trigonometric low degree property. More...
 
class  key_has_t_lorder
 Type trait to detect if a key type has a trigonometric low order property. More...
 
class  key_has_t_order
 Type trait to detect if a key type has a trigonometric order property. More...
 
class  key_has_t_subs
 Type trait to detect the presence of the trigonometric substitution method in keys. More...
 
class  key_is_convertible
 Detect if a key type is convertible to another key type. More...
 
class  key_is_differentiable
 Type trait to detect differentiable keys. More...
 
class  key_is_evaluable
 Type trait to detect evaluable keys. More...
 
class  key_is_integrable
 Type trait to detect integrable keys. More...
 
class  key_is_multipliable
 Type trait for multipliable key. More...
 
class  kronecker_array
 Kronecker array. More...
 
class  kronecker_monomial
 Kronecker monomial class. More...
 
class  monomial
 Monomial class. More...
 
class  mp_rational
 Multiple precision rational class. More...
 
struct  msgpack_convert_impl
 Default functor for the implementation of piranha::msgpack_convert(). More...
 
struct  msgpack_convert_impl< hash_set< T, Hash, Pred >, hash_set_msgpack_convert_enabler< T > >
 Specialisation of piranha::msgpack_convert() for piranha::hash_set. More...
 
struct  msgpack_convert_impl< Series, series_msgpack_convert_enabler< Series > >
 Specialisation of piranha::msgpack_convert() for piranha::series. More...
 
struct  msgpack_convert_impl< small_vector< T, std::integral_constant< std::size_t, Size > >, msgpack_convert_array_enabler< small_vector< T, std::integral_constant< std::size_t, Size > > > >
 Specialisation of piranha::msgpack_convert() for piranha::small_vector. More...
 
struct  msgpack_convert_impl< static_vector< T, S >, msgpack_convert_array_enabler< static_vector< T, S > > >
 Specialisation of piranha::msgpack_convert() for piranha::static_vector. More...
 
struct  msgpack_convert_impl< std::string >
 Specialisation of piranha::msgpack_convert() for std::string. More...
 
struct  msgpack_convert_impl< T, mp_integer_msgpack_convert_enabler< T > >
 Specialisation of piranha::msgpack_convert() for piranha::mp_integer. More...
 
struct  msgpack_convert_impl< T, mp_rational_msgpack_convert_enabler< T > >
 Specialisation of piranha::msgpack_convert() for piranha::mp_rational. More...
 
struct  msgpack_convert_impl< T, msgpack_convert_ld_enabler< T > >
 Specialisation of piranha::msgpack_convert() for long double. More...
 
struct  msgpack_convert_impl< T, msgpack_convert_scalar_enabler< T > >
 Specialisation of piranha::msgpack_convert() for fundamental C++ types supported by msgpack. More...
 
struct  msgpack_convert_impl< T, real_msgpack_convert_enabler< T > >
 Specialisation of piranha::msgpack_convert() for piranha::real. More...
 
struct  msgpack_pack_impl
 Default functor for the implementation of piranha::msgpack_pack(). More...
 
struct  msgpack_pack_impl< Stream, hash_set< T, Hash, Pred >, hash_set_msgpack_pack_enabler< Stream, T, Hash, Pred > >
 Specialisation of piranha::msgpack_pack() for piranha::hash_set. More...
 
struct  msgpack_pack_impl< Stream, long double, msgpack_ld_enabler< Stream > >
 Specialisation of piranha::msgpack_pack() for long double. More...
 
struct  msgpack_pack_impl< Stream, mp_integer< SSize >, mp_integer_msgpack_pack_enabler< Stream > >
 Specialisation of piranha::msgpack_pack() for piranha::mp_integer. More...
 
struct  msgpack_pack_impl< Stream, real, real_msgpack_pack_enabler< Stream > >
 Specialisation of piranha::msgpack_pack() for piranha::real. More...
 
struct  msgpack_pack_impl< Stream, Series, series_msgpack_pack_enabler< Stream, Series > >
 Specialisation of piranha::msgpack_pack() for piranha::series. More...
 
struct  msgpack_pack_impl< Stream, small_vector< T, std::integral_constant< std::size_t, Size > >, msgpack_pack_vector_enabler< Stream, small_vector< T, std::integral_constant< std::size_t, Size > > > >
 Specialisation of piranha::msgpack_pack() for piranha::small_vector. More...
 
struct  msgpack_pack_impl< Stream, static_vector< T, S >, msgpack_pack_vector_enabler< Stream, static_vector< T, S > > >
 Specialisation of piranha::msgpack_pack() for piranha::static_vector. More...
 
struct  msgpack_pack_impl< Stream, std::string, msgpack_string_enabler< Stream > >
 Specialisation of piranha::msgpack_pack() for std::string. More...
 
struct  msgpack_pack_impl< Stream, T, mp_rational_msgpack_pack_enabler< Stream, T > >
 Specialisation of piranha::msgpack_pack() for piranha::mp_rational. More...
 
struct  msgpack_pack_impl< Stream, T, msgpack_scalar_enabler< Stream, T > >
 Specialisation of piranha::msgpack_pack() for fundamental C++ types supported by msgpack. More...
 
struct  not_implemented_error
 Exception for functionality not implemented or not available on the current platform. More...
 
class  poisson_series
 Poisson series class. More...
 
class  polynomial
 Polynomial class. More...
 
class  power_series
 Power series toolbox. More...
 
struct  print_coefficient_impl
 Default functor for piranha::print_coefficient(). More...
 
struct  print_coefficient_impl< Series, typename std::enable_if< is_series< Series >::value >::type >
 Specialisation of piranha::print_coefficient_impl for series. More...
 
struct  print_tex_coefficient_impl
 Default functor for piranha::print_tex_coefficient(). More...
 
struct  print_tex_coefficient_impl< mp_rational< SSize > >
 Specialisation of the piranha::print_tex_coefficient() functor for piranha::mp_rational. More...
 
struct  print_tex_coefficient_impl< Series, typename std::enable_if< is_series< Series >::value >::type >
 Specialisation of piranha::print_tex_coefficient_impl for series. More...
 
class  real
 Arbitrary precision floating-point class. More...
 
class  real_trigonometric_kronecker_monomial
 Real trigonometric Kronecker monomial class. More...
 
class  runtime_info
 Runtime information. More...
 
struct  safe_cast_failure
 Exception to signal failure in piranha::safe_cast(). More...
 
struct  safe_cast_impl
 Default implementation of piranha::safe_cast(). More...
 
struct  safe_cast_impl< To, From, mp_integer_safe_cast_enabler< To, From > >
 Specialisation of piranha::safe_cast() for conversions involving piranha::mp_integer. More...
 
struct  safe_cast_impl< To, From, sc_float_to_int_enabler< To, From > >
 Specialisation of piranha::safe_cast() for C++ floating-point to C++ integral conversions. More...
 
struct  safe_cast_impl< To, From, sc_int_int_enabler< To, From > >
 Specialisation of piranha::safe_cast() for C++ integral types. More...
 
struct  safe_cast_impl< To, From, sc_rat_enabler< To, From > >
 Specialisation of piranha::safe_cast() for conversions involving piranha::mp_rational. More...
 
struct  safe_cast_impl< To, From, sc_real_enabler< To, From > >
 Specialisation of piranha::safe_cast() for conversions involving piranha::real. More...
 
class  series
 Series class. More...
 
class  series_has_multiplier
 Type trait to detect the availability of a series multiplier. More...
 
struct  series_is_rebindable
 Check if a series can be rebound. More...
 
class  series_multiplier
 Series multiplier. More...
 
class  series_multiplier< Series, detail::divisor_series_multiplier_enabler< Series > >
 Specialisation of piranha::series_multiplier for piranha::divisor_series. More...
 
class  series_multiplier< Series, detail::poly_multiplier_enabler< Series > >
 Specialisation of piranha::series_multiplier for piranha::polynomial. More...
 
class  series_multiplier< Series, detail::ps_series_multiplier_enabler< Series > >
 Specialisation of piranha::series_multiplier for piranha::poisson_series. More...
 
class  series_operators
 Series operators. More...
 
class  series_recursion_index
 Series recursion index. More...
 
class  settings_
 Global settings. More...
 
class  small_vector
 Small vector class. More...
 
class  static_vector
 Static vector class. More...
 
class  substitutable_series
 Toolbox for substitutable series. More...
 
class  t_substitutable_series
 Toolbox for series that support trigonometric substitution. More...
 
class  term
 Term class. More...
 
class  thread_barrier
 Thread barrier. More...
 
class  thread_pool_
 Static thread pool. More...
 
class  trigonometric_series
 Trigonometric series toolbox. More...
 
class  tuning
 Performance tuning. More...
 
struct  zero_division_error
 Exception for signalling division by zero. More...
 
class  zero_is_absorbing
 Detect if zero is a multiplicative absorber. More...
 
class  zero_is_absorbing< T, fp_zero_is_absorbing_enabler< T > >
 Specialisation of piranha::zero_is_absorbing for floating-point types. More...
 
struct  zero_is_absorbing< T, real_zero_is_absorbing_enabler< T > >
 Specialisation of piranha::zero_is_absorbing for piranha::real. More...
 
struct  zero_is_absorbing< T, series_zero_is_absorbing_enabler< T > >
 Specialisation of piranha::zero_is_absorbing for piranha::series. More...
 

Typedefs

using k_monomial = kronecker_monomial<>
 Alias for piranha::kronecker_monomial with default type.
 
template<std::size_t SSize>
using mp_integer = mppp::mp_integer< SSize >
 Alias for mppp::mp_integer.
 
using integer = mp_integer< 1 >
 Alias for piranha::mp_integer with 1 limb of static storage.
 
using rational = mp_rational< 1 >
 Alias for piranha::mp_rational with 1 static limb.
 
using rtk_monomial = real_trigonometric_kronecker_monomial<>
 Alias for piranha::real_trigonometric_kronecker_monomial with default type.
 
template<typename T , typename Cf >
using series_rebind = series_rebind_implementation< T, Cf >
 Rebind series. More...
 
using settings = settings_<>
 Alias for piranha::settings_. More...
 
using symbol_fset = boost::container::flat_set< std::string >
 Flat set of symbols. More...
 
template<typename T >
using symbol_fmap = boost::container::flat_map< std::string, T >
 Flat map of symbols. More...
 
using symbol_idx = symbol_fset::size_type
 Symbol index. More...
 
using symbol_idx_fset = boost::container::flat_set< symbol_idx >
 Flat set of symbol indices. More...
 
template<typename T >
using symbol_idx_fmap = boost::container::flat_map< symbol_idx, T >
 Flat map of symbol indices. More...
 
using thread_pool = thread_pool_<>
 Alias for piranha::thread_pool_. More...
 
template<typename T , typename... Args>
using min_int = typename detail::min_int_impl< T, Args... >::type
 Detect narrowest integer type. More...
 
template<typename T , typename... Args>
using max_int = typename detail::max_int_impl< T, Args... >::type
 Detect widest integer type. More...
 

Enumerations

enum  msgpack_format { msgpack_format::portable, msgpack_format::binary }
 Serialization format for msgpack. More...
 
enum  data_format { data_format::boost_binary, data_format::boost_portable, data_format::msgpack_binary, data_format::msgpack_portable }
 Data format. More...
 
enum  compression { compression::none, compression::bzip2, compression::gzip, compression::zlib }
 Compression format. More...
 

Functions

template<typename To , typename From , detail::convert_to_enabler< To, From > = 0>
To convert_to (const From &x)
 Generic conversion function. More...
 
void init ()
 Main initialisation function. More...
 
void * aligned_palloc (const std::size_t &alignment, const std::size_t &size)
 Allocate memory aligned to a specific value. More...
 
void aligned_pfree (const std::size_t &alignment, void *ptr)
 Free memory allocated via piranha::aligned_alloc. More...
 
template<typename T >
bool alignment_check (const std::size_t &alignment)
 Alignment checks. More...
 
template<typename T , typename = typename std::enable_if<is_container_element<T>::value>::type>
void parallel_value_init (T *ptr, const std::size_t &size, const unsigned &n_threads)
 Parallel value initialisation. More...
 
template<typename T , typename = typename std::enable_if<is_container_element<T>::value>::type>
void parallel_destroy (T *ptr, const std::size_t &size, const unsigned &n_threads)
 Parallel destruction. More...
 
template<typename T , typename = typename std::enable_if<is_container_element<T>::value>::type>
std::unique_ptr< T[], detail::parallel_deleter< T > > make_parallel_array (const std::size_t &size, const unsigned &n_threads)
 Create an array in parallel. More...
 
template<typename T >
auto print_coefficient (std::ostream &os, const T &cf) -> decltype(print_coefficient_impl< T >()(os, cf))
 Print series coefficient. More...
 
template<typename T >
auto print_tex_coefficient (std::ostream &os, const T &cf) -> decltype(print_tex_coefficient_impl< T >()(os, cf))
 Print series coefficient in TeX mode. More...
 
template<typename Archive , typename T , boost_save_enabler< Archive, T > = 0>
void boost_save (Archive &ar, const T &x)
 Save to Boost archive. More...
 
template<typename Archive , typename T , boost_load_enabler< Archive, T > = 0>
void boost_load (Archive &ar, T &x)
 Load from Boost archive. More...
 
template<typename Stream , typename T , msgpack_pack_enabler< Stream, T > = 0>
void msgpack_pack (msgpack::packer< Stream > &packer, const T &x, msgpack_format f)
 Pack generic object in a msgpack stream. More...
 
template<typename T , msgpack_convert_enabler< T > = 0>
void msgpack_convert (T &x, const msgpack::object &o, msgpack_format f)
 Convert msgpack object. More...
 
template<typename T >
void save_file (const T &x, const std::string &filename, data_format f, compression c)
 Save to file. More...
 
template<typename T >
void save_file (const T &x, const std::string &filename)
 Save to file. More...
 
template<typename T , load_file_enabler< T > = 0>
void load_file (T &x, const std::string &filename, data_format f, compression c)
 Load from file. More...
 
template<typename T , load_file_enabler< T > = 0>
void load_file (T &x, const std::string &filename)
 Load from file . More...
 
template<typename To , typename From >
safe_cast_type< To, From > safe_cast (const From &x)
 Safe cast. More...
 
std::tuple< symbol_fset, symbol_idx_fmap< symbol_fset >, symbol_idx_fmap< symbol_fset > > ss_merge (const symbol_fset &s1, const symbol_fset &s2)
 Merge two symbol_fset. More...
 
symbol_idx ss_index_of (const symbol_fset &ref, const std::string &name)
 Identify the index of a symbol in a symbol_fset. More...
 
symbol_fset ss_trim (const symbol_fset &s, const std::vector< char > &mask)
 Trim a symbol_fset. More...
 
symbol_idx_fset ss_intersect_idx (const symbol_fset &s1, const symbol_fset &s2)
 Find the indices of the intersection of two symbol_fset. More...
 
template<typename T , sm_intersect_idx_enabler< T > = 0>
symbol_idx_fmap< T > sm_intersect_idx (const symbol_fset &s, const symbol_fmap< T > &m)
 Find the indices of the intersection of a symbol_fset and a symbol_fmap. More...
 
void bind_to_proc (unsigned n)
 Bind thread to specific processor. More...
 
std::pair< bool, unsigned > bound_proc ()
 Query if current thread is bound to a processor. More...
 

Detailed Description

Root piranha namespace.

Typedef Documentation

◆ max_int

template<typename T , typename... Args>
using piranha::max_int = typedef typename detail::max_int_impl<T, Args...>::type

Detect widest integer type.

This type alias requires T and Args (if any) to be all signed or unsigned integer types. It will be defined as the input type with the widest numerical range.

Definition at line 846 of file type_traits.hpp.

◆ min_int

template<typename T , typename... Args>
using piranha::min_int = typedef typename detail::min_int_impl<T, Args...>::type

Detect narrowest integer type.

This type alias requires T and Args (if any) to be all signed or unsigned integer types. It will be defined as the input type with the narrowest numerical range.

Definition at line 838 of file type_traits.hpp.

◆ series_rebind

template<typename T , typename Cf >
using piranha::series_rebind = typedef series_rebind_implementation<T, Cf>

Rebind series.

Utility alias to rebind series T to coefficient Cf. See piranha::series_is_rebindable for an explanation. In addition to being a shortcut to the rebind alias in T (if present), the implementation will also check that T and Cf satisfy the piranha::series_is_rebindable type traits.

Definition at line 225 of file series.hpp.

◆ settings

using piranha::settings = typedef settings_<>

Alias for piranha::settings_.

This is the alias through which the methods in piranha::settings_ should be called.

Definition at line 264 of file settings.hpp.

◆ symbol_fmap

template<typename T >
using piranha::symbol_fmap = typedef boost::container::flat_map<std::string, T>

Flat map of symbols.

This data structure maps an ordered set of symbols to objects of type T.

Definition at line 68 of file symbol_utils.hpp.

◆ symbol_fset

using piranha::symbol_fset = typedef boost::container::flat_set<std::string>

Flat set of symbols.

This data structure represents an ordered set of symbols.

Definition at line 61 of file symbol_utils.hpp.

◆ symbol_idx

using piranha::symbol_idx = typedef symbol_fset::size_type

Symbol index.

An unsigned integral type representing a position within a symbol_fset.

Definition at line 74 of file symbol_utils.hpp.

◆ symbol_idx_fmap

template<typename T >
using piranha::symbol_idx_fmap = typedef boost::container::flat_map<symbol_idx, T>

Flat map of symbol indices.

This sorted data structure maps symbol_idx instances to the generic type T.

Definition at line 87 of file symbol_utils.hpp.

◆ symbol_idx_fset

using piranha::symbol_idx_fset = typedef boost::container::flat_set<symbol_idx>

Flat set of symbol indices.

This data structure represents an ordered set of indices into a symbol_fset.

Definition at line 80 of file symbol_utils.hpp.

◆ thread_pool

Alias for piranha::thread_pool_.

This is the alias through which the methods in piranha::thread_pool_ should be called.

Definition at line 493 of file thread_pool.hpp.

Enumeration Type Documentation

◆ compression

enum piranha::compression
strong

Compression format.

Compression formats used by high-level serialization functions such as piranha::save_file() and piranha::load_file().

Enumerator
none 

No compression.

bzip2 

bzip2 compression.

gzip 

gzip compression.

zlib 

zlib compression.

Definition at line 1232 of file s11n.hpp.

◆ data_format

enum piranha::data_format
strong

Data format.

Data format used by high-level serialization functions such as piranha::save_file() and piranha::load_file(). The Boost formats are based on the Boost serialization library, while the msgpack formats are based on the msgpack serialization format.

The portable variants are intended to be usable across different architectures and Piranha versions, whereas the binary variants are non-portable high-performance serialization formats intended for temporary storage. That is, saving a binary archive created with Piranha version N on architecture A and then loading it on a different architecture B or using a different Piranha version M will result in undefined behaviour.

Enumerator
boost_binary 

Boost binary.

This format is based on the Boost binary archives.

boost_portable 

Boost portable.

This format is based on the Boost text archives.

msgpack_binary 

msgpack binary.

This format will employ internally the msgpack_format::binary format.

msgpack_portable 

msgpack portable.

This format will employ internally the msgpack_format::portable format.

Definition at line 1205 of file s11n.hpp.

◆ msgpack_format

Serialization format for msgpack.

The serialization of non-primitive objects can often be performed in different ways, with different tradeoffs between performance, storage requirements and portability. The piranha::mp_integer class, for instance, can be serialized either via a string representation (slow and with high storage requirements, but portable across architectures, compilers and operating systems) or as an array of platform-dependent unsigned integrals (fast and compact, but not portable).

This enum establishes two strategies for msgpack serialization: a portable format, intended to be usable across different platforms and suitable for the long-term storage of serialized objects, and a binary format, intended for use in high-performance scenarios (e.g., as temporary on-disk storage during long or memory-intensive computations). These formats are used by the Piranha msgpack serialization functions (piranha::msgpack_pack(), piranha::msgpack_convert(), etc.).

Enumerator
portable 

Portable.

binary 

Binary.

Definition at line 673 of file s11n.hpp.

Function Documentation

◆ aligned_palloc()

void* piranha::aligned_palloc ( const std::size_t &  alignment,
const std::size_t &  size 
)
inline

Allocate memory aligned to a specific value.

This function will allocate a block of memory of size bytes aligned to alignment. If size is zero, nullptr will be returned. If alignment is zero, std::malloc() will be used for the allocation. Otherwise, the allocation will be deferred to an implementation-defined and platform-dependent low-level routine (e.g., posix_memalign()). If such a low level routine is not available, an exception will be raised.

Parameters
alignmentdesired alignment.
sizenumber of bytes to allocate.
Returns
a pointer to the allocated memory block, or nullptr if size is zero.
Exceptions
std::bad_allocif the allocation fails for any reason (e.g., bad alignment value, failure in the low-level allocation routine, etc.).
piranha::not_implemented_errorif alignment and size are both nonzero and the low-level allocation function is not available on the platform.

Definition at line 134 of file memory.hpp.

◆ aligned_pfree()

void piranha::aligned_pfree ( const std::size_t &  alignment,
void *  ptr 
)
inline

Free memory allocated via piranha::aligned_alloc.

This function must be used to deallocate memory obtained via piranha::aligned_alloc(). If ptr is nullptr, this function will be a no-op. If alignment is zero, std::free() will be used. Otherwise, the deallocation will be deferred to an implementation-defined and platform-dependent low-level routine (e.g., _aligned_free()). If such a low level routine is not available, an exception will be raised.

The value of alignment must be the same used for the allocation.

Parameters
alignmentalignment value used during allocation.
ptrpointer to the memory to be freed.
Exceptions
piranha::not_implemented_errorif ptr is not nullptr, alignment is not zero and the low-level deallocation routine is not available on the platform.

Definition at line 182 of file memory.hpp.

◆ alignment_check()

template<typename T >
bool piranha::alignment_check ( const std::size_t &  alignment)
inline

Alignment checks.

This function will run a series of checks on an alignment value to be used to allocate storage for objects of the decay type of T using piranha::aligned_palloc(), and it will retun true if the alignment value passes these checks, false otherwise. An alignment of zero will always return true.

The checks performed are the following:

  • the alignment must be a power of 2 (3.11/4),
  • the alignment must not be smaller than the default alignment of T, as reported by alignas(),
  • the alignment must satisfy additional platform-dependent checks (e.g., posix_memalign() requires the alignment to be a multiple of sizeof(void *)).

Note that piranha::aligned_palloc() will not check the alignment via this function, and that even if this function returns true on an alignment value, this will not guarantee that the allocation via piranha::aligned_palloc() will succeed.

Parameters
alignmentalignment value to be checked.
Returns
true if the input value is zero or if it passes the alignment checks, false otherwise.

Definition at line 224 of file memory.hpp.

◆ bind_to_proc()

void piranha::bind_to_proc ( unsigned  n)
inline

Bind thread to specific processor.

Upon successful completion of this method, the calling thread will be confined on the specified processor. This method requires platform-specific functions and thus might not be available on all configurations.

In case of exceptions, the thread will not have been bound to any processor.

Parameters
nindex of the processor to which the thread will be bound (starting from index 0).
Exceptions
std::invalid_argumentif one of these conditions arises:
piranha::not_implemented_errorif the method is not available on the current platform.
std::system_errorin case of failure(s) by threading primitives.
std::runtime_errorif the operation fails in an unspecified way.

Definition at line 109 of file thread_management.hpp.

◆ boost_load()

template<typename Archive , typename T , boost_load_enabler< Archive, T > = 0>
void piranha::boost_load ( Archive &  ar,
T &  x 
)
inline

Load from Boost archive.

Note
This function is enabled only if Archive and T satisfy piranha::is_boost_loading_archive, and the expression boost_load_impl<Archive, T>{}(ar, x) is well-formed.

This function will load the object x from the Boost archive ar. The implementation of this function is in the call operator of the piranha::boost_load_impl functor. The body of this function is equivalent to:

boost_load_impl<Archive, T>{}(ar, x);
Parameters
arthe source Boost loading archive.
xthe object that will be loaded from ar.
Exceptions
unspecifiedany exception thrown by the call operator of piranha::boost_load_impl.

Definition at line 469 of file s11n.hpp.

◆ boost_save()

template<typename Archive , typename T , boost_save_enabler< Archive, T > = 0>
void piranha::boost_save ( Archive &  ar,
const T &  x 
)
inline

Save to Boost archive.

Note
This function is enabled only if Archive and T satisfy piranha::is_boost_saving_archive, and the expression boost_save_impl<Archive, T>{}(ar, x) is well-formed.

This function will save to the Boost archive ar the object x. The implementation of this function is in the call operator of the piranha::boost_save_impl functor. The body of this function is equivalent to:

boost_save_impl<Archive, T>{}(ar, x);
Parameters
artarget Boost saving archive.
xobject to be saved.
Exceptions
unspecifiedany exception thrown by the call operator of piranha::boost_save_impl.

Definition at line 328 of file s11n.hpp.

◆ bound_proc()

std::pair<bool, unsigned> piranha::bound_proc ( )
inline

Query if current thread is bound to a processor.

The complexity of the operation is at most linear in the maximum number of processors that can be represented on the system (e.g., in Unix-like system this number will typically correspond to the CPU_SETSIZE macro). This method requires platform-specific functions and thus might not be available on all configurations. Note that if only a single core/cpu is available, the returned value will always be (true,0).

Returns
the pair (true,n) if the calling thread is bound to a single processor with index n, (false,0) otherwise.
Exceptions
piranha::not_implemented_errorif the method is not available on the current platform.
std::runtime_errorif the operation fails in an unspecified way.

Definition at line 180 of file thread_management.hpp.

◆ convert_to()

template<typename To , typename From , detail::convert_to_enabler< To, From > = 0>
To piranha::convert_to ( const From &  x)
inline

Generic conversion function.

Note
This function is enabled only if the call operator of piranha::convert_to_impl returns a instance of the decay type of To, and if the decay type of To satisfies piranha::is_returnable.

This function is meant to convert an instance of type From to an instance of the decay type of To. It is intended to be a user-extensible replacement for static_cast limited to value conversions (that is, the decay types of To and From are considered).

The actual implementation of this function is in the piranha::convert_to_impl functor's call operator. The decay type of To is passed as first template parameter of piranha::convert_to_impl, whereas From is passed as-is. The body of this function is equivalent to:

return convert_to_impl<typename std::decay<To>::type,From>{}(x);

Any specialisation of piranha::convert_to_impl must have a call operator returning an instance of the decay type of To, otherwise this function will be disabled.

Parameters
xconversion argument.
Returns
an instance of the decay type of To converted from x.
Exceptions
unspecifiedany exception thrown by the call operator of the piranha::convert_to_impl functor.

Definition at line 117 of file convert_to.hpp.

◆ init()

void piranha::init ( )
inline

Main initialisation function.

This function should be called before accessing any Piranha functionality. It will register cleanup functions that will be run on program exit (e.g., the MPFR mpfr_free_cache() function).

It is allowed to call this function concurrently from multiple threads: after the first invocation, additional invocations will not perform any action.

Definition at line 81 of file init.hpp.

◆ load_file() [1/2]

template<typename T , load_file_enabler< T > = 0>
void piranha::load_file ( T &  x,
const std::string &  filename,
data_format  f,
compression  c 
)
inline

Load from file.

Note
This function is enabled only if T is not const.

This function will load the content of the file named filename into the object x, assuming that the data is stored in the format f using the compression method c. If c is not piranha::compression::none, it will be assumed that the file is compressed.

This function is built on lower-level routines such as piranha::boost_load() and piranha::msgpack_convert(). The data format f establishes both the lower level serialization method to be used and its variant (e.g., portable vs binary).

Parameters
xthe object into which the content of the file name filename will be deserialized.
filenamename of the input file.
fdata format.
ccompression format.
Exceptions
piranha::not_implemented_errorin the following cases:
  • the type T does not implement the required serialization method (e.g., f is piranha::data_format::boost_binary but T does not provide an implementation of piranha::boost_load()),
  • a necessary optional third-party library (e.g., msgpack or one of the compression libraries) is not available on the host platform.
std::runtime_errorin case the file cannot be opened for reading.
unspecifiedany exception thrown by:
  • piranha::safe_cast(),
  • the invoked low-level serialization function,
  • the new operator,
  • the public interface of the Boost iostreams library.

Definition at line 1638 of file s11n.hpp.

◆ load_file() [2/2]

template<typename T , load_file_enabler< T > = 0>
void piranha::load_file ( T &  x,
const std::string &  filename 
)
inline

Load from file .

Note
This function is enabled only if T is not const.

This is a convenience function that will invoke the other overload of piranha::load_file() trying to guess the data and compression formats from the filename. The heuristic is described in the second overload of piranha::save_file().

Parameters
xthe object into which the file content will be loaded.
filenamesource file name.
Exceptions
std::invalid_argumentif the compression and data formats cannot be deduced.
unspecifiedany exception thrown by the first overload of piranha::load_file().

Definition at line 1663 of file s11n.hpp.

◆ make_parallel_array()

template<typename T , typename = typename std::enable_if<is_container_element<T>::value>::type>
std::unique_ptr<T[], detail::parallel_deleter<T> > piranha::make_parallel_array ( const std::size_t &  size,
const unsigned &  n_threads 
)
inline

Create an array in parallel.

Note
This function is enabled only if T satisfies the piranha::is_container_element type trait.

This function will create an array whose values will be initialised in parallel using piranha::parallel_value_init(). The pointer to the array is returned wrapped inside an std::unique_ptr that will take care of destroying the array elements (also in parallel using piranha::parallel_destroy()) and deallocating the memory when the destructor is called.

Note
Due to the special semantics of the parallel deleter, the returned smart pointer cannot be reset with another arbitrary pointer without supplying a new deleter. To replace the managed object while supplying a new deleter as well, move semantics may be used.
Parameters
sizesize of the array.
n_threadsnumber of threads to use.
Returns
an std::unique_ptr wrapping the array.
Exceptions
std::bad_allocif size is greater than an implementation-defined value.
unspecifiedany exception thrown by:

Definition at line 475 of file memory.hpp.

◆ msgpack_convert()

template<typename T , msgpack_convert_enabler< T > = 0>
void piranha::msgpack_convert ( T &  x,
const msgpack::object &  o,
msgpack_format  f 
)
inline

Convert msgpack object.

Note
This function is enabled only if T is not const and if msgpack_convert_impl<T>{}(x, o, f) is a valid expression.

This function is intended to convert the msgpack object o into an instance of type T, and to write the converted value into x. The actual implementation of this function is in the piranha::msgpack_convert_impl functor. The body of this function is equivalent to:

msgpack_convert_impl<T>{}(x, o, f);
Parameters
xthe output value.
othe msgpack object that will be converted into x.
fthe serialization format.
Exceptions
unspecifiedany exception thrown by the call operator piranha::msgpack_convert_impl.

Definition at line 957 of file s11n.hpp.

◆ msgpack_pack()

template<typename Stream , typename T , msgpack_pack_enabler< Stream, T > = 0>
void piranha::msgpack_pack ( msgpack::packer< Stream > &  packer,
const T &  x,
msgpack_format  f 
)
inline

Pack generic object in a msgpack stream.

Note
This function is enabled only if Stream satisfies piranha::is_msgpack_stream and if msgpack_pack_impl<Stream, T>{}(packer, x, f) is a valid expression.

This function is intended to pack the input value x into a msgpack packer using the format f. The actual implementation of this function is in the piranha::msgpack_pack_impl functor. The body of this function is equivalent to:

msgpack_pack_impl<Stream, T>{}(packer, x, f);
Parameters
packerthe msgpack packer object.
xthe object to be packed into packer.
fthe serialization format.
Exceptions
unspecifiedany exception thrown by the call operator piranha::msgpack_pack_impl.

Definition at line 856 of file s11n.hpp.

◆ parallel_destroy()

template<typename T , typename = typename std::enable_if<is_container_element<T>::value>::type>
void piranha::parallel_destroy ( T *  ptr,
const std::size_t &  size,
const unsigned &  n_threads 
)
inline

Parallel destruction.

Note
This function is enabled only if T satisfies the piranha::is_container_element type trait.

This function will destroy in parallel the element of an array ptr of size size. If n_threads is 0 or 1, the operation will be performed in the calling thread, otherwise the first n_threads in piranha::thread_pool will be used to perform the operation concurrently.

The function is a no-op if ptr is null or if T has a trivial destructor.

Parameters
ptrpointer to the array.
sizesize of the array.
n_threadsnumber of threads to use.

Definition at line 349 of file memory.hpp.

◆ parallel_value_init()

template<typename T , typename = typename std::enable_if<is_container_element<T>::value>::type>
void piranha::parallel_value_init ( T *  ptr,
const std::size_t &  size,
const unsigned &  n_threads 
)
inline

Parallel value initialisation.

Note
This function is enabled only if T satisfies the piranha::is_container_element type trait.

This function will value-initialise in parallel the array ptr of size size. The routine will use the first n_threads from piranha::thread_pool to perform the operation concurrently. If n_threads is 1 or 0, the operation will be performed in the calling thread. If ptr is null, this function will be a no-op.

This function provides the strong exception safety guarantee: in case of errors, any constructed instance of T will be destroyed before the error is re-thrown.

Parameters
ptrpointer to the array.
sizesize of the array.
n_threadsnumber of threads to use.
Exceptions
std::bad_allocin case of memory allocation errors in multithreaded mode.
unspecifiedany exception thrown by:

Definition at line 271 of file memory.hpp.

◆ print_coefficient()

template<typename T >
auto piranha::print_coefficient ( std::ostream &  os,
const T &  cf 
) -> decltype(print_coefficient_impl<T>()(os, cf))
inline

Print series coefficient.

This function is used in the stream operator overload for piranha::series when printing coefficients.

The implementation uses the call operator of the piranha::print_coefficient_impl functor. Specialisations of piranha::print_coefficient_impl can be defined to customize the behaviour.

Parameters
ostarget stream.
cfcoefficient object to be printed.
Returns
the value returned by the call operator of piranha::print_coefficient_impl.
Exceptions
unspecifiedany exception thrown by the call operator of piranha::print_coefficient_impl.

Definition at line 83 of file print_coefficient.hpp.

◆ print_tex_coefficient()

template<typename T >
auto piranha::print_tex_coefficient ( std::ostream &  os,
const T &  cf 
) -> decltype(print_tex_coefficient_impl<T>()(os, cf))
inline

Print series coefficient in TeX mode.

This function is used in to print coefficients in TeX mode.

The implementation uses the call operator of the piranha::print_tex_coefficient_impl functor. Specialisations of piranha::print_tex_coefficient_impl can be defined to customize the behaviour.

Parameters
ostarget stream.
cfcoefficient object to be printed.
Returns
the value returned by the call operator of piranha::print_tex_coefficient_impl.
Exceptions
unspecifiedany exception thrown by the call operator of piranha::print_tex_coefficient_impl.

Definition at line 79 of file print_tex_coefficient.hpp.

◆ safe_cast()

template<typename To , typename From >
safe_cast_type<To, From> piranha::safe_cast ( const From &  x)
inline

Safe cast.

This function is meant to be used when it is necessary to convert between two types while making sure that the value is preserved after the conversion. For instance, a safe cast between integral types will check that the input value is representable by the return type, otherwise an error will be raised.

The actual implementation of this function is in the piranha::safe_cast_impl functor's call operator. To is passed as first template parameter of piranha::safe_cast_impl after the removal of cv/reference qualifiers, whereas From is passed as-is. The body of this function is thus equivalent to:

return safe_cast_impl<uncvref_t<To>, From>{}(x);

(where uncvref_t<To> refers to To without cv/reference qualifiers).

Any specialisation of piranha::safe_cast_impl must have a call operator returning an instance of type uncvref_t<To>, otherwise this function will be disabled. The function will also be disabled if uncvref_t<To> does not satisfy piranha::is_returnable.

Specialisations of piranha::safe_cast_impl are encouraged to raise an exception of type piranha::safe_cast_failure in case the type conversion fails.

Parameters
xargument for the conversion.
Returns
x converted to To.
Exceptions
unspecifiedany exception thrown by the call operator of piranha::safe_cast_impl.

Definition at line 219 of file safe_cast.hpp.

◆ save_file() [1/2]

template<typename T >
void piranha::save_file ( const T &  x,
const std::string &  filename,
data_format  f,
compression  c 
)
inline

Save to file.

This function will save the generic object x to the file named filename, using the data format f and the compression method c.

This function is built on lower-level routines such as piranha::boost_save() and piranha::msgpack_pack(). The data format f establishes both the lower level serialization method to be used and its variant (e.g., portable vs binary). If requested (i.e., if c is not piranha::compression::none), the output file will be compressed.

Parameters
xobject to be saved to file.
filenamename of the output file.
fdata format.
ccompression format.
Exceptions
piranha::not_implemented_errorin the following cases:
  • the type T does not implement the required serialization method (e.g., f is piranha::data_format::boost_binary but T does not provide an implementation of piranha::boost_save()),
  • a necessary optional third-party library (e.g., msgpack or one of the compression libraries) is not available on the host platform.
std::runtime_errorin case the file cannot be opened for writing.
unspecifiedany exception thrown by:
  • piranha::safe_cast(),
  • the invoked low-level serialization function,
  • the public interface of the Boost iostreams library.

Definition at line 1565 of file s11n.hpp.

◆ save_file() [2/2]

template<typename T >
void piranha::save_file ( const T &  x,
const std::string &  filename 
)
inline

Save to file.

This is a convenience function that will invoke the other overload of piranha::save_file() trying to guess the data and compression formats from the filename. The heuristic is as follows:

Examples:

Parameters
xthe object that will be saved to file.
filenamethe desired file name.
Exceptions
std::invalid_argumentif the compression and data formats cannot be deduced.
unspecifiedany exception thrown by the first overload of piranha::save_file().

Definition at line 1601 of file s11n.hpp.

◆ sm_intersect_idx()

template<typename T , sm_intersect_idx_enabler< T > = 0>
symbol_idx_fmap<T> piranha::sm_intersect_idx ( const symbol_fset s,
const symbol_fmap< T > &  m 
)
inline

Find the indices of the intersection of a symbol_fset and a symbol_fmap.

Note
This function is enabled only if T is default-constructible, copy-assignable and copy-constructible.

This function first computes the intersection ix of the set s and the keys of m, and then returns a map in which the keys are the positional indices of ix in s and the values are the corresponding values of ix in m.

For instance, if T is int, s is ["b", "d", "e"] and m is [("a", 1), ("b", 2), ("c", 3), ("d", 4), ("g", 5)], the intersection ix is ["b", "d"] and the returned map is [(0, 2), (1, 4)].

Parameters
sthe set operand.
mthe map operand.
Returns
a symbol_idx_fmap mapping the indices in s of the intersection of s and m to the values in m.
Exceptions
std::overflow_errorif the size of s is larger than an implementation-defined value.
unspecifiedany exception thrown by:

Definition at line 425 of file symbol_utils.hpp.

◆ ss_index_of()

symbol_idx piranha::ss_index_of ( const symbol_fset ref,
const std::string &  name 
)
inline

Identify the index of a symbol in a symbol_fset.

This function will return the positional index of the symbol name in the set ref. If name is not in ref, the size of ref will be returned.

Parameters
refthe input symbol_fset.
namethe symbol whose index in ref will be returned.
Returns
the positional index of name in ref.

Definition at line 237 of file symbol_utils.hpp.

◆ ss_intersect_idx()

symbol_idx_fset piranha::ss_intersect_idx ( const symbol_fset s1,
const symbol_fset s2 
)
inline

Find the indices of the intersection of two symbol_fset.

This function first computes the intersection ix of the two sets s1 and s2, and then returns a set with the positional indices of ix in s1.

For instance, if s1 is ["b", "d", "e"] and s2 is ["a", "b", "c", "d", "g"], the intersection ix is ["b", "d"] and the returned set is [0, 1].

Parameters
s1the first operand.
s2the second operand.
Returns
the indices in s1 of the intersection of s1 and s2.
Exceptions
std::overflow_errorif the size of s1 is larger than an implementation-defined value.
unspecifiedany exception thrown by the public interface of symbol_fset, or by safe_cast().

Definition at line 329 of file symbol_utils.hpp.

◆ ss_merge()

std::tuple<symbol_fset, symbol_idx_fmap<symbol_fset>, symbol_idx_fmap<symbol_fset> > piranha::ss_merge ( const symbol_fset s1,
const symbol_fset s2 
)
inline

Merge two symbol_fset.

This function will merge the input symbol_fset s1 and s2, returning a tuple of three elements:

  • a symbol_fset representing the union u of s1 and s2,
  • two insertion maps m1 and m2 representing the set differences u\s1 and u\s2 respectively.

The insertion maps contain the indices in s1 and s2 at which symbols must be added so that s1 and s2, after the insertion of the symbols in m1 and m2, become identical to u.

For example, given the input sets s1 = ["b", "c", "e"] and s2 = ["a", "c", "d", "f", "g"], the return values will be:

  • u = ["a", "b", "c", "d", "e", "f", "g"],
  • m1 = [(0, ["a"]), (2, ["d"]), (3, ["f", "g"])],
  • m2 = [(1, ["b"]), (3, ["e"])].
Parameters
s1the first set.
s2the second set.
Returns
a triple containing the union u of s1 and s2 and the set differences u\s1 and u\s2.
Exceptions
std::overflow_errorin case of internal overflows.
unspecifiedany exception thrown by memory allocation errors.

Definition at line 170 of file symbol_utils.hpp.

◆ ss_trim()

symbol_fset piranha::ss_trim ( const symbol_fset s,
const std::vector< char > &  mask 
)
inline

Trim a symbol_fset.

This function will trim the input set s according to the values in mask. That is, a copy of s is returned without the symbols whose corresponding values in mask are nonzero.

For instance, if the input set s is ["x", "y", "z"] and the input mask is [0, 1, 0], then the return value of this function is the set ["x", "z"] (i.e., the "y" symbol was eliminated because its corresponding value in mask is 1).

Parameters
sthe input symbol_fset.
maskthe trimming mask.
Returns
a copy of s trimmed according to mask.
Exceptions
std::invalid_argumentif the sizes of s and mask differ.
unspecifiedany exception thrown by the construction of the return value.

Definition at line 287 of file symbol_utils.hpp.