uk.ac.starlink.ast
Class PermMap

java.lang.Object
  extended by uk.ac.starlink.ast.AstObject
      extended by uk.ac.starlink.ast.Mapping
          extended by uk.ac.starlink.ast.PermMap

public class PermMap
extends Mapping

Java interface to the AST PermMap class - coordinate permutation Mapping. A PermMap is a Mapping which permutes the order of coordinates, and possibly also changes the number of coordinates, between its input and output.

In addition to permuting the coordinate order, a PermMap may also assign constant values to coordinates. This is useful when the number of coordinates is being increased as it allows fixed values to be assigned to any new ones.

Licence

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Licence as published by the Free Software Foundation; either version 2 of the Licence, or (at your option) any later version.

This program 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 General Public Licence for more details.

You should have received a copy of the GNU General Public Licence along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,Fifth Floor, Boston, MA 02110-1301, USA

See Also:
AST PermMap

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.starlink.ast.Mapping
Mapping.Interpolator, Mapping.Spreader
 
Field Summary
 
Fields inherited from class uk.ac.starlink.ast.Mapping
LINEAR_INTERPOLATOR, LINEAR_SPREADER, NEAREST_INTERPOLATOR, NEAREST_SPREADER
 
Fields inherited from class uk.ac.starlink.ast.AstObject
AST__BAD, AST__TUNULL, pointer
 
Constructor Summary
PermMap(int nin, int[] inperm, int nout, int[] outperm, double[] constant)
          Creates a PermMap.
 
Method Summary
 
Methods inherited from class uk.ac.starlink.ast.Mapping
decompose, getInvert, getNin, getNout, getReport, getTranForward, getTranInverse, invert, linearApprox, mapBox, mapSplit, rate, rebin, rebinD, rebinF, rebinI, resample, resampleB, resampleD, resampleF, resampleI, resampleL, resampleS, setInvert, setReport, simplify, tran1, tran2, tranGrid, tranN, tranP
 
Methods inherited from class uk.ac.starlink.ast.AstObject
annul, clear, copy, delete, equals, finalize, getAstConstantI, getB, getC, getD, getF, getI, getID, getIdent, getL, getNobject, getObjSize, getRefCount, hashCode, isThreaded, reportVersions, sameObject, set, setB, setC, setD, setF, setI, setID, setIdent, setL, show, test, tune
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermMap

public PermMap(int nin,
               int[] inperm,
               int nout,
               int[] outperm,
               double[] constant)
Creates a PermMap.

Parameters:
nin - The number of input coordinates.
inperm - An optional array with "nin" elements which, for each input coordinate, should contain the number of the output coordinate whose value is to be used (note that this array therefore defines the inverse coordinate transformation). Coordinates are numbered starting from 1.

For details of additional special values that may be used in this array, see the description of the "constant" parameter.

If a NULL pointer is supplied instead of an array, each input coordinate will obtain its value from the corresponding output coordinate (or will be assigned the value AST__BAD if there is no corresponding output coordinate).

nout - The number of output coordinates.
outperm - An optional array with "nout" elements which, for each output coordinate, should contain the number of the input coordinate whose value is to be used (note that this array therefore defines the forward coordinate transformation). Coordinates are numbered starting from 1.

For details of additional special values that may be used in this array, see the description of the "constant" parameter.

If a NULL pointer is supplied instead of an array, each output coordinate will obtain its value from the corresponding input coordinate (or will be assigned the value AST__BAD if there is no corresponding input coordinate).

constant - An optional array containing values which may be assigned to input and/or output coordinates instead of deriving them from other coordinate values. If either of the "inperm" or "outperm" arrays contains a negative value, it is used to address this "constant" array (such that -1 addresses the first element, -2 addresses the second element, etc.) and the value obtained is used as the corresponding coordinate value.

Care should be taken to ensure that locations lying outside the extent of this array are not accidentally addressed. The array is not used if the "inperm" and "outperm" arrays do not contain negative values.

If a NULL pointer is supplied instead of an array, the behaviour is as if the array were of infinite length and filled with the value AST__BAD.

Throws:
AstException - if an error occurred in the AST library


Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.