[
https://issues.apache.org/jira/browse/MATH-824?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ori ziv updated MATH-824:
-------------------------
Attachment: AlgebraUtils.java
(prototype)
> Algebra Utils
> -------------
>
> Key: MATH-824
> URL: https://issues.apache.org/jira/browse/MATH-824
> Project: Commons Math
> Issue Type: New Feature
> Reporter: ori ziv
> Attachments: AlgebraUtils.java
>
>
> Is there a place here for basic but repeated methods such as:
> public static void verifyPositive(double number) {
> verifyBigger(number, 0, false);
> }
> public static void verifyTwoOrMore(double number) {
> verifyBigger(number, 2, true);
> }
> public static void verifyBigger(double number, double minimum,
> boolean isExactOK) {
> if (!isBigger(number, minimum, isExactOK)) {
> throw new IllegalArgumentException(number
> + (isExactOK ? "<" : "<=") + minimum);
> }
> }
> public static boolean isBigger(double number, double minimum,
> boolean isExactOK) {
> return number > minimum || isExactOK && number == minimum;
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira