Theoretica
A C++ numerical and automatic mathematical library
Loading...
Searching...
No Matches
complex_types.h
Go to the documentation of this file.
1
5
6#ifndef THEORETICA_COMPLEX_TYPES_H
7#define THEORETICA_COMPLEX_TYPES_H
8
9#include <type_traits>
10#include "../core/core_traits.h"
11#include "../core/constants.h"
12#include "./complex.h"
13
14
15namespace theoretica {
16
17
19 template<typename Type = real>
21
22
26 template<typename T>
27 struct is_complex_type : std::false_type {};
28
32 template<typename T>
33 struct is_complex_type<complex<T>> : std::true_type {};
34
35
37 template<typename Structure>
39
40
44 template<typename Structure, typename T = bool>
45 using enable_complex = std::enable_if_t<is_complex_type<Structure>::value, T>;
46
47}
48
49
50#endif
Complex number in algebraic form .
Definition complex.h:26
Complex number class.
Main namespace of the library which contains all functions and objects.
Definition algebra.h:27
is_complex_type< vector_element_t< Structure > > has_complex_elements
Type trait to check whether a container has complex elements.
Definition complex_types.h:38
complex< complex< Type > > bicomplex
A bi-complex number.
Definition complex_types.h:20
std::remove_reference_t< decltype(std::declval< Structure >()[0])> vector_element_t
Extract the type of a vector (or any indexable container) from its operator[].
Definition core_traits.h:134
std::enable_if_t< is_complex_type< Structure >::value, T > enable_complex
Enable a function overload if the template typename is considerable a complex number.
Definition complex_types.h:45
Type trait to check whether the given type is a specialization of the complex number class or not,...
Definition complex_types.h:27