Comments (5)
note: It happens very rarely and I'm currently trying to find out under which conditions
from samplableset.
This might be related to #15. What are the minimum and maximum weight you are using? It is possible that there are some round-off errors that accumulate in the tree structure. When possible, use the clear
method if the set is empty. If the error still happens, we might need to implement some automated check-up on the tree structure to make sure that round-off errors do not cause these runtime errors.
from samplableset.
Yes, I think that's what's happening. I'm usually checking whether or not "total_weight" is zero and sample from the set if this is not the case. However, I'm inserting and deleting like crazy, so I think it happens that small errors accumulate and when the set is empty, the total weight is still 1e-11 or sth like that. In this case, I get the error above.
from samplableset.
In the latest version, there is an empty
method that checks the number of elements instead, or size
could be used also. These are not susceptible to rounding errors. When you find that the set is empty, use the clear
after to remove all remaining rounding errors in the tree. That might help.
from samplableset.
awesome, thanks!
from samplableset.
Related Issues (12)
- C++11 compatibility HOT 8
- Warnings when compiling HOT 1
- Rounding errors when sampling at multiple scales
- Error when trying to compile HOT 6
- v2.0: error: 'seed' is a protected member of 'sset::BaseSamplableSet'
- No exception for weight out of bounds in c++ HOT 1
- Methods to set new values for minimal and maximal weights
- No empty() method HOT 1
- empty set raises problems HOT 2
- 'Cannot infer the type from the element' on integer element HOT 2
- Possible to fail less harshly? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samplableset.