[go: up one dir, main page]

Skip to content

Releases: kynosarges/tektosyne

Version 6.2.0 (originally released 2018-03-25)

03 Apr 18:59
Compare
Choose a tag to compare

Release of 6.2.0 and 6.1.0

This is a combined release of 6.2.0 and 6.1.0

Changes in Tektosyne 6.2.0 (see here for more information)

  • GeoUtils & MathUtils: Updated Javadoc for use of ThreadLocalRandom since 6.1.0.
  • GeoUtils:
    • randomPoint: Added overload that takes a bounding RectD.
    • Added method randomRect with a given bounding RectD.

Planar Subdivisions

  • Subdivision.intersection:

    • Fixed output faces incorrectly mapping to the unbounded face of an input Subdivision. This happened when all incident edges of an output face were from the other input Subdivision.
    • SplitEdgeResult.updateFaces: Fixed face mapping not being updated for twins of current edges.
    • Added extensive unit tests, both random and non-random.
  • SubdivisionMap:

    • from/toFace: Added default implementations that throw UnsupportedOperationException.
    • Added interface SubdivisionFullMap that extends SubdivisionMap to support edges and vertices. The additional conversion methods also throw UnsupportedOperationException by default, allowing selective implementation by clients.
  • SubdivisionLinesTest: Added more factory methods to create subdivisions.

  • SubdivisionPolygonsTest: Actually added factory methods promised in Javadoc…

Voronoi Diagrams

  • Allowed special case of only two generator sites, with a single edge separating them and no natural vertices.
  • VoronoiResults.voronoiRegions:
    • Fixed invalid result when edges exactly hit corners of the clipping rectangle.
    • Source: Extensive rewrite for two-site support, bug fixes, and general legibility.
  • VoronoiTest:
    • Added tests for both cases described above.
    • Random Voronoi test now also randomizes boundaries and runs repeatedly.
    • Extracted generation of random Voronoi diagrams as factory method.

Changes in Tektosyne 6.1.0 (see here for more information)

  • Updated to Java SE 9.0.4. The precompiled library JAR still targets Java SE 8.
  • Added proper manifest to library JAR file.
  • GeoUtils, MathUtils, Tests & Demo: Changed Random to faster ThreadLocalRandom.
  • NodeList1/2Test: Changed deprecated “new Integer(…)” to Integer.valueOf(…).
  • PointI.toString: Fixed coordinates being labeled “width/height” rather than “x/y.”
  • Demo: Improved tooltips on numerical Spinner controls.
  • ReadMe: Removed notes on Java and JavaFX issues which appear to be obsolete as of Java SE 9.

Float/Double.MIN_VALUE

  • Float/Double.MIN_VALUE is the smallest positive value, not the smallest negative value as for integral types. NEGATIVE_INFINITY must be used instead, or algorithms will fail for negative arguments.
  • Float/Double.MAX_VALUE works the same as for integral types but was also changed to POSITIVE_INFINITY where needed for symmetry.
  • Fortran.max/min: Changed default values for Float/Double arguments from MIN/MAX_VALUE to NEGATIVE/POSITIVE_INFINITY.
  • RectD.circumscribe(PointD...), SubdivisionSearch.Trapezoid (internal use): Changed search initializations from MIN/MAX_VALUE to NEGATIVE/POSITIVE_INFINITY.
  • Changed unit tests for the cases described above to include negative values.

Voronoi Diagrams

  • Fixed Voronoi edges being output twice when they do not touch any vertices, only the clipping bounds.
  • VoronoiResults.voronoiRegions:
    • Fixed invalid result when a Voronoi region must be closed over three corners of the clipping rectangle. Previously this case was mistakenly closed over the opposite single corner.
    • Fixed open regions not being closed for exactly horizontal or vertical edges.
    • Added unit tests for the cases described above.
    • Upgraded some assertion failures to exceptions.

Findbugs fixes

17 Apr 18:40
Compare
Choose a tag to compare

Small changes were made to the codebase to comply with findbugs
Added NaN note, updated PointDComparator

tektosyne

19 Mar 22:51
Compare
Choose a tag to compare

Tektosyne is a partial Java port of my older .NET library. For those who have used the older version, here is a list of significant changes in functionality.

Removed Classes

Tektosyne for Java only contains functionality from the .NET library Tektosyne.Core. The second library in the .NET edition, Tektosyne.Windows, was entirely specific to Windows and WPF.
From Tektosyne.Core, the geometric and graph algorithms with related collections have been ported, along with some fundamental mathematical algorithms. All .NET-specific classes (e.g. Tektosyne.IO), general-purpose classes with existing Java ports (e.g. MersenneTwister), and various helper classes of dubious usefulness have been removed.

Changed Classes

As Java lacks a global flag or keyword for checked arithmetic, many methods were changed to either widen calculations from int to long or throw an ArithmeticException if the target type of a conversion overflows. This has been noted in the corresponding Javadoc entries.
The .NET version used to silently ignore negative comparison epsilons, which however could lead to nonsensical results in certain algorithms. The Java version throws an IllegalArgumentException whenever a negative epsilon is specified, except for methods that always raise epsilon to a fixed minimum value (see Javadoc).

Fortran:

  • Removed overloads for decimal and short.
  • Removed sign overloads as the Java method Math.copySign provides equivalent functionality.
  • Added knint overloads that round float and double values to long, equivalent to nint for int.
  • Changed integral modulo overloads to return Math.floorMod which Java conveniently defines for these types. modulo remains for the floating-point overloads which Java lacks.

MathUtility:

  • Renamed to MathUtils in conformance with standard Java usage.
  • Added toIntExact and toLongExact for checked conversions from double and float.
  • Removed overloads for decimal, short, and uint.

Collections:

  • Removed separate namespace (package) as the Java Collections Framework already provides most of the features that my own classed added to the .NET Framework collections.
  • Added NodeList which is the exact equivalent of Java’s LinkedList but publicly exposes its node structure, like .NET’s LinkedList.
  • Ported BraidedTree.FindRange as PointDComparator.findRange for Java’s NavigableMap and NavigableSet which proved sufficient replacements for BraidedTree.
  • Ported QuadTree but with massive API differences due to JCF conformity, e.g. attempting to add an existing entry will silently overwrite the existing value rather than throwing an exception.

Geometry:

  • Removed primitives with float coordinates (LineF, PointF, RectF, SizeF) as I had never used them in practice.
  • Removed ability to set comparison epsilon after construction from PointDComparatorX/Y and Subdivision. This was a testing convenience that would cause bugs when used on live objects.
  • GeoAlgorithms: Renamed to GeoUtils and made random number generation thread-safe via standard method Math.random.
  • LineIntersection.locateCollinear: Documentation claimed that this algorithm was identical to LineD.locateCollinear but the implementations differed, and the epsilon overload performed fewer epsilon checks. The LineD implementations were copied to LineIntersection, and LineD/I now simply forward to that class.
  • PointDComparator: Java’s List.sort throws an IllegalArgumentException for any Comparator that signals equality for objects with false equals or unequal hashCode results. This happens when the comparison epsilon overlaps PointD distances in both dimensions. I cannot influence this behavior but have documented it in setEpsilon.
  • PolygonGrid: Renamed …Display… methods to …World…, matching Graph usage and no longer implying display output.
  • RectI/D: Completely rewritten with minimum & maximum coordinates rather than location & size. RectI now also includes its greatest coordinates, like RectD. This greatly simplified the code, but all algorithms using these classes must be changed accordingly.
  • RectLocation: Simplified redesign as combination of two LineLocation values.

Graph:

  • Graph: Renamed Graph2D to Graph as there is only one, and all other classes assume that one class. Also added getNeighbors overload with steps parameter and a default implementation that works for all graphs.

Subdivision:

  • Moved Subdivision & all related classes to new package org.kynosarges.tektosyne.subdivision as there were a lot of related classes, and more in the Java port.
  • Subdivision: Collections no longer offer index access as Java does not provide collections that are both indexed and (quickly, automatically) sorted. In particular, vertices are now exclusively identified by their PointD coordinates rather than by collection indices. This simplified the API overall.