chsvlib
chsv helper source code
Abstract algebra elements

Defines abstract algebra elements, such as types which correspond to various algebraic structures, as well as ancillary operations upon them. More...

Collaboration diagram for Abstract algebra elements:

Modules

 Tags denoting various algebraic structures.
 Defines an algebraic tag used to identify an algebraic structure, some type appertains to.
 

Classes

struct  algebraic_traits< T >
 Is a trait class that provides uniform interface to assess whether a type implements an abstract algebra structure, such as Rng, ring, field, etc. More...
 

Typedefs

template<class algebraic_tag_t , class T >
using is_algebraic_structure = decltype(Implementation::is_algebraic_structure< algebraic_tag_t, T >(int()))
 Resolves to std::true_type if a supplied type T implements operations as required by an algebraic structure identified by an algebraic tag. More...
 
template<class T >
using is_algebraic_category_defined = decltype(Implementation::algebraic_category_defined< T >(int()))
 Resolves to std::true_type if the type in the template parameter list defines and algebraic type by either defining an algebraic_category type field or being some built-in arithmetic type, like int or double. Otherwise, the template alias resolves to std::false_type.
 
template<class T >
using is_additive_group = is_algebraic_structure< additive_group_algebraic_tag, T >
 Resolves to std::true_type, if the type T is declared to implement a group with an addition operation and supposed to adhere the requirements of the additive_group_concept, or to std::false_type otherwise.
 
template<class T >
using is_rng = is_algebraic_structure< rng_algebraic_tag, T >
 Resolves to std::true_type, if the type is declared to implement an Rng and supposed to adhere the requirements of the rng_concept, or to std::false_type otherwise.
 
template<class T >
using is_ring = is_algebraic_structure< ring_algebraic_tag, T >
 Resolves to std::true_type, if the type is declared to implement an algebraic ring and supposed to adhere the requirements of the ring_concept, or to std::false_type otherwise.
 
template<class T >
using is_commutative_ring = is_algebraic_structure< commutative_ring_algebraic_tag, T >
 Resolves to std::true_type, if the type is declared to implement a commutative ring and supposed to adhere the requirements of the commutative_ring_concept, or to std::false_type otherwise.
 
template<class T >
using is_division_ring = is_algebraic_structure< division_ring_algebraic_tag, T >
 Resolves to std::true_type, if the type is declared to implement a division ring and supposed to adhere the requirements of the division_ring_concept, or to std::false_type otherwise.
 
template<class T >
using is_field = is_algebraic_structure< field_algebraic_tag, T >
 Resolves to std::true_type, if the type is declared to implement an algebraic field and supposed to adhere the requirements of the field_concept, or to std::false_type otherwise.
 

Enumerations

enum  identity_t { additive_identity , multiplicative_identity }
 Special values to be supported as the only parameters of constructors of user-defined algebraic types. More...
 

Functions

template<class T >
T & MultiplicativeInverseMe (T &x) noexcept(Implementation::is_nothrow_invertible< T >::value)
 A helper function that calculates a multiplicative inversion of a given value of a given type and writes result to the same location as the input value. More...
 
template<class T >
MultiplicativeInverse (const T &x)
 A helper function that calculates a multiplicative inversion of a given value of a given type and returns the result. More...
 

Detailed Description

Defines abstract algebra elements, such as types which correspond to various algebraic structures, as well as ancillary operations upon them.

Note
This is a tentative version built to satisfy several practical needs to implement matrix operations defined over values appertaining to different algebraic structures. Hence these are a subject to possible changes.