Comments (6)
Turns out we already have constants for this in cyc_limits.h
:
/// maximum (+ or -) value for an integer variable
static const int kIntBoundLimit = std::numeric_limits<int>::max();
/// maximum (+ or -) value for a linear variable
static const double kLinBoundLimit = std::numeric_limits<double>::max();
from cyclus.
I found those recently, too, but they seemed to be named in a way that was intended for some specific purpose. Perhaps we can revisit their naming so that it is more clear how they can/should be used.
from cyclus.
They're not used anywhere in cyclus/cyclus or cyclus/cycamore. Based on their names it sounds like they might be intended for this specific purpose (specifying an upper/lower bound) but I agree that we could use more intuitive names. What do you think about changing them to something more generic like:
cy_max_int
cy_min_int
cy_max_double
cy_min_double
Looking at the rest of this file:
- There are also no instances of
kConstraintEps
anywhere else in the code, and I'm unsure of the use case for it vs.cy_eps
. kModifierLimit
is used only incommodity_producer.h
(and a test). It is describe asmaximum value for a function modifier (i.e., a_i for variable x_i)
in a comment, but its not clear to me whether this is how it's being used in CommodityProducer
from cyclus.
Trying to clean up places in cyclus and cycamore where we use 1e299
and running into overflow issues in the Enrichment class when calculating enrichment parameters. It appears that by using std::numeric_limits::max()
instead of 1e299
there are some calculations that push us over the edge. @gonuke do you know if 1e299
was picked arbitrarily or is it meant to be an intentional upper bound on some parameters?
Many of the places it is used in cycamore can be found here
from cyclus.
I don't recall how we chose 1e299. Any idea how different it is from the IEEE max double?
from cyclus.
The IEEE max double is the same as std::numeric_limits<double>::max()
- roughly 1.8e+308
. I will continue exploring...
from cyclus.
Related Issues (20)
- No way to print out the full composition of a material to screen
- Cleanup compiler warnings
- Use `-` and `_` consistently in `install.py` flags
- Explicit Inventory does not pass relax-ng validation error HOT 1
- Use of packaging by supplier can result in trades not succeeding when requester accepts less than bid amount
- Material Sell Policy assumes a resource buffer is full of materials of the same composition
- `ResourceBuff` is deprecated
- GTest is included in Coveralls Report
- Review whether to store `Package` name or `Ptr`
- Sometimes resources are fully packaged, leaving a resource of zero quantity that gets recorded in the database
- Cannot find libexpat.so.1 HOT 2
- Support Ubuntu 24.04 LTS
- Complex interactions between `Package` strategies, `TransportUnit` strategies and the DRE
- Attempting to package a large quantity into small packages can throw vector length error HOT 4
- XInclude on Ubuntu 24.04
- `exclusive_orders_only` is deprecated HOT 1
- Use of fmod in material sell policy packaging process causes can result in extra full bid
- Streamline code/logic for determining the number of possible packages
- Package R-NG schema requires all elements 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 cyclus.