summaryrefslogtreecommitdiff
path: root/nlpsolver/src
AgeCommit message (Collapse)Author
2024-04-29Double values comparison changed to compare method.Todor Balabanov
Using the Double.compare() method is often preferred over the == comparison operator for comparing double values due to several reasons: Handling NaN (Not-a-Number) values: The Double.compare() method correctly handles NaN values, while the == operator does not. If either of the operands is NaN, the == operator will always return false, regardless of the other operand. In contrast, Double.compare() will correctly evaluate NaN values according to the IEEE 754 floating-point standard. Handling positive and negative zero: The == operator treats positive zero and negative zero as equal, whereas they are distinct values in IEEE 754 floating-point representation. Double.compare() correctly distinguishes between positive and negative zero. Robustness against rounding errors: Floating-point arithmetic can introduce rounding errors, causing two double values that should be equal to differ slightly. Directly comparing them with the == operator might yield unexpected results due to these small differences. Double.compare() allows you to define a tolerance level if necessary, providing more control over how equality is determined. Consistent behavior: The behavior of Double.compare() is consistent and predictable across different platforms and JVM implementations, as it follows the IEEE 754 standard. On the other hand, the behavior of the == operator might vary depending on the platform and compiler optimizations. Suitability for sorting: Double.compare() returns an integer value that can be directly used for sorting double values in ascending or descending order. This makes it convenient for sorting arrays or collections of double values. Overall, while the == operator might work in some cases, using Double.compare() provides more robust and predictable behavior, especially when dealing with floating-point numbers in Java. Change-Id: I5756936a0d2b4fe11b9113ddd33b6ae691f5103f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166796 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2021-08-06cid#1489772 UR: Uninitialized read of field in constructorCaolán McNamara
pass in SearchPoint to initialize pbest_t before it is then passed to setMemPoints setMemPoints sets the pbest_t variable of AbsGTBehavior so calling setPbest on AbsGTBehavior subclasses after calling that doesn't do anything so drop it, and then DEPSAgent.setPbest isn't needed anymore Change-Id: Id4fdc770cefc0f801218dc9bf51a6dc5b1e25d5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120115 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-02The null pointer bug should be fixed now.Todor Balabanov
Change-Id: I8278bfed8170907a958396839d0997fc127f4b2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119744 Tested-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-18Revert "Some lower objects coupling."Noel Grandin
This reverts commit 7b93bae224c7c2c49b105ef97304bb46f8b68da5. Reason for revert: Does not compile /home/tdf/lode/jenkins/workspace/lo_ubsan/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java:45: error: DEPSAgent is not abstract and does not override abstract method setLibrary(Library) in ILibEngine public class DEPSAgent implements ILibEngine { ^ 1 error Change-Id: I72f2a22ab1f4119178f8002c21ba0845c4cd1bdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119040 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-17Some lower objects coupling.Todor Balabanov
Change-Id: I0a7c658d830f82d627d20b9ed7000f3c5b8f1f89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119105 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-13Object initialization is done via a constructor with parameters.Todor Balabanov
Change-Id: I66e87f7c898efb1f2c6b1d31fbd5654244e3ea82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118785 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-21Global optimization metaheuristics sometimes are sensitive to the quality of ↵Todor Balabanov
the random numbers. Change-Id: Ibc1e95736c5f9355e67f2129a7804064e329da89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-03clean up some Java warningsNoel Grandin
Change-Id: Id54e8fd6803c3a6c0d924338d1781679ed0b1bfd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115025 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-25value and targetValue cannot be null at this pointNoel Grandin
Change-Id: I175da8a170fcddca083ed47b41c7241433e54db0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103383 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-28Related tdf#135211: return early if no dataJulien Nabet
With DEPS or SCO Evolutionary algorithms, it'll return "No solution found." Change-Id: I15e8e24eb519a20e3f3645b79e990949f648fbd2 Change-Id: I7321419ccc1cd00d75f03fa86d3c0cb4bf9ad473 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99584 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-07-28Typo: Swam->SwarmJulien Nabet
Change-Id: I99dbe7fa6d49e0663c3551d2e3dabd3f42d8d3c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99578 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-06Fixing '....'Andrea Gelmini
Change-Id: Icf2a34500acc18b28f113c85366bf24edc6d20b9 Reviewed-on: https://gerrit.libreoffice.org/78695 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-03Checking of min and max factor value was added.Todor Balabanov
It is possible user to swap these two values. Change-Id: Ib375d705e42f7257aa9b16d72ab834020e401cde Reviewed-on: https://gerrit.libreoffice.org/72483 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-06-03Range for DE scaling factor was implemented.Todor Balabanov
Change-Id: I5b8d3cd69a6138d7eebf37c299626019b32d639a Reviewed-on: https://gerrit.libreoffice.org/72373 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-06-26tdf#43388: add missing info for Evolutionary Algorithm SolverJulien Nabet
Add SolverConstraintOperator.INTEGER_value case and in the same time the also missing SolverConstraintOperator.BINARY_value case Change-Id: I18b826e74a2381dedaea3090919118b8d5dad072 Reviewed-on: https://gerrit.libreoffice.org/56359 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-12-12tdf#104268 NLPSolver: Improve display of solutionLaurent Balland-Poirier
Format "%.2f" is not optimal for large or small values. Format "%g" should be prefered. Change-Id: I92899d80564b9000b1f3e049221c456f8e1176a9 Reviewed-on: https://gerrit.libreoffice.org/31445 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-01-21coverity#1326449 Dereference null return valueCaolán McNamara
and coverity#1326448 Dereference null return value Change-Id: I8e26c9c57264b654a5a7c3dc56c658f23291e357
2015-11-04coverity#1327027 SIC: Inner class could be made staticCaolán McNamara
Change-Id: I9c36aa362e58de724c63b9d23334eabfc973ee42
2015-10-21More plausible fixStephan Bergmann
...for 7c465e7f9e8b5c34a4926fb0de84de70aee8f37d "coverity#1326260 Explicit null dereferenced" Change-Id: I3b7fb8195c29b7e447fbe31f823cd00d7a820e95
2015-10-15coverity#1326260 Explicit null dereferencedCaolán McNamara
Change-Id: I75b9cb661a7a45304bf32395ad980f83621f4612
2015-10-15cid#1327023 to cid#1327077 SIC: Inner class could be made staticNoel Grandin
Change-Id: I41f89c4feefe4e012d72c663ebb9bbcb4aa7f163
2015-09-18Fix typosAndrea Gelmini
Change-Id: I021589aeca9ef6bceb1c828c2197f5ff58f85b09 Reviewed-on: https://gerrit.libreoffice.org/18707 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2015-02-17tdf#87074 null-ref error from NLPSolver in BasicLeMoyne Castle
Initialize java class member objects exposed as XSolver properties: no default construction in java. Fixes issue for both DEPS and SCO solvers. Also removed info level console prints. Change-Id: I6762c5cca978072ce20b1f69a6b523f53364107d Reviewed-on: https://gerrit.libreoffice.org/14499 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-05java: remove dead codeNoel Grandin
found by UCDetector Change-Id: I6b0f49529379072da566e927b86815f173e7a90b
2014-12-19java: nlpsolver: getPropertyByName was checking the wrong datastructureNoel Grandin
Found by PMD Change-Id: I76d38d71a3379416fe7e5078ef8b121915b26b6b
2014-12-11java: reduce visibility of fields and methodsNoel Grandin
found by PMD Change-Id: Id6737916b68ccbdbdeec5d314747a38410923ac6 Reviewed-on: https://gerrit.libreoffice.org/13409 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-12-05java: remove some unused local variablesNoel Grandin
Change-Id: Ia01528460e2f4b610d123e29cad66520abc6a965
2014-11-18java: make fields final where possibleNoel Grandin
found by PMD Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec
2014-11-12java: convert fields to local variables where possibleNoel Grandin
found by PMD Change-Id: I05b45382b8fb1b734657ce9421a20e6ef6fbe542 Reviewed-on: https://gerrit.libreoffice.org/12376 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-17java: final fields that can be staticNoel Grandin
Change-Id: I8c06be7bc0b8a38c662209f0de72a00550e25447
2014-08-20java: remove modifiers implied by the contextNoel Grandin
found by PMD Change-Id: I04cbf986ddbcffff987784f381b8a9f52f1b3f31
2014-08-19java: use 'Integer.valueOf' instead of 'new Integer'Noel Grandin
Change-Id: Ia8befb8d69914ce971174fc5f2ffc0e2f506a940
2014-08-19java: use Boolean.valueOf instead of instantiating Boolean objectsNoel Grandin
Change-Id: Ie41d6b0170a035a694dd270c311a137fd1810e74
2014-08-19java: remove unused methodsNoel Grandin
Change-Id: Ibb905e6f3e7d92a0e558f1f6562e5b472cd2717b
2014-08-13java: remove dead methodsNoel Grandin
found by UCDetector Change-Id: I219caa8e680dba5a395541a778df6144841c4dde
2014-08-13java: remove unused enum valuesNoel Grandin
found by UCDetector Change-Id: Ic07be7e34204b5d838a722e1ce6038506a771144
2014-08-13java: remove unused fieldsNoel Grandin
found by UCDetector Change-Id: I4a7c56a9918054c23469de5680658e7b501f0165
2014-08-13java: reduce scope, make some methods privateNoel Grandin
found by UCDetector Change-Id: Ib1425edde146193a65c242dc159b7e3fbf0e4a2e
2014-08-13java: reduce scope, make member classes privateNoel Grandin
found by UCDetector Change-Id: Ief32d078090102b14b60b35fc36542f8d4fb252b
2014-08-13java: reduce scope, make fields privateNoel Grandin
found by UCDetector Change-Id: I7f97e15667159cf8ee776e8f32fdcdec8ec00ed6
2014-08-13java: reduce scope, make constructors privateNoel Grandin
found by UCDetector Change-Id: If05277fd2fe77ceabb4c7c87aeb8569e3406102d
2014-04-27fdo#78004 fix string formattingAlex Gulyás
Added missing 's' Change-Id: I7570d86d65ebcffc547b06ab9c19843de0b90436 Reviewed-on: https://gerrit.libreoffice.org/9181 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2014-02-26Remove trailing whitespace from nlpsolverAlexander Wilms
Change-Id: I8ee2aff2c18adaf5582ed6eeb174e88313d8c8a2 Reviewed-on: https://gerrit.libreoffice.org/8283 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2014-01-08Some ConfigurationProvider -> theDefaultProvider simplificationsStephan Bergmann
Change-Id: I7c25cd94f8a1ca339f7423c26f21f13c7a68906d
2013-05-06Java cleanup, Convert Vector to ArrayListNoel Grandin
Change-Id: I323a6625f93347e69f3114fc10cb04dc759a539f
2013-05-06remove some unnecessary castsNoel Grandin
Change-Id: I63b0ce257b40caa53aef337e953ce8d07862d292
2013-04-30Move to MPLv2 license headers, with ESC decision and author's permission.Michael Meeks
2013-04-19Java cleanup, remove unnecessary castsNoel Grandin
Change-Id: Id12089bc7df16631737e6acaee0973fb91dd953f Reviewed-on: https://gerrit.libreoffice.org/3431 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2012-10-23gbuild: let ExtensionTarget expect manifest below META-INFMichael Stahl
Change-Id: Ia07d3fd856578ab6976c02f8a0ec96273db19a2c
2012-09-27fdo#51304: Remove @author and more commented codeMarcos Paulo de Souza
More tags removed and with it, more commented code was found. So remove it all. Not functional changes here, just a cleanup. Change-Id: Id4a6b3126ca32f3460dec3056b9caa370d0ee69c Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>