mptensor v0.4.0
Parallel Library for Tensor Network Methods
Loading...
Searching...
No Matches
complex.hpp
Go to the documentation of this file.
1/*
2 mptensor - Parallel Library for Tensor Network Methods
3
4 Copyright 2016 Satoshi Morita
5
6 mptensor is free software: you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version.
10
11 mptensor is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with mptensor. If not, see
18 <https://www.gnu.org/licenses/>.
19*/
20
29#ifndef _COMPLEX_HPP_
30#define _COMPLEX_HPP_
31
32#include <complex>
33
34namespace mptensor {
35
38typedef std::complex<double> complex;
39
40template <typename C>
41constexpr size_t value_type_tag();
42template <>
43constexpr size_t value_type_tag<double>() {
44 return 0;
45};
46template <>
47constexpr size_t value_type_tag<complex>() {
48 return 1;
49};
50
51template <typename C>
52constexpr char* value_type_name();
53template <>
54constexpr char* value_type_name<double>() {
55 return (char*)"double";
56};
57template <>
58constexpr char* value_type_name<complex>() {
59 return (char*)"complex";
60};
61
62} // namespace mptensor
63
64#endif // _COMPLEX_HPP_
std::complex< double > complex
Definition complex.hpp:38
Definition complex.hpp:34
constexpr char * value_type_name< complex >()
Definition complex.hpp:58
constexpr size_t value_type_tag()
constexpr char * value_type_name< double >()
Definition complex.hpp:54
constexpr size_t value_type_tag< double >()
Definition complex.hpp:43
constexpr char * value_type_name()
constexpr size_t value_type_tag< complex >()
Definition complex.hpp:47