Opened 13 years ago

Closed 13 years ago

#230 closed defect (fixed)

XY_DataSet problem

Reported by: Ned Field Owned by: Kevin Milner
Priority: major Milestone: OpenSHA 1.2
Component: sha Version: 1.0.x
Keywords: Cc:

Description

The getMinX(), getMaxX(), getMinY(), and getMaxY() methods were not working because the xTracker and yTracker were never being set when data is added.

I fixed this in the set(Point2D point) method (which also fixes the set(double x, double y) method), but this is not fixed in the set(int index, double y) method because this one replaces a previous point, and I don't see a way to remove previous points from the xTracker and yTracker.

Change History (2)

comment:1 Changed 13 years ago by Peter Powers

I am working on this. Thinking about the problem you mention, there are some larger issues at hand. XY_data set is for scattered XY data pairs. To my mind you'd never be replacing data points based on X values. What if there are multiple points with the sameX value? The results are undefined. There are also many more statistics one might want from xy data and so swapping MinMaxAveTracker? for org.apache.commons.math.stat.descriptive.SummaryStatistics?. This has no overhead in terms of redundant storage. As an experiment I am making this conversion in XY_DataSet, but it may be valuable to update the function classes as well as there are quite a few math operations available.

comment:2 Changed 13 years ago by Peter Powers

Resolution: fixed
Status: newclosed

A case could probably be made for inserting or renaming a class to ContinuousFunction? which would still descend from XY_DataSet but would be the level at which set(int,double) is declared.

Changed in [7663]

Note: See TracTickets for help on using tickets.