| 22 | namespace mlspp { |
| 23 | |
| 24 | LeafCount::LeafCount(const NodeCount w) |
| 25 | { |
| 26 | if (w.val == 0) { |
| 27 | val = 0; |
| 28 | return; |
| 29 | } |
| 30 | |
| 31 | if ((w.val & one) == 0) { |
| 32 | throw InvalidParameterError("Only odd node counts describe trees"); |
| 33 | } |
| 34 | |
| 35 | val = (w.val >> one) + 1; |
| 36 | } |
| 37 | |
| 38 | LeafCount |
| 39 | LeafCount::full(const LeafCount n) |
nothing calls this directly
no test coverage detected