dwavesystems / dimod

A shared API for QUBO/Ising samplers.
https://docs.ocean.dwavesys.com/en/stable/docs_dimod/
Apache License 2.0
124 stars 81 forks source link

Feature/expose onehot #1348

Closed kevinchern closed 1 year ago

codecov[bot] commented 1 year ago

Codecov Report

Merging #1348 (f928dbf) into main (3873226) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1348   +/-   ##
=======================================
  Coverage   94.95%   94.95%           
=======================================
  Files          95       95           
  Lines        9795     9795           
=======================================
  Hits         9301     9301           
  Misses        494      494           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

kevinchern commented 1 year ago

@arcondello added tests. I did not include cases where the constant is split, e.g., x + y - 1 == 0. The current implementation does not recognize this constraint as a one-hot constraint.

arcondello commented 1 year ago

Hmm, I see my own note about this https://github.com/dwavesystems/dimod/blob/3873226f4d32d45d0554f569769fec4f7bf80c49/dimod/include/dimod/constraint.h#L125-L127 but honestly I cannot remember my reasoning.. ah well. Let's assume there was a good reason for now.