1 #ifndef __JTOOLS__JQUANTILE__
2 #define __JTOOLS__JQUANTILE__
23 namespace JPP {
using namespace JTOOLS; }
61 min = +std::numeric_limits<double>::max();
62 max = -std::numeric_limits<double>::max();
109 template<
class iterator_type>
111 iterator_type __begin,
114 const double w = 1.0) :
117 put(__begin, __end,
w);
132 template<
class iterator_type,
class value_type,
class result_type>
134 iterator_type __begin,
136 result_type value_type::*member,
138 const double w = 1.0) :
141 put(__begin, __end, member,
w);
156 template<
class iterator_type,
class value_type,
class result_type>
158 iterator_type __begin,
160 result_type (value_type::*
function)()
const,
162 const double w = 1.0) :
165 put(__begin, __end,
function,
w);
198 void put(
const double x,
const double w = 1.0)
208 buffer.insert(std::make_pair(x,
w));
220 template<
class iterator_type>
221 void put(iterator_type __begin,
223 const double w = 1.0)
225 for (iterator_type i = __begin; i != __end; ++i) {
239 template<
class iterator_type,
class value_type,
class result_type>
240 void put(iterator_type __begin,
242 result_type value_type::*member,
243 const double w = 1.0)
245 for (iterator_type i = __begin; i != __end; ++i) {
246 put((*i).*member,
w);
259 template<
class iterator_type,
class value_type,
class result_type>
260 void put(iterator_type __begin,
262 result_type (value_type::*
function)()
const,
263 const double w = 1.0)
265 for (iterator_type i = __begin; i != __end; ++i) {
266 put(((*i).*
function)(),
w);
402 double getQuantile(
const double Q,
const bool reverse =
false)
const
418 THROW(
JNoValue,
"Option 'quantiles' at JQuantile() incompatible with method getQuantile().");
428 std::ostream&
print(std::ostream& out,
bool lpr =
true)
const
435 out << setw(nc) << left <<
" " <<
' '
436 << setw(10) << left <<
" mean" <<
' '
437 << setw(10) << left <<
" STD" <<
' '
438 << setw(10) << left <<
" deviation" << endl;
441 out << setw(nc) << left <<
getTitle() <<
' '
476 for (
T i = __begin; i != __end; ++i) {
Auxiliary base class for aritmetic operations of derived class types.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
const std::string & getTitle() const
Get title.
bool getLongprint(std::ostream &out)
Get long print option.
Exception for missing value.
I/O formatting auxiliaries.
Auxiliary class for title.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
Exception for division by zero.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Base class for data structures with artithmetic capabilities.
Auxiliary data structure for floating point format specification.