2018-03-22 18:11:39 +01:00
|
|
|
#pragma once
|
|
|
|
#include <triqs/gfs.hpp>
|
2020-04-03 22:20:03 +02:00
|
|
|
#include <h5/h5.hpp>
|
2018-03-22 18:11:39 +01:00
|
|
|
|
|
|
|
namespace app4triqs {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A very useful and important class
|
|
|
|
*
|
|
|
|
* @note A Useful note
|
2019-09-04 23:34:00 +02:00
|
|
|
* @include app4triqs/app4triqs.hpp
|
2018-03-22 18:11:39 +01:00
|
|
|
*/
|
|
|
|
class toto {
|
|
|
|
|
2018-11-21 22:52:55 +01:00
|
|
|
int i = 0;
|
2018-03-22 18:11:39 +01:00
|
|
|
|
|
|
|
public:
|
2019-04-26 16:23:36 +02:00
|
|
|
toto() = default;
|
2018-03-22 18:11:39 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct from integer
|
|
|
|
*
|
2019-04-23 19:33:57 +02:00
|
|
|
* @param i_ a scalar :math:`G(\tau)`
|
2018-03-22 18:11:39 +01:00
|
|
|
*/
|
2018-03-25 19:00:54 +02:00
|
|
|
explicit toto(int i_) : i(i_) {}
|
|
|
|
|
|
|
|
~toto() = default;
|
2018-03-22 18:11:39 +01:00
|
|
|
|
2018-03-25 19:00:54 +02:00
|
|
|
// Copy/Move construction
|
|
|
|
toto(toto const &) = default;
|
|
|
|
toto(toto &&) = default;
|
|
|
|
|
|
|
|
/// Copy/Move assignment
|
2018-03-22 18:11:39 +01:00
|
|
|
toto &operator=(toto const &) = default;
|
|
|
|
toto &operator=(toto &&) = default;
|
|
|
|
|
|
|
|
/// Simple accessor
|
2019-09-13 23:10:35 +02:00
|
|
|
[[nodiscard]] int get_i() const { return i; }
|
2018-03-22 18:11:39 +01:00
|
|
|
|
2019-04-23 19:33:57 +02:00
|
|
|
/**
|
|
|
|
* A simple function with :math:`G(\tau)`
|
|
|
|
*
|
|
|
|
* @param u Nothing useful
|
|
|
|
*/
|
2019-04-26 16:23:36 +02:00
|
|
|
int f(int u) { return u; }
|
2019-04-23 19:33:57 +02:00
|
|
|
|
2018-03-22 18:11:39 +01:00
|
|
|
/// Arithmetic operations
|
|
|
|
toto operator+(toto const &b) const;
|
|
|
|
toto &operator+=(toto const &b);
|
|
|
|
|
|
|
|
/// Comparison
|
|
|
|
bool operator==(toto const &b) const;
|
|
|
|
|
|
|
|
/// HDF5
|
2020-04-03 22:20:03 +02:00
|
|
|
static std::string hdf5_format() { return "Toto"; }
|
2018-03-22 18:11:39 +01:00
|
|
|
|
2020-04-03 22:20:03 +02:00
|
|
|
friend void h5_write(h5::group grp, std::string subgroup_name, toto const &m);
|
|
|
|
friend void h5_read(h5::group grp, std::string subgroup_name, toto &m);
|
2018-03-22 18:11:39 +01:00
|
|
|
|
|
|
|
/// Serialization
|
2019-04-25 19:52:22 +02:00
|
|
|
template <class Archive> void serialize(Archive &ar, const unsigned int) { ar &i; }
|
2018-03-22 18:11:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Chain digits of two integers
|
|
|
|
*
|
2019-04-25 21:48:21 +02:00
|
|
|
* @head A set of functions that implement chaining
|
|
|
|
*
|
|
|
|
* @tail Do I really need to explain more ?
|
2018-03-22 18:11:39 +01:00
|
|
|
*
|
2019-04-23 19:33:57 +02:00
|
|
|
* @param i The first integer
|
|
|
|
* @param j The second integer
|
2018-03-22 18:11:39 +01:00
|
|
|
* @return An integer containing the digits of both i and j
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int chain(int i, int j);
|
|
|
|
|
|
|
|
} // namespace app4triqs
|