Skip to content

Commit

Permalink
Changing occupancies from integer to double
Browse files Browse the repository at this point in the history
  • Loading branch information
lratcliff authored and msnik1999 committed Apr 19, 2024
1 parent 75b4ebe commit 9ebc1da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 9ebc1da

Please sign in to comment.