casa
$Rev:20696$
|
00001 //# NNGridder.h: Definition for Nearest Neighbour Gridder 00002 //# Copyright (C) 1996,1997,1999 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be adressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# 00027 //# $Id: NNGridder.h 21024 2011-03-01 11:46:18Z gervandiepen $ 00028 00029 #ifndef SCIMATH_NNGRIDDER_H 00030 #define SCIMATH_NNGRIDDER_H 00031 00032 #include <scimath/Mathematics/Gridder.h> 00033 00034 namespace casa { //# NAMESPACE CASA - BEGIN 00035 00036 // <summary> 00037 // A non-negative gridding class 00038 // </summary> 00039 00040 template <class Domain, class Range> 00041 class NNGridder : public Gridder<Domain, Range> 00042 { 00043 public: 00044 NNGridder(const IPosition& shape, const Vector<Domain>& scale, 00045 const Vector<Domain>& offset); 00046 00047 virtual ~NNGridder() {} 00048 00049 virtual Bool grid(Array<Range>& gridded, 00050 const Vector<Domain>& position, 00051 const Range& value); 00052 00053 virtual Bool degrid(const Array<Range>& gridded, 00054 const Vector<Domain>& position, 00055 Range& value); 00056 00057 protected: 00058 virtual Range correctionFactor1D(Int loc, Int len); 00059 00060 Vector<Int> loc; 00061 00062 protected: 00063 //# Make members of parent classes known. 00064 using Gridder<Domain,Range>::ndim; 00065 using Gridder<Domain,Range>::offsetVec; 00066 using Gridder<Domain,Range>::fillCorrectionVectors; 00067 using Gridder<Domain,Range>::onGrid; 00068 }; 00069 00070 } //# NAMESPACE CASA - END 00071 00072 #ifndef CASACORE_NO_AUTO_TEMPLATES 00073 #include <scimath/Mathematics/NNGridder.tcc> 00074 #endif //# CASACORE_NO_AUTO_TEMPLATES 00075 #endif