casacore
Loading...
Searching...
No Matches
CompositeNumber.h
Go to the documentation of this file.
1//# CompositeNumber.h: generate a composite number
2//# Copyright (C) 2000
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 CASA_COMPOSITENUMBER_H
27#define CASA_COMPOSITENUMBER_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Containers/Block.h>
32
33namespace casacore { //# NAMESPACE CASACORE - BEGIN
34
35// <summary> This class generates composite numbers </summary>
36// <use visibility=export>
37
38// <synopsis>
39// This class generates a list of composite numbers made up
40// of powers of 2, 3, and 5, which are less than
41// some max value and returns the smallest composite number greater
42// than some number given.
43// </synopsis>
44
45// <example>
46// <srcblock>
47// CompositeNumber cn(1000);
48// Int n = cn.nextLarger(319);
49// Int m = cn.nextSmaller(462);
50// Int l = cn.nearest(462);
51// </srcblock>
52// </example>
53
54
56{
57public:
58 // constructor:
59 // Note: if you later make a call with value > maxval, we
60 // will recalculate the list of composite numbers
61 CompositeNumber (const uInt maxval = 8192);
62
63 // destructor
65
66 // return the next larger composite number
68
69 // return the next smaller composite number
71
72 // return the nearest composite number
74
75 // return the next larger even composite number
77
78 // return the next smaller even composite number
80
81 // return the closest even composite number
83
84 // returns True is value is composite
86
87 private:
88
91
92 void generate(const uInt maxval);
93
94};
95
96
97} //# NAMESPACE CASACORE - END
98
99#endif
simple 1-D array
Definition Block.h:198
uInt nearest(const uInt value)
return the nearest composite number
uInt nextSmallerEven(const uInt value)
return the next smaller even composite number
void generate(const uInt maxval)
uInt nextLargerEven(const uInt value)
return the next larger even composite number
uInt nextLarger(const uInt value)
return the next larger composite number
uInt nearestEven(const uInt value)
return the closest even composite number
CompositeNumber(const uInt maxval=8192)
constructor: Note: if you later make a call with value > maxval, we will recalculate the list of comp...
Bool isComposite(const uInt value)
returns True is value is composite
uInt nextSmaller(const uInt value)
return the next smaller composite number
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.