2018-03-22 18:11:39 +01:00
|
|
|
#pragma once
|
|
|
|
#include <triqs/gfs.hpp>
|
|
|
|
|
|
|
|
namespace app4triqs {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A very useful and important class
|
|
|
|
*
|
|
|
|
* @note A Useful note
|
|
|
|
*/
|
|
|
|
class toto {
|
|
|
|
|
|
|
|
int i = 0.0;
|
|
|
|
|
|
|
|
public:
|
2018-03-25 19:00:54 +02:00
|
|
|
toto() = default;
|
2018-03-22 18:11:39 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct from integer
|
|
|
|
*
|
|
|
|
* @param i_ a scalar
|
|
|
|
*/
|
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
|
|
|
|
int get_i() const { return i; }
|
|
|
|
|
|
|
|
/// Arithmetic operations
|
|
|
|
toto operator+(toto const &b) const;
|
|
|
|
toto &operator+=(toto const &b);
|
|
|
|
|
|
|
|
/// Comparison
|
|
|
|
bool operator==(toto const &b) const;
|
|
|
|
|
|
|
|
/// HDF5
|
|
|
|
static std::string hdf5_scheme() { return "Toto"; }
|
|
|
|
|
|
|
|
friend void h5_write(triqs::h5::group grp, std::string subgroup_name, toto const &m);
|
|
|
|
friend void h5_read(triqs::h5::group grp, std::string subgroup_name, toto &m);
|
|
|
|
|
|
|
|
/// Serialization
|
|
|
|
template <class Archive> void serialize(Archive &ar, const unsigned int version) { ar &i; }
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Chain digits of two integers
|
|
|
|
*
|
|
|
|
* Chain the decimal digits of two integers i and j, and return the result
|
|
|
|
*
|
|
|
|
* @param :math:`i` The first integer
|
2018-03-25 19:00:54 +02:00
|
|
|
* @param :math:`j` The second integer
|
2018-03-22 18:11:39 +01:00
|
|
|
* @return An integer containing the digits of both i and j
|
|
|
|
*
|
|
|
|
* @remark
|
|
|
|
*/
|
|
|
|
int chain(int i, int j);
|
|
|
|
|
|
|
|
} // namespace app4triqs
|