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

after modifying the variable type in class inout, _base in class mh_sampler has a random value but not the assigned value #62

Open
QiongwenXu opened this issue Jan 29, 2020 · 1 comment

Comments

@QiongwenXu
Copy link
Collaborator

In macOS (10.15.2), after modifying the type of input and output in class inout from int to int64_t, _base in class mh_sampler is no longer the assigned value 2, but a random value. In Linux (Ubuntu 18.04), this issue does not occur.
code in inout.cc

class inout {
 public:
  int64_t input;
  int64_t output;
 ......
};

code in mh_sampler.cc

double mh_sampler::cost_to_pi(double cost) {
  // TODO: _base value is not 2 in macos, but 2 in linux
  // return pow(_base, -1.0 * cost);
  return pow(2, -1.0 * cost);
@QiongwenXu
Copy link
Collaborator Author

this problem disappears, but have not found the reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant