Skip to content
Snippets Groups Projects
Commit 116b991d authored by Thannozzz's avatar Thannozzz
Browse files

added ImagNum definition in include/math/coor3d.hpp. It is an effort to merge develop with main.

parent 5bc233e6
No related branches found
No related tags found
1 merge request!19Merge develop into main
......@@ -147,6 +147,43 @@ class CartesianVectorBase {
CartesianCoor3D& operator[](size_t index);
CartesianCoor3D project(CartesianCoor3D vec);
};
class ImagNum {
protected:
// make this class serializable to
// allow sample to be transmitted via MPI
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const unsigned int version) {
ar& re;
ar& im;
}
///////////////////
public:
coor2_t re, im;
ImagNum() : re(0), im(0) {}
ImagNum(coor2_t v1, coor2_t v2) : re(v1), im(v2) {}
coor2_t length();
friend std::ostream& operator<<(std::ostream& os, const ImagNum& in);
ImagNum& operator=(const ImagNum& that);
ImagNum operator-(const ImagNum& that);
ImagNum operator+(const ImagNum& that);
ImagNum operator*(const ImagNum& that);
~ImagNum() {}
};
ImagNum operator*(const coor2_t lambda, const ImagNum& that);
ImagNum operator*(const ImagNum& that, const coor2_t lambda);
ImagNum operator/(const ImagNum& that, const coor2_t lambda);
ImagNum operator/(const coor2_t lambda, const ImagNum& that);
#endif
// end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment