Change prtRvUniform to accept upper bound == lower bound
peterTorrione opened this issue · 1 comments
peterTorrione commented
Right now this causes an error:
>> r = prtRvUniform('lowerBounds',25,'upperBounds',25) >> r.draw Error using prtRvUniform/draw (line 118) DRAW cannot yet be evaluated. This RV is not yet valid because at least one entry of lowerBounds is greater than the corresponding entry of upperBounds.
First - the error message is wrong. Should be "Greater than or equal to". But even so, I think this should work (even if the resulting uniform is improper, and can be well represented by a prtRvDiscrete). I think the change is on line 138:
badOrder = ~all(R.upperBounds>=R.lowerBounds);
Any objections?
patrickkwang commented
Seems reasonable to me.