reset: using assert for validation
This commit is contained in:
parent
f799857da9
commit
b8e393bf36
2 changed files with 2 additions and 26 deletions
|
|
@ -48,19 +48,7 @@ public:
|
||||||
*/
|
*/
|
||||||
eoRanking(double _p = 2.0, double _e = 1.0) : pressure(_p), exponent(_e)
|
eoRanking(double _p = 2.0, double _e = 1.0) : pressure(_p), exponent(_e)
|
||||||
{
|
{
|
||||||
if (pressure <= 1.0)
|
assert(1 < pressure and exponent <= 2);
|
||||||
{
|
|
||||||
std::string msg = "eoRanking: pressure must be > 1.0";
|
|
||||||
eo::log << eo::errors << "ERROR: " << msg << std::endl;
|
|
||||||
throw eoException(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exponent > 2.0)
|
|
||||||
{
|
|
||||||
std::string msg = "eoRanking: exponent must be <= 2.0";
|
|
||||||
eo::log << eo::errors << "ERROR: " << msg << std::endl;
|
|
||||||
throw eoException(msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* helper function: finds index in _pop of _eo, an EOT * */
|
/* helper function: finds index in _pop of _eo, an EOT * */
|
||||||
|
|
|
||||||
|
|
@ -59,19 +59,7 @@ public:
|
||||||
*/
|
*/
|
||||||
eoRankingCached(double _p = 2.0, double _e = 1.0) : pressure(_p), exponent(_e), cached_pSize(0)
|
eoRankingCached(double _p = 2.0, double _e = 1.0) : pressure(_p), exponent(_e), cached_pSize(0)
|
||||||
{
|
{
|
||||||
if (pressure <= 1.0)
|
assert(1 < pressure and exponent <= 2);
|
||||||
{
|
|
||||||
std::string msg = "eoRankingCached: pressure must be > 1.0";
|
|
||||||
eo::log << eo::errors << "ERROR: " << msg << std::endl;
|
|
||||||
throw eoException(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exponent > 2.0)
|
|
||||||
{
|
|
||||||
std::string msg = "eoRankingCached: exponent must be <= 2.0";
|
|
||||||
eo::log << eo::errors << "ERROR: " << msg << std::endl;
|
|
||||||
throw eoException(msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue