casacore
Loading...
Searching...
No Matches
NNGridder.h
Go to the documentation of this file.
1// # NNGridder.h: Definition for Nearest Neighbour Gridder
2// # Copyright (C) 1996,1997,1999
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef SCIMATH_NNGRIDDER_H
27#define SCIMATH_NNGRIDDER_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/scimath/Mathematics/Gridder.h>
31
32namespace casacore { // # NAMESPACE CASACORE - BEGIN
33
34// <summary>
35// A non-negative gridding class
36// </summary>
37
38template <class Domain, class Range>
39class NNGridder : public Gridder<Domain, Range> {
40 public:
42
43 virtual ~NNGridder() {}
44
45 virtual Bool grid(Array<Range>& gridded, const Vector<Domain>& position, const Range& value);
46
47 virtual Bool degrid(const Array<Range>& gridded, const Vector<Domain>& position, Range& value);
48
49 protected:
50 virtual Range correctionFactor1D(Int loc, Int len);
51
53
54 protected:
55 // # Make members of parent classes known.
56 using Gridder<Domain, Range>::ndim;
57 using Gridder<Domain, Range>::offsetVec;
58 using Gridder<Domain, Range>::fillCorrectionVectors;
59 using Gridder<Domain, Range>::onGrid;
60};
61
62} // namespace casacore
63
64#ifndef CASACORE_NO_AUTO_TEMPLATES
65#include <casacore/scimath/Mathematics/NNGridder.tcc>
66#endif // # CASACORE_NO_AUTO_TEMPLATES
67#endif
Vector< Domain > scale
Definition Gridder.h:86
virtual Bool onGrid(const Vector< Int > &loc)
virtual void fillCorrectionVectors()
IPosition shape
Definition Gridder.h:84
Vector< Domain > offset
Definition Gridder.h:87
Vector< Domain > & position(Vector< Domain > &gpos, const Vector< Domain > &pos)
Vector< Int > offsetVec
Definition Gridder.h:94
virtual ~NNGridder()
Definition NNGridder.h:43
NNGridder(const IPosition &shape, const Vector< Domain > &scale, const Vector< Domain > &offset)
virtual Bool degrid(const Array< Range > &gridded, const Vector< Domain > &position, Range &value)
Vector< Int > loc
Definition NNGridder.h:52
virtual Bool grid(Array< Range > &gridded, const Vector< Domain > &position, const Range &value)
virtual Range correctionFactor1D(Int loc, Int len)
Correction factor for 1 dimension.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
NewDelAllocator< T > NewDelAllocator< T >::value
Definition Allocator.h:360