//
// List1DSet.java
//
/*
VisAD system for interactive analysis and visualization of numerical
data. Copyright (C) 1996 - 2017 Bill Hibbard, Curtis Rueden, Tom
Rink, Dave Glowacki, Steve Emmerson, Tom Whittaker, Don Murray, and
Tommy Jasmin.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA
*/
package visad;
/**
* List1DSet is the class for Set-s containing lists of
* 1-D values with no topology. This set does not support interpolation.
*/
public class List1DSet extends SimpleSet {
float[] data;
/**
* Constructs with a non-default CoordinateSystem.
*
* @param d The data samples. Must not be
* null.
* @param type The type of the set.
* @param coord_sys The coordinate system transformation. May be
* null.
* @param units The units of the values. May be
* null.
* @throws VisADException Couldn't create set.
*/
public List1DSet(float[] d, MathType type, CoordinateSystem coord_sys,
Unit[] units) throws VisADException {
super(type, coord_sys, units, null);
if (DomainDimension != 1) {
throw new SetException("List1DSet: type must be 1-D");
}
data = d;
Length = d.length;
}
public boolean isMissing() {
return (data == null);
}
/** convert an array of 1-D indices to an array of values in R^DomainDimension */
public float[][] indexToValue(int[] index) throws VisADException {
int length = index.length;
float[][] value = new float[1][length];
for (int i=0; i= Length) {
for (int k=0; k
Ads help maintain this website.