Loading...
Searching...
No Matches
ArrayPartMath.h
Go to the documentation of this file.
//# ArrayPartMath.h: mathematics done on an array parts.
//# Copyright (C) 1993,1994,1995,1996,1998,1999,2001,2003
//# Associated Universities, Inc. Washington DC, USA.
//#
//# 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., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef CASA_ARRAYPARTMATH_2_H
#define CASA_ARRAYPARTMATH_2_H
#include "ArrayMath.h"
#include "ArrayMathBase.h"
#include <vector>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
// <summary>
// Mathematical and logical operations for Array parts.
// </summary>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tArray">
//
// <prerequisite>
// <li> <linkto class=Array>Array</linkto>
// </prerequisite>
//
// <etymology>
// This file contains global functions which perform part by part
// mathematical or logical operations on arrays.
// </etymology>
//
// <synopsis>
// These functions perform chunk by chunk mathematical operations on
// arrays.
// In particular boxed and sliding operations are possible. E.g. to calculate
// the median in sliding windows making it possible to subtract the background
// in an image.
//
// The operations to be performed are defined by means of functors that
// reduce an array subset to a scalar. Those functors are wrappers for
// ArrayMath and ArrayLogical functions like sum, median, and ntrue.
//
// The <src>partialXX</src> functions are a special case of the
// <src>BoxedArrayMath</src> function.
// They reduce one or more entire axes which can be done in a faster way than
// the more general <src>boxedArrayMath</src> function.
// </synopsis>
//
// <example>
// <srcblock>
// Array<double> data(...);
// Array<double> means = partialMeans (data, IPosition(2,0,1));
// </srcblock>
// This example calculates the mean of each plane in the data array.
// </example>
//
// <example>
// <srcblock>
// IPosition shp = data.shape();
// Array<double> means = boxedArrayMath (data, IPosition(2,shp[0],shp[1]),
// SumFunc<double>());
// </srcblock>
// does the same as the first example.
// Note that in this example the box is formed by the entire axes, but it
// could also be a subset of it to average, say, boxes of 5*5 elements.
// </example>
//
// <linkfrom anchor="Array mathematical operations" classes="Array Vector Matrix Cube">
// <here>Array mathematical operations</here> -- Mathematical operations for
// Arrays.
// </linkfrom>
//
// <group name="Array partial operations">
// Determine the sum, product, etc. for the given axes only.
// The result is an array with a shape formed by the remaining axes.
// For example, for an array with shape [3,4,5], collapsing axis 0
// results in an array with shape [4,5] containing, say, the sum for
// each X line.
// Summing for axes 0 and 2 results in an array with shape [4] containing,
// say, the sum for each XZ plane.
// <note>
// ArrayLogical.h contains the functions ntrue, nfalse, partialNTrue and
// partialNFalse to count the number of true or false elements in an array.
// </note>
// <group>
template<typename T> Array<T> partialSums (const Array<T>& array,
const IPosition& collapseAxes);
template<typename T> Array<T> partialSumSqrs (const Array<T>& array,
const IPosition& collapseAxes);
template<typename T> Array<T> partialProducts (const Array<T>& array,
const IPosition& collapseAxes);
template<typename T> Array<T> partialMins (const Array<T>& array,
const IPosition& collapseAxes);
template<typename T> Array<T> partialMaxs (const Array<T>& array,
const IPosition& collapseAxes);
template<typename T> Array<T> partialMeans (const Array<T>& array,
const IPosition& collapseAxes);
template<typename T>
inline Array<T> partialVariances (const Array<T>& array,
const IPosition& collapseAxes, size_t ddof=1)
{
return partialVariances (array, collapseAxes,
partialMeans (array, collapseAxes), ddof);
}
template<typename T> Array<T> partialVariances (const Array<T>& array,
const IPosition& collapseAxes, const Array<T>& means);
template<typename T> Array<T> partialVariances (const Array<T>& array,
const IPosition& collapseAxes, const Array<T>& means, size_t ddof);
template<typename T> Array<std::complex<T>> partialVariances (const Array<std::complex<T>>& array,
const IPosition& collapseAxes,
const Array<std::complex<T>>& means,
size_t ddof);
template<typename T> inline Array<T> partialStddevs (const Array<T>& array,
const IPosition& collapseAxes,
size_t ddof=1)
{
return sqrt (partialVariances (array, collapseAxes,
partialMeans (array, collapseAxes), ddof));
}
template<typename T> inline Array<T> partialStddevs (const Array<T>& array,
const IPosition& collapseAxes,
const Array<T>& means,
size_t ddof=1)
{
return sqrt (partialVariances (array, collapseAxes, means, ddof));
}
template<typename T> inline Array<T> partialAvdevs (const Array<T>& array,
const IPosition& collapseAxes)
{
return partialAvdevs (array, collapseAxes,
partialMeans (array, collapseAxes));
}
template<typename T> Array<T> partialAvdevs (const Array<T>& array,
const IPosition& collapseAxes,
const Array<T>& means);
template<typename T> Array<T> partialRmss (const Array<T>& array,
const IPosition& collapseAxes);
template<typename T> Array<T> partialMedians (const Array<T>& array,
const IPosition& collapseAxes,
bool takeEvenMean=false,
bool inPlace=false);
template<typename T> Array<T> partialMadfms (const Array<T>& array,
const IPosition& collapseAxes,
bool takeEvenMean=false,
bool inPlace=false);
template<typename T> Array<T> partialFractiles (const Array<T>& array,
const IPosition& collapseAxes,
float fraction,
bool inPlace=false);
template<typename T> Array<T> partialInterFractileRanges (const Array<T>& array,
const IPosition& collapseAxes,
float fraction,
bool inPlace=false);
template<typename T> Array<T> partialInterHexileRanges (const Array<T>& array,
const IPosition& collapseAxes,
bool inPlace=false)
{ return partialInterFractileRanges (array, collapseAxes, 1./6., inPlace); }
template<typename T> Array<T> partialInterQuartileRanges (const Array<T>& array,
const IPosition& collapseAxes,
bool inPlace=false)
{ return partialInterFractileRanges (array, collapseAxes, 0.25, inPlace); }
// </group>
// Define functors to perform a reduction function on an Array object.
// Use virtual functions instead of templates to avoid code bloat
// in partialArrayMath, etc.
template<typename T> class SumFunc : public ArrayFunctorBase<T> {
public:
virtual ~SumFunc() {}
virtual T operator() (const Array<T>& arr) const final override { return sum(arr); }
};
template<typename T> class SumSqrFunc : public ArrayFunctorBase<T> {
public:
virtual ~SumSqrFunc() {}
virtual T operator() (const Array<T>& arr) const final override { return sumsqr(arr); }
};
template<typename T> class ProductFunc : public ArrayFunctorBase<T> {
public:
virtual ~ProductFunc() {}
virtual T operator() (const Array<T>& arr) const final override { return product(arr); }
};
template<typename T> class MinFunc : public ArrayFunctorBase<T> {
public:
virtual ~MinFunc() {}
virtual T operator() (const Array<T>& arr) const final override { return min(arr); }
};
template<typename T> class MaxFunc : public ArrayFunctorBase<T> {
public:
virtual ~MaxFunc() {}
virtual T operator() (const Array<T>& arr) const final override { return max(arr); }
};
template<typename T> class MeanFunc : public ArrayFunctorBase<T> {
public:
virtual ~MeanFunc() {}
virtual T operator() (const Array<T>& arr) const final override { return mean(arr); }
};
template<typename T> class VarianceFunc : public ArrayFunctorBase<T> {
public:
explicit VarianceFunc (size_t ddof)
: itsDdof(ddof) {}
virtual ~VarianceFunc() {}
virtual T operator() (const Array<T>& arr) const final override { return pvariance(arr, itsDdof); }
private:
size_t itsDdof;
};
template<typename T> class StddevFunc : public ArrayFunctorBase<T> {
public:
explicit StddevFunc (size_t ddof)
: itsDdof(ddof) {}
virtual ~StddevFunc() {}
virtual T operator() (const Array<T>& arr) const final override { return pstddev(arr, itsDdof); }
private:
size_t itsDdof;
};
template<typename T> class AvdevFunc : public ArrayFunctorBase<T> {
public:
virtual ~AvdevFunc() {}
virtual T operator() (const Array<T>& arr) const final override { return avdev(arr); }
};
template<typename T> class RmsFunc : public ArrayFunctorBase<T> {
public:
virtual ~RmsFunc() {}
virtual T operator() (const Array<T>& arr) const final override { return rms(arr); }
};
template<typename T> class MedianFunc : public ArrayFunctorBase<T> {
public:
explicit MedianFunc (bool sorted=false, bool takeEvenMean=true,
bool inPlace = false)
: itsSorted(sorted), itsTakeEvenMean(takeEvenMean), itsInPlace(inPlace) {}
virtual ~MedianFunc() {}
virtual T operator() (const Array<T>& arr) const final override
{ return median(arr, itsTmp, itsSorted, itsTakeEvenMean, itsInPlace); }
private:
bool itsSorted;
bool itsTakeEvenMean;
bool itsInPlace;
mutable std::vector<T> itsTmp;
};
template<typename T> class MadfmFunc : public ArrayFunctorBase<T> {
public:
explicit MadfmFunc(bool sorted = false, bool takeEvenMean = true,
bool inPlace = false)
: itsSorted(sorted), itsTakeEvenMean(takeEvenMean), itsInPlace(inPlace) {}
virtual ~MadfmFunc() {}
virtual T operator()(const Array<T>& arr) const final override
{ return madfm(arr, itsTmp, itsSorted, itsTakeEvenMean, itsInPlace); }
private:
bool itsSorted;
bool itsTakeEvenMean;
bool itsInPlace;
mutable std::vector<T> itsTmp;
};
template<typename T> class FractileFunc : public ArrayFunctorBase<T> {
public:
explicit FractileFunc (float fraction,
bool sorted = false, bool inPlace = false)
: itsFraction(fraction), itsSorted(sorted), itsInPlace(inPlace) {}
virtual ~FractileFunc() {}
virtual T operator() (const Array<T>& arr) const final override
{ return fractile(arr, itsTmp, itsFraction, itsSorted, itsInPlace); }
private:
float itsFraction;
bool itsSorted;
bool itsInPlace;
mutable std::vector<T> itsTmp;
};
template<typename T> class InterFractileRangeFunc {
public:
explicit InterFractileRangeFunc(float fraction,
bool sorted = false, bool inPlace = false)
: itsFraction(fraction), itsSorted(sorted), itsInPlace(inPlace) {}
virtual ~InterFractileRangeFunc() {}
virtual T operator()(const Array<T>& arr) const final override
{ return interFractileRange(arr, itsTmp, itsFraction,
itsSorted, itsInPlace); }
private:
float itsFraction;
bool itsSorted;
bool itsInPlace;
mutable std::vector<T> itsTmp;
};
template<typename T> class InterHexileRangeFunc: public InterFractileRangeFunc<T> {
public:
explicit InterHexileRangeFunc(bool sorted = false, bool inPlace = false)
: InterFractileRangeFunc<T> (1./6., sorted, inPlace)
{}
virtual ~InterHexileRangeFunc() {}
};
template<typename T> class InterQuartileRangeFunc: public InterFractileRangeFunc<T> {
public:
explicit InterQuartileRangeFunc(bool sorted = false, bool inPlace = false)
: InterFractileRangeFunc<T> (0.25, sorted, inPlace)
{}
virtual ~InterQuartileRangeFunc() {}
};
// Do partial reduction of an Array object. I.e., perform the operation
// on a subset of the array axes (the collapse axes).
template<typename T>
inline Array<T> partialArrayMath (const Array<T>& a,
const IPosition& collapseAxes,
const ArrayFunctorBase<T>& funcObj)
{
Array<T> res;
partialArrayMath (res, a, collapseAxes, funcObj);
return res;
}
template<typename T, typename RES>
void partialArrayMath (Array<RES>& res,
const Array<T>& a,
const IPosition& collapseAxes,
const ArrayFunctorBase<T,RES>& funcObj);
// Apply the given ArrayMath reduction function objects
// to each box in the array.
// <example>
// Downsample an array by taking the median of every [25,25] elements.
// <srcblock>
// Array<float> downArr = boxedArrayMath(in, IPosition(2,25,25),
// MedianFunc<float>());
// </srcblock>
// </example>
// The dimensionality of the array can be larger than the box; in that
// case the missing axes of the box are assumed to have length 1.
// A box axis length <= 0 means the full array axis.
template<typename T>
inline Array<T> boxedArrayMath (const Array<T>& a,
const IPosition& boxSize,
const ArrayFunctorBase<T>& funcObj)
{
Array<T> res;
boxedArrayMath (res, a, boxSize, funcObj);
return res;
}
template<typename T, typename RES>
void boxedArrayMath (Array<RES>&,
const Array<T>& array,
const IPosition& boxSize,
const ArrayFunctorBase<T,RES>& funcObj);
// Apply for each element in the array the given ArrayMath reduction function
// object to the box around that element. The full box is 2*halfBoxSize + 1.
// It can be used for arrays and boxes of any dimensionality; missing
// halfBoxSize values are set to 0.
// <example>
// Determine for each element in the array the median of a box
// with size [51,51] around that element:
// <srcblock>
// Array<float> medians = slidingArrayMath(in, IPosition(2,25,25),
// MedianFunc<float>());
// </srcblock>
// This is a potentially expensive operation. On a high-end PC it took
// appr. 27 seconds to get the medians for an array of [1000,1000] using
// a halfBoxSize of [50,50].
// </example>
// <br>The fillEdge argument determines how the edge is filled where
// no full boxes can be made. true means it is set to zero; false means
// that the edge is removed, thus the output array is smaller than the
// input array.
// <note> This brute-force method of determining the medians outperforms
// all kinds of smart implementations. For a vector it is about as fast
// as casacore class MedianSlider, for a 2D array
// it is much, much faster.
// </note>
template<typename T>
inline Array<T> slidingArrayMath (const Array<T>& a,
const IPosition& halfBoxSize,
const ArrayFunctorBase<T>& funcObj,
bool fillEdge=true)
{
Array<T> res;
slidingArrayMath (res, a, halfBoxSize, funcObj, fillEdge);
return res;
}
template<typename T, typename RES>
void slidingArrayMath (Array<RES>& res,
const Array<T>& array,
const IPosition& halfBoxSize,
const ArrayFunctorBase<T,RES>& funcObj,
bool fillEdge=true);
// </group>
// <group>
// Helper functions for boxed and sliding functions.
// Determine full box shape and shape of result for a boxed operation.
void fillBoxedShape (const IPosition& shape, const IPosition& boxShape,
IPosition& fullBoxShape, IPosition& resultShape);
// Determine the box end and shape of result for a sliding operation.
// It returns false if the result is empty.
bool fillSlidingShape (const IPosition& shape, const IPosition& halfBoxSize,
IPosition& boxEnd, IPosition& resultShape);
// </group>
} //# NAMESPACE CASACORE - END
#include "ArrayPartMath.tcc"
#endif
ArrayMathBase.h
ArrayMath.h
casacore::ArrayFunctorBase
Definition ArrayMathBase.h:51
casacore::ArrayPartMath_global_functions_Array_partial_operations::AvdevFunc
Definition ArrayPartMath.h:237
casacore::ArrayPartMath_global_functions_Array_partial_operations::AvdevFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:240
casacore::ArrayPartMath_global_functions_Array_partial_operations::AvdevFunc::~AvdevFunc
virtual ~AvdevFunc()
Definition ArrayPartMath.h:239
casacore::ArrayPartMath_global_functions_Array_partial_operations::FractileFunc::itsSorted
bool itsSorted
Definition ArrayPartMath.h:285
casacore::ArrayPartMath_global_functions_Array_partial_operations::FractileFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:281
casacore::ArrayPartMath_global_functions_Array_partial_operations::FractileFunc::itsFraction
float itsFraction
Definition ArrayPartMath.h:284
casacore::ArrayPartMath_global_functions_Array_partial_operations::FractileFunc::itsTmp
std::vector< T > itsTmp
Definition ArrayPartMath.h:287
casacore::ArrayPartMath_global_functions_Array_partial_operations::FractileFunc::FractileFunc
FractileFunc(float fraction, bool sorted=false, bool inPlace=false)
Definition ArrayPartMath.h:277
casacore::ArrayPartMath_global_functions_Array_partial_operations::FractileFunc::~FractileFunc
virtual ~FractileFunc()
Definition ArrayPartMath.h:280
casacore::ArrayPartMath_global_functions_Array_partial_operations::FractileFunc::itsInPlace
bool itsInPlace
Definition ArrayPartMath.h:286
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterFractileRangeFunc::itsSorted
bool itsSorted
Definition ArrayPartMath.h:300
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterFractileRangeFunc::InterFractileRangeFunc
InterFractileRangeFunc(float fraction, bool sorted=false, bool inPlace=false)
Definition ArrayPartMath.h:291
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterFractileRangeFunc::itsFraction
float itsFraction
Definition ArrayPartMath.h:299
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterFractileRangeFunc::~InterFractileRangeFunc
virtual ~InterFractileRangeFunc()
Definition ArrayPartMath.h:294
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterFractileRangeFunc::itsTmp
std::vector< T > itsTmp
Definition ArrayPartMath.h:302
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterFractileRangeFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:295
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterFractileRangeFunc::itsInPlace
bool itsInPlace
Definition ArrayPartMath.h:301
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterHexileRangeFunc::~InterHexileRangeFunc
virtual ~InterHexileRangeFunc()
Definition ArrayPartMath.h:309
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterHexileRangeFunc::InterHexileRangeFunc
InterHexileRangeFunc(bool sorted=false, bool inPlace=false)
Definition ArrayPartMath.h:306
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterQuartileRangeFunc::InterQuartileRangeFunc
InterQuartileRangeFunc(bool sorted=false, bool inPlace=false)
Definition ArrayPartMath.h:313
casacore::ArrayPartMath_global_functions_Array_partial_operations::InterQuartileRangeFunc::~InterQuartileRangeFunc
virtual ~InterQuartileRangeFunc()
Definition ArrayPartMath.h:316
casacore::ArrayPartMath_global_functions_Array_partial_operations::MadfmFunc::itsTakeEvenMean
bool itsTakeEvenMean
Definition ArrayPartMath.h:271
casacore::ArrayPartMath_global_functions_Array_partial_operations::MadfmFunc::itsInPlace
bool itsInPlace
Definition ArrayPartMath.h:272
casacore::ArrayPartMath_global_functions_Array_partial_operations::MadfmFunc::~MadfmFunc
virtual ~MadfmFunc()
Definition ArrayPartMath.h:266
casacore::ArrayPartMath_global_functions_Array_partial_operations::MadfmFunc::MadfmFunc
MadfmFunc(bool sorted=false, bool takeEvenMean=true, bool inPlace=false)
Definition ArrayPartMath.h:263
casacore::ArrayPartMath_global_functions_Array_partial_operations::MadfmFunc::itsTmp
std::vector< T > itsTmp
Definition ArrayPartMath.h:273
casacore::ArrayPartMath_global_functions_Array_partial_operations::MadfmFunc::itsSorted
bool itsSorted
Definition ArrayPartMath.h:270
casacore::ArrayPartMath_global_functions_Array_partial_operations::MadfmFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:267
casacore::ArrayPartMath_global_functions_Array_partial_operations::MaxFunc
Definition ArrayPartMath.h:209
casacore::ArrayPartMath_global_functions_Array_partial_operations::MaxFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:212
casacore::ArrayPartMath_global_functions_Array_partial_operations::MaxFunc::~MaxFunc
virtual ~MaxFunc()
Definition ArrayPartMath.h:211
casacore::ArrayPartMath_global_functions_Array_partial_operations::MeanFunc
Definition ArrayPartMath.h:214
casacore::ArrayPartMath_global_functions_Array_partial_operations::MeanFunc::~MeanFunc
virtual ~MeanFunc()
Definition ArrayPartMath.h:216
casacore::ArrayPartMath_global_functions_Array_partial_operations::MeanFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:217
casacore::ArrayPartMath_global_functions_Array_partial_operations::MedianFunc::MedianFunc
MedianFunc(bool sorted=false, bool takeEvenMean=true, bool inPlace=false)
Definition ArrayPartMath.h:249
casacore::ArrayPartMath_global_functions_Array_partial_operations::MedianFunc::itsTmp
std::vector< T > itsTmp
Definition ArrayPartMath.h:259
casacore::ArrayPartMath_global_functions_Array_partial_operations::MedianFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:253
casacore::ArrayPartMath_global_functions_Array_partial_operations::MedianFunc::~MedianFunc
virtual ~MedianFunc()
Definition ArrayPartMath.h:252
casacore::ArrayPartMath_global_functions_Array_partial_operations::MedianFunc::itsSorted
bool itsSorted
Definition ArrayPartMath.h:256
casacore::ArrayPartMath_global_functions_Array_partial_operations::MedianFunc::itsTakeEvenMean
bool itsTakeEvenMean
Definition ArrayPartMath.h:257
casacore::ArrayPartMath_global_functions_Array_partial_operations::MedianFunc::itsInPlace
bool itsInPlace
Definition ArrayPartMath.h:258
casacore::ArrayPartMath_global_functions_Array_partial_operations::MinFunc
Definition ArrayPartMath.h:204
casacore::ArrayPartMath_global_functions_Array_partial_operations::MinFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:207
casacore::ArrayPartMath_global_functions_Array_partial_operations::MinFunc::~MinFunc
virtual ~MinFunc()
Definition ArrayPartMath.h:206
casacore::ArrayPartMath_global_functions_Array_partial_operations::ProductFunc
Definition ArrayPartMath.h:199
casacore::ArrayPartMath_global_functions_Array_partial_operations::ProductFunc::~ProductFunc
virtual ~ProductFunc()
Definition ArrayPartMath.h:201
casacore::ArrayPartMath_global_functions_Array_partial_operations::ProductFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:202
casacore::ArrayPartMath_global_functions_Array_partial_operations::RmsFunc
Definition ArrayPartMath.h:242
casacore::ArrayPartMath_global_functions_Array_partial_operations::RmsFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:245
casacore::ArrayPartMath_global_functions_Array_partial_operations::RmsFunc::~RmsFunc
virtual ~RmsFunc()
Definition ArrayPartMath.h:244
casacore::ArrayPartMath_global_functions_Array_partial_operations::StddevFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:233
casacore::ArrayPartMath_global_functions_Array_partial_operations::StddevFunc::itsDdof
size_t itsDdof
Definition ArrayPartMath.h:235
casacore::ArrayPartMath_global_functions_Array_partial_operations::StddevFunc::StddevFunc
StddevFunc(size_t ddof)
Definition ArrayPartMath.h:230
casacore::ArrayPartMath_global_functions_Array_partial_operations::StddevFunc::~StddevFunc
virtual ~StddevFunc()
Definition ArrayPartMath.h:232
casacore::ArrayPartMath_global_functions_Array_partial_operations::SumFunc
Define functors to perform a reduction function on an Array object.
Definition ArrayPartMath.h:189
casacore::ArrayPartMath_global_functions_Array_partial_operations::SumFunc::~SumFunc
virtual ~SumFunc()
Definition ArrayPartMath.h:191
casacore::ArrayPartMath_global_functions_Array_partial_operations::SumFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:192
casacore::ArrayPartMath_global_functions_Array_partial_operations::SumSqrFunc
Definition ArrayPartMath.h:194
casacore::ArrayPartMath_global_functions_Array_partial_operations::SumSqrFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:197
casacore::ArrayPartMath_global_functions_Array_partial_operations::SumSqrFunc::~SumSqrFunc
virtual ~SumSqrFunc()
Definition ArrayPartMath.h:196
casacore::ArrayPartMath_global_functions_Array_partial_operations::VarianceFunc::itsDdof
size_t itsDdof
Definition ArrayPartMath.h:226
casacore::ArrayPartMath_global_functions_Array_partial_operations::VarianceFunc::operator()
virtual T operator()(const Array< T > &arr) const final override
Definition ArrayPartMath.h:224
casacore::ArrayPartMath_global_functions_Array_partial_operations::VarianceFunc::VarianceFunc
VarianceFunc(size_t ddof)
Definition ArrayPartMath.h:221
casacore::ArrayPartMath_global_functions_Array_partial_operations::VarianceFunc::~VarianceFunc
virtual ~VarianceFunc()
Definition ArrayPartMath.h:223
casacore::Array
Definition Array.h:155
casacore::IPosition
Definition IPosition.h:117
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::fractile
LatticeExprNode fractile(const LatticeExprNode &expr, const LatticeExprNode &fraction)
Determine the value of the element at the part fraction from the beginning of the given lattice.
casacore::means
TableExprNode means(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition ExprNode.h:1746
casacore::mean
LatticeExprNode mean(const LatticeExprNode &expr)
casacore::boxedArrayMath
MaskedArray< T > boxedArrayMath(const MaskedArray< T > &array, const IPosition &boxSize, const FuncType &funcObj)
Apply the given ArrayMath reduction function objects to each box in the array.
casacore::max
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
casacore::sum
LatticeExprNode sum(const LatticeExprNode &expr)
casacore::array
TYPE * array
the allocated array
Definition hdu.h:491
casacore::min
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
casacore::sqrt
LatticeExprNode sqrt(const LatticeExprNode &expr)
casacore::shape
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
casacore::product
T product(const TableVector< T > &tv)
Definition TabVecMath.h:383
casacore::avdev
LatticeExprNode avdev(const LatticeExprNode &expr)
casacore::fillSlidingShape
bool fillSlidingShape(const IPosition &shape, const IPosition &halfBoxSize, IPosition &boxEnd, IPosition &resultShape)
Determine the box end and shape of result for a sliding operation.
casacore::median
LatticeExprNode median(const LatticeExprNode &expr)
casacore::slidingArrayMath
Array< T > slidingArrayMath(const MaskedArray< T > &array, const IPosition &halfBoxSize, const FuncType &funcObj, bool fillEdge=true)
Apply for each element in the array the given ArrayMath reduction function object to the box around t...
casacore::fillBoxedShape
void fillBoxedShape(const IPosition &shape, const IPosition &boxShape, IPosition &fullBoxShape, IPosition &resultShape)
Helper functions for boxed and sliding functions.
casacore::rms
TableExprNode rms(const TableExprNode &array)
Definition ExprNode.h:1684
casacore::ArrayPartMath_global_functions_Array_partial_operations
Definition ArrayPartMath.h:92
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialAvdevs
Array< T > partialAvdevs(const Array< T > &array, const IPosition &collapseAxes, const Array< T > &means)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialMedians
Array< T > partialMedians(const Array< T > &array, const IPosition &collapseAxes, bool takeEvenMean=false, bool inPlace=false)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialRmss
Array< T > partialRmss(const Array< T > &array, const IPosition &collapseAxes)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialStddevs
Array< T > partialStddevs(const Array< T > &array, const IPosition &collapseAxes, const Array< T > &means, size_t ddof=1)
Definition ArrayPartMath.h:140
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialVariances
Array< T > partialVariances(const Array< T > &array, const IPosition &collapseAxes, const Array< T > &means, size_t ddof)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialProducts
Array< T > partialProducts(const Array< T > &array, const IPosition &collapseAxes)
casacore::ArrayPartMath_global_functions_Array_partial_operations::slidingArrayMath
Array< T > slidingArrayMath(const Array< T > &a, const IPosition &halfBoxSize, const ArrayFunctorBase< T > &funcObj, bool fillEdge=true)
Apply for each element in the array the given ArrayMath reduction function object to the box around t...
Definition ArrayPartMath.h:391
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialVariances
Array< T > partialVariances(const Array< T > &array, const IPosition &collapseAxes, const Array< T > &means)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialInterQuartileRanges
Array< T > partialInterQuartileRanges(const Array< T > &array, const IPosition &collapseAxes, bool inPlace=false)
Definition ArrayPartMath.h:178
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialMins
Array< T > partialMins(const Array< T > &array, const IPosition &collapseAxes)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialStddevs
Array< T > partialStddevs(const Array< T > &array, const IPosition &collapseAxes, size_t ddof=1)
Definition ArrayPartMath.h:133
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialAvdevs
Array< T > partialAvdevs(const Array< T > &array, const IPosition &collapseAxes)
Definition ArrayPartMath.h:147
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialInterHexileRanges
Array< T > partialInterHexileRanges(const Array< T > &array, const IPosition &collapseAxes, bool inPlace=false)
Definition ArrayPartMath.h:174
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialInterFractileRanges
Array< T > partialInterFractileRanges(const Array< T > &array, const IPosition &collapseAxes, float fraction, bool inPlace=false)
casacore::ArrayPartMath_global_functions_Array_partial_operations::boxedArrayMath
Array< T > boxedArrayMath(const Array< T > &a, const IPosition &boxSize, const ArrayFunctorBase< T > &funcObj)
Apply the given ArrayMath reduction function objects to each box in the array.
Definition ArrayPartMath.h:352
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialFractiles
Array< T > partialFractiles(const Array< T > &array, const IPosition &collapseAxes, float fraction, bool inPlace=false)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialArrayMath
Array< T > partialArrayMath(const Array< T > &a, const IPosition &collapseAxes, const ArrayFunctorBase< T > &funcObj)
Do partial reduction of an Array object.
Definition ArrayPartMath.h:324
casacore::ArrayPartMath_global_functions_Array_partial_operations::boxedArrayMath
void boxedArrayMath(Array< RES > &, const Array< T > &array, const IPosition &boxSize, const ArrayFunctorBase< T, RES > &funcObj)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialVariances
Array< T > partialVariances(const Array< T > &array, const IPosition &collapseAxes, size_t ddof=1)
Definition ArrayPartMath.h:119
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialVariances
Array< std::complex< T > > partialVariances(const Array< std::complex< T > > &array, const IPosition &collapseAxes, const Array< std::complex< T > > &means, size_t ddof)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialMeans
Array< T > partialMeans(const Array< T > &array, const IPosition &collapseAxes)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialMaxs
Array< T > partialMaxs(const Array< T > &array, const IPosition &collapseAxes)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialArrayMath
void partialArrayMath(Array< RES > &res, const Array< T > &a, const IPosition &collapseAxes, const ArrayFunctorBase< T, RES > &funcObj)
casacore::ArrayPartMath_global_functions_Array_partial_operations::slidingArrayMath
void slidingArrayMath(Array< RES > &res, const Array< T > &array, const IPosition &halfBoxSize, const ArrayFunctorBase< T, RES > &funcObj, bool fillEdge=true)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialMadfms
Array< T > partialMadfms(const Array< T > &array, const IPosition &collapseAxes, bool takeEvenMean=false, bool inPlace=false)
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialSums
Array< T > partialSums(const Array< T > &array, const IPosition &collapseAxes)
Determine the sum, product, etc.
casacore::ArrayPartMath_global_functions_Array_partial_operations::partialSumSqrs
Array< T > partialSumSqrs(const Array< T > &array, const IPosition &collapseAxes)