casacore
Loading...
Searching...
No Matches
StatisticsIncrementer.h
Go to the documentation of this file.
1//# Copyright (C) 2000,2001
2//# Associated Universities, Inc. Washington DC, USA.
3//#
4//# This library is free software; you can redistribute it and/or modify it
5//# under the terms of the GNU Library General Public License as published by
6//# the Free Software Foundation; either version 2 of the License, or (at your
7//# option) any later version.
8//#
9//# This library is distributed in the hope that it will be useful, but WITHOUT
10//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12//# License for more details.
13//#
14//# You should have received a copy of the GNU Library General Public License
15//# along with this library; if not, write to the Free Software Foundation,
16//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17//#
18//# Correspondence concerning AIPS++ should be addressed as follows:
19//# Internet email: casa-feedback@nrao.edu.
20//# Postal address: AIPS++ Project Office
21//# National Radio Astronomy Observatory
22//# 520 Edgemont Road
23//# Charlottesville, VA 22903-2475 USA
24
25#ifndef SCIMATH_STATISTICSINCREMENTER_H
26#define SCIMATH_STATISTICSINCREMENTER_H
27
28#include <casacore/casa/aips.h>
29
30namespace casacore {
31
32// Utility functions used for incrementing pointers in a data set used by the
33// stats framework.
34
35template <
36 class DataIterator, class MaskIterator=const Bool *,
37 class WeightsIterator=DataIterator
39public:
40
42
44
45 //<group>
46 // <src>loopCount</src> is always incremented by one, independent of the
47 // value of <src>dataStride</src> and <src>maskStride</src>
48
49 inline static void increment(
50 DataIterator& datum, uInt64& loopCount, uInt dataStride
51 ) {
52 std::advance(datum, dataStride);
53 ++loopCount;
54 }
55
56 inline static void increment(
57 DataIterator& datum, uInt64& loopCount,
58 WeightsIterator& weight, uInt dataStride
59 ) {
60 std::advance(datum, dataStride);
61 std::advance(weight, dataStride);
62 ++loopCount;
63 }
64
65 inline static void increment(
66 DataIterator& datum, uInt64& loopCount, MaskIterator& mask,
67 uInt dataStride, uInt maskStride
68 ) {
69 std::advance(datum, dataStride);
70 std::advance(mask, maskStride);
71 ++loopCount;
72 }
73
74 inline static void increment(
75 DataIterator& datum, uInt64& loopCount, WeightsIterator& weight,
76 MaskIterator& mask, uInt dataStride, uInt maskStride
77 ) {
78 std::advance(datum, dataStride);
79 std::advance(weight, dataStride);
80 std::advance(mask, maskStride);
81 ++loopCount;
82 }
83 // </group>
84
85};
86
87}
88
89#endif
Utility functions used for incrementing pointers in a data set used by the stats framework.
static void increment(DataIterator &datum, uInt64 &loopCount, WeightsIterator &weight, MaskIterator &mask, uInt dataStride, uInt maskStride)
static void increment(DataIterator &datum, uInt64 &loopCount, uInt dataStride)
loopCount is always incremented by one, independent of the value of dataStride and maskStride
static void increment(DataIterator &datum, uInt64 &loopCount, WeightsIterator &weight, uInt dataStride)
static void increment(DataIterator &datum, uInt64 &loopCount, MaskIterator &mask, uInt dataStride, uInt maskStride)
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
unsigned long long uInt64
Definition aipsxtype.h:37