Commit Graph

126 Commits

Author SHA1 Message Date
Matteo Miraz 7b4e58b1bc BugFix: Initialization does not reset manual bounds (if already set) 2013-09-17 12:15:18 +02:00
Matteo Miraz 9415309fde Adding equals and hashCode methods to BoundingBox3d 2013-09-17 12:14:09 +02:00
Matteo Miraz 49cd1ce9d3 Better equals and hashcode in Coord3d
Since the class is mutable and exposes its fields publicly, we cannot cache the hashCode!
2013-09-17 12:10:27 +02:00
Matteo Miraz abb1109101 Removing .DS_Stores 2013-09-17 10:57:25 +02:00
Martin Pernollet 82addb86e0 fixed maven modules 2013-09-15 23:36:19 +02:00
Martin Pernollet dc09c8e890 missing jdt non reg test data file 2013-09-15 12:57:14 +02:00
Martin Pernollet 93e52bb083 upd readme 2013-09-15 12:34:10 +02:00
Martin Pernollet 9466b0c0b0 upd readme 2013-09-15 12:08:22 +02:00
Martin Pernollet f319241e0c upd readme 2013-09-15 12:02:23 +02:00
Martin Pernollet bcdded2b59 upd readme 2013-09-15 11:51:44 +02:00
Martin Pernollet a50d9bd1be upd readme 2013-09-15 11:51:00 +02:00
Martin Pernollet e3b88fbac1 upd readme 2013-09-15 11:49:36 +02:00
Martin Pernollet d6439d704b upd readme 2013-09-15 08:50:19 +02:00
Martin Pernollet 0d09e2eb5e upd readme links 2013-09-15 08:47:08 +02:00
Martin Pernollet 5fcadf2310 moved api, tutorials, jdt and swt modules into on single module 2013-09-15 08:40:29 +02:00
Martin Pernollet 39195ab77c added trials 2013-08-28 00:22:03 +02:00
Martin Pernollet 064f19d2c5 ... 2013-08-26 17:17:43 +02:00
Martin Pernollet 1d82a216c7 cleanup dependencies 2013-08-18 17:45:30 +02:00
Martin Pernollet 7c5ea09880 pom-maths.xml can deploy a small jar containing maths & io packages 2013-08-18 17:38:56 +02:00
Martin Pernollet 25bdc9bf18 rename non test code for maven, slight coord2d improvements 2013-08-18 17:37:34 +02:00
jzy3d f823819b32 Merge pull request #29 from laurentpsychedelic/TimSort_Exception_Bug
The comparison method used in PointOrderStrategy#compare(Coord3d, Coord3...
2013-08-11 12:45:26 -07:00
Laurent FABRE 36470b61e9 The comparison method used in PointOrderStrategy#compare(Coord3d, Coord3d)
violates the comparison contract used by the new collection sorting algorithm
of JDK/JRE7 (TimSort).

Writing:
        if (d1<d2)
            return 1;
        else
            return -1;
violates the reflexivity condition required by the new algorithm,
because it implies that A > B AND B > A are true at the same time for a
certain set of inputs A and B (in fact for all A and B such as A = B).
The condition A > B if, and only if B < A is not satisfied.
The reason is that two equal objects are not recognized as being equal
by the previous implementation of PointOrderingStrategy#compare.

Up to JDK/JRE6, the default algorithm used for sorting collection (MergeSort)
does not care about the reflexivity condition and sort the collection given
as input without throwing an error, however the new TimSort algorithm throws
an exception when it finds that the Comparator<T> provided to sort the collection
violates the reflexivity condition.

    java.lang.IllegalArgumentException: Comparison method violates its general contract!

    java.util.TimSort.mergeHi(TimSort.java:868)
    java.util.TimSort.mergeAt(TimSort.java:485)
    java.util.TimSort.mergeForceCollapse(TimSort.java:426)
    java.util.TimSort.sort(TimSort.java:223)
    java.util.TimSort.sort(TimSort.java:173)
    java.util.Arrays.sort(Arrays.java:659)
    java.util.Collections.sort(Collections.java:217)
    org.jzy3d.plot3d.rendering.ordering.AbstractOrderingStrategy.sort(AbstractOrderingStrategy.java:25)
    org.jzy3d.plot3d.rendering.scene.Graph.draw(Graph.java:182)
    org.jzy3d.plot3d.rendering.scene.Graph.draw(Graph.java:160)

It is possible to make JDK/JRE7 use the old algorithm by specifying the
following JVM option when starting the program:
    -Djava.util.Arrays.useLegacyMergeSort=true

However it looks safer and more portable to adapt the comparator so it does
not violate the contract, like in the follwing:
            if (d1<d2)
                return 1;
            else if (d2>d1)
                return -1;
            else
                return 0;

The behavior should be the same, without throwing exceptions when run
on JDK/JRE7.

I added a test org.jzy3d.tests.TestPointOrderingStrategy#testPointOrdering
that fails with previous sorting implementation on JDK/JRE7 without the
-Djava.util.Arrays.useLegacyMergeSort=true options. The test is successfull
with the new implementation of PointOrderStrategy#compare(Coord3d, Coord3d)
on both JDK/JRE6 and 7.
2013-08-11 19:15:55 +09:00
Martin Pernollet a84a171038 fixed readme 2013-07-25 11:44:47 +02:00
Martin Pernollet 2eae15de94 fixed readme 2013-07-25 11:42:46 +02:00
Martin Pernollet ed6958daf8 getting delaunay triangulation through jdt-core fork 2013-07-25 11:35:10 +02:00
Martin Pernollet f3fcf41983 https://github.com/jzy3d/jzy3d-api/issues/28: fixed background image 2013-07-23 10:18:16 +02:00
Martin Pernollet 3dfc62773e fixed keycontroller addition issue 2013-06-20 15:50:02 +02:00
Martin Pernollet b0e799367d extracting a SwingChart to ease the use of CanvasSwing (although deprecated) 2013-06-06 14:43:48 +02:00
Martin Pernollet 295102e0a2 add reference to master project in readme 2013-05-31 16:32:31 +02:00
Martin Pernollet 0f9473a6e7 cleanup 2013-05-30 16:29:27 +02:00
Martin Pernollet 8669ecdf47 add multimodule maven build 2013-05-30 16:22:48 +02:00
Martin Pernollet fa1a103a29 upd 2013-05-30 15:43:04 +02:00
Martin Pernollet 07097386e6 fix readme 2013-05-29 12:32:19 +02:00
Martin Pernollet 21f4ea4154 fix readme 2013-05-29 12:25:36 +02:00
Martin Pernollet 4ac97ff204 https://github.com/jzy3d/jzy3d-api/issues/22 separate SWT + cleanup https://github.com/jzy3d/jzy3d-api/issues/21 2013-05-29 12:19:44 +02:00
Martin Pernollet 77f864de66 https://github.com/jzy3d/jzy3d-api/issues/21: merged GL2>GL|GLES, extracted AWT code and dependencies in src/awt. Should remain in this project for a while before being extracted in a module 2013-05-29 02:21:28 +02:00
Martin Pernollet a382d2692d upd 2013-05-28 21:56:04 +02:00
Martin Pernollet 427cf50fcb https://github.com/jzy3d/jzy3d-api/issues/20: changed method setAxe to support IAxe interface instead of AxeBox impl 2013-05-21 21:27:43 +02:00
Martin Pernollet b2961cfccf https://github.com/jzy3d/jzy3d-api/issues/10: let getCanvasAsGLAutoDrawable() work with a CanvasNewt 2013-05-21 11:32:51 +02:00
cmh b38e2b160b first refactoring pass :
- distinct draw path for Open GL ES
- use newt events as primary event types
- partial AWT classes removal

Mouse event are partially broken : click are ok, drags are lost in a
simple AWT Canvas test. Next step is development of a working Android
subset.
2013-05-14 17:05:35 +02:00
Martin Pernollet cdebc8aae0 improve javadoc for canvases 2013-05-13 12:18:24 +02:00
Martin Pernollet 56ee02ceec let ChartComponentFactory inform that CanvasSwing is depecrecated through a warn log 2013-05-13 11:33:43 +02:00
Martin Pernollet b948ceedd2 deprecating CanvasSwing, let Color expose the array of simple static colors 2013-05-13 11:29:21 +02:00
Martin Pernollet bbc866eb35 added drawable parametric equation, improve maven build file 2013-04-03 12:43:03 +02:00
Martin Pernollet d1e31e1466 fixed convex hull, update pom file 2013-03-29 18:01:45 +01:00
Martin Pernollet 4cfe72803b moved Nils Newt bridge with bridge classes 2013-03-29 17:17:18 +01:00
Martin Pernollet b9fb585885 merged Nils 2013-03-29 17:13:17 +01:00
Martin Pernollet 03fcc44740 logger can print date of log 2013-03-23 18:36:04 +01:00
Martin Pernollet 194b164045 cleanup project 2013-03-15 12:26:45 +01:00
Martin Pernollet e79949e91d https://github.com/jzy3d/jzy3d-api/issues/11: removed unnecessary coordinate validation and classes involving memory overflow on delaunay tesselation 2013-03-14 18:32:36 +01:00