package jas2.hist.test;

import java.util.Observable;
import java.util.Date;
import jas2.hist.*;

public class Gauss2D extends Observable implements Rebinnable2DHistogramData
{
	public Gauss2D(String name, int entries)
	{
		if (entries > MAXSIZE) throw new IllegalArgumentException("Gauss2D: Size too big");

		m_tupleX = new double[MAXSIZE];
		m_tupleY = new double[MAXSIZE];
		m_entries = entries;
		m_name = name;

		for (int j=0; j=0 && Xbin=0 && YbinXbins) Xbin = Xbins+1;
				if (Ybin < 0   ) Ybin = Ybins;
				if (Ybin >Ybins) Ybin = Ybins+1;
				hist[Xbin][Ybin] += 1;
			}
		}
		double[][][] result = new double[1][][];
		result[0] = hist;
		return result;
	}
	public int getSize()
	{
		return m_entries;
	}
	public void setSize(int newSize)
	{
		if (newSize > MAXSIZE) throw new IllegalArgumentException("Gauss: Size too big");
		m_entries = newSize;
		synchronized (this) { notifyObservers(new HistogramUpdate(HistogramUpdate.DATA_UPDATE,true)); }
	}
	public double getXData(int i)
	{
		return m_tupleX[i];
	}
	public double getYData(int i)
	{
		return m_tupleY[i];
	}
	public Statistics getStatistics()
	{
		return null;
	}
	double ymax = Math.random();
	double m_tupleX[];
	double m_tupleY[];
	int m_entries;
	String m_name;
	protected final static int MAXSIZE = 10000;
}

 

Ads help maintain this website.