Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing occupancies from integer to double #243

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/ComplexFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ComplexFunction &ComplexFunction::operator=(const ComplexFunction &func) {
*
* Initializes the mrcpp::ComplexFunction with NULL pointers for both real and imaginary part.
*/
ComplexFunction::ComplexFunction(int spin, int occ, int rank, bool share)
ComplexFunction::ComplexFunction(int spin, double occ, int rank, bool share)
: funcMRA(defaultMRA)
, func_ptr(std::make_shared<TreePtr>(share))
, rank(rank) {
Expand Down
8 changes: 4 additions & 4 deletions src/utils/ComplexFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct FunctionData {
int imag_size{0};
bool is_shared{false};
int spin{0};
int occ{0};
double occ{0};
};

class TreePtr final {
Expand Down Expand Up @@ -112,14 +112,14 @@ class ComplexFunction {
public:
ComplexFunction(std::shared_ptr<TreePtr> funcptr);
ComplexFunction(const ComplexFunction &func);
ComplexFunction(int spin = 0, int occ = -1, int rank = -1, bool share = false);
ComplexFunction(int spin = 0, double occ = -1, int rank = -1, bool share = false);
ComplexFunction &operator=(const ComplexFunction &func);
ComplexFunction paramCopy() const;
bool isShared() const { return this->func_ptr->func_data.is_shared; }
bool hasReal() const { return (this->func_ptr->re == nullptr) ? false : true; }
bool hasImag() const { return (this->func_ptr->im == nullptr) ? false : true; }
FunctionData &getFunctionData();
int occ() const { return this->func_ptr->func_data.occ; }
double occ() const { return this->func_ptr->func_data.occ; }
int spin() const { return this->func_ptr->func_data.spin; }
FunctionTree<3> &real() { return *this->func_ptr->re; }
FunctionTree<3> &imag() { return *this->func_ptr->im; }
Expand All @@ -130,7 +130,7 @@ class ComplexFunction {
MultiResolutionAnalysis<3> *funcMRA = nullptr;
int getRank() const { return rank; }
void setRank(int rank) { (*this).rank = rank; }
void setOcc(int occ) { this->getFunctionData().occ = occ; }
void setOcc(double occ) { this->getFunctionData().occ = occ; }
void setSpin(int spin) { this->getFunctionData().spin = spin; }
ComplexFunction dagger();
virtual ~ComplexFunction() = default;
Expand Down
Loading