minmax
Functions
-
int main(int argc, char *argv[])
minmax [ option ] [ infile ]
-l int
length of vector \((1 \le M + 1)\)
-m int
order of vector \((0 \le M)\)
-b int
find \(N\)-best values \((1 \le N)\)
-o int
output format
0
minimum and maximum1
minimum2
maximum
-w int
way to find value
0
find value from a vector1
find value from vector sequence for each dimension
-p str
int-type positions
infile str
double-type data sequence
stdout
double-type minimum and maximum values
ramp -l 10 | minmax -l 5 -o 1 -w 0 | x2x +da # 0, 5
ramp -l 10 | minmax -l 5 -o 1 -w 1 | x2x +da # 0, 1, 2, 3, 4
- Parameters:
argc – [in] Number of arguments.
argv – [in] Argument vector.
- Returns:
0 on success, 1 on failure.
See also
-
class MinMaxAccumulation
Compute minimum and maximum given data sequence.
Public Functions
-
explicit MinMaxAccumulation(int num_best)
- Parameters:
num_best – [in] Number of minimum/maximum numbers.
-
inline int GetNumBest() const
- Returns:
Number of minimum/maximum numbers.
-
inline bool IsValid() const
- Returns:
True if this object is valid.
-
bool GetMinimum(int rank, const MinMaxAccumulation::Buffer &buffer, double *value, int *position) const
Get \(n\)-th minimum value and its position.
- Parameters:
rank – [in] Rank \(n\).
buffer – [in] Buffer.
value – [out] Minimum value.
position – [out] Position of the minimum value.
- Returns:
True on success, false on failure.
-
bool GetMaximum(int rank, const MinMaxAccumulation::Buffer &buffer, double *value, int *position) const
Get \(n\)-th maximum value and its position.
- Parameters:
rank – [in] Rank \(n\).
buffer – [in] Buffer.
value – [out] Maximum value.
position – [out] Position of the maximum value.
- Returns:
True on success, false on failure.
-
void Clear(MinMaxAccumulation::Buffer *buffer) const
Clear buffer.
- Parameters:
buffer – [out] Buffer.
-
bool Run(double data, MinMaxAccumulation::Buffer *buffer) const
Accumulate minimum and maximum.
- Parameters:
data – [in] Input data.
buffer – [inout] Buffer.
- Returns:
True on success, false on failure.
-
class Buffer
Buffer for MinMaxAccumulation.
-
explicit MinMaxAccumulation(int num_best)