Discontinuous Galerkin Library
#include "dg/algorithm.h"
|
Compute (lower) Median of input numbers. More...
Public Member Functions | |
template<class real_type > | |
DG_DEVICE void | operator() (unsigned i, const int *row_offsets, const int *column_indices, const real_type *values, const real_type *x, real_type *y) |
Compute (lower) Median of input numbers.
The (lower) median of N numbers is the N/2 (rounded up) largest number. Another definition is implicit \( \text{Median}(x) := \{ m : \sum_i \text{sgn}(x_i - m) = 0\} \) The Median is taken over all points contained in the stencil given by the row and column indices. The matrix values are ignored.
|
inline |