35#ifndef STK_STAT_FUNCTORS_H
36#define STK_STAT_FUNCTORS_H
40#define FUNCTION_ON_ARRAY(funct, Op) \
41template< class Derived> \
42typename hidden::FunctorTraits<Derived, Op >::Row \
43funct(Derived const& A) \
44{ return typename hidden::FunctorTraits<Derived, Op>::ColOp(A)();} \
45template< class Derived, class Weights> \
46typename hidden::FunctorTraits<Derived, Op >::Row \
47funct(Derived const& A, Weights const& w) \
48{ return typename hidden::FunctorTraits<Derived, Op>::ColWeightedOp(A)(w);} \
49template< class Derived> \
50typename hidden::FunctorTraits<Derived, Op >::Row \
51funct##ByCol(Derived const& A) \
52{ return typename hidden::FunctorTraits<Derived, Op>::ColOp(A)();} \
53template< class Derived, class Weights> \
54typename hidden::FunctorTraits<Derived, Op >::Row \
55funct##ByCol(Derived const& A, Weights const& w) \
56{ return typename hidden::FunctorTraits<Derived, Op>::ColWeightedOp(A)(w);} \
57template< class Derived> \
58typename hidden::FunctorTraits<Derived, Op >::Col \
59funct##ByRow(Derived const& A) \
60{ return typename hidden::FunctorTraits<Derived, Op>::RowOp(A)();} \
61template< class Derived, class Weights> \
62typename hidden::FunctorTraits<Derived, Op >::Col \
63funct##ByRow(Derived const& A, Weights const& w) \
64{ return typename hidden::FunctorTraits<Derived, Op>::RowWeightedOp(A)(w);}
76template<
class Derived>
79 typedef typename Derived::Type
Type;
89 for (
int i=
V_.begin();
i<
V_.end();
i++)
97 template<
class Weights>
102 for (
int i=
V_.begin();
i<
V_.end();
i++)
113template<
class Derived>
116 typedef typename Derived::Type
Type;
124 for (
int i=
V_.begin();
i<
V_.end();
i++)
131 template<
class Weights>
136 for (
int i=
V_.begin();
i<
V_.end();
i++)
147template<
class Derived>
150 typedef typename Derived::Type
Type;
160 for (
int i=
V_.begin();
i<
V_.end();
i++)
168 template<
class Weights>
173 for (
int i=
V_.begin();
i<
V_.end();
i++)
184template<
class Derived>
187 typedef typename Derived::Type
Type;
195 for (
int i=
V_.begin();
i<
V_.end();
i++)
202 template<
class Weights>
207 for (
int i=
V_.begin();
i<
V_.end();
i++)
218template<
class Derived>
221 typedef typename Derived::Type
Type;
238 template<
class Weights>
254template<
class Derived>
257 typedef typename Derived::Type
Type;
266 for (
int i=
V_.begin();
i<
V_.end();
i++)
273 template<
class Weights>
277#ifdef STK_BOUNDS_CHECK
278 if (
V_.range() !=
w.range())
283 for (
int i=
V_.begin();
i<
V_.end();
i++)
296template<
class Derived>
299 typedef typename Derived::Type
Type;
309 if (
V_.empty()) {
return Type(0);}
319 template<
class Weights>
324 if (
V_.empty()) {
return Type(0);}
327 for (
int i=
V_.begin();
i<
V_.end();
i++)
343template<
class Derived>
346 typedef typename Derived::Type
Type;
354 if (
V_.empty()) {
return Type(0);}
359 for (
int i=
V_.begin();
i<
V_.end();
i++)
367 template<
class Weights>
372 if (
V_.empty()) {
return Type(0);}
373#ifdef STK_BOUNDS_CHECK
374 if (
V_.range() !=
w.range())
379 for (
int i=
V_.begin();
i<
V_.end();
i++)
397template<
class Derived>
400 typedef typename Derived::Type
Type;
412 if (
V_.empty()) {
return Type(0);}
418 for (
int i=
V_.begin();
i<
V_.end();
i++)
442 template<
class Weights>
447 if (
V_.empty()) {
return Type(0);}
452 for (
int i=
V_.begin();
i<
V_.end();
i++)
472template<
class Derived>
475 typedef typename Derived::Type
Type;
487 if (
V_.empty()) {
return Type(0);}
493 for (
int i=
V_.begin();
i<
V_.end();
i++)
521 template<
class Weights>
526 if (
V_.empty()) {
return Type(0);}
529#ifdef STK_BOUNDS_CHECK
530 if (
V_.range() !=
w.range())
535 for (
int i=
V_.begin();
i<
V_.end();
i++)
557template<
class Derived>
560 typedef typename Derived::Type
Type;
578 if (
V_.empty()) {
return Type(0);}
582 for (
int i=
V_.begin();
i<
V_.end();
i++)
605 template<
class Weights>
610 if (
V_.empty()) {
return Type(0);}
613 for (
int i=
V_.begin();
i<
V_.end();
i++)
634template<
class Derived>
637 typedef typename Derived::Type
Type;
655 if (
V_.empty()) {
return Type(0);}
659 for (
int i=
V_.begin();
i<
V_.end();
i++)
686 template<
class Weights>
691 if (
V_.empty()) {
return Type(0);}
692 if (
V_.range() !=
w.range())
696 for (
int i=
V_.begin();
i<
V_.end();
i++)
829template<
class Derived,
class Weights>
834template<
class Derived>
839template<
class Derived,
class Weights>
844template<
class Derived>
850template<
class Derived,
class Weights>
867template<
class Derived>
872template<
class Derived,
class Weights>
877template<
class Derived>
882template<
class Derived,
class Weights>
887template<
class Derived>
892template<
class Derived,
class Weights>
910template<
class Derived,
class MeanType>
915template<
class Derived,
class MeanType,
class Weights>
920template<
class Derived,
class MeanType>
925template<
class Derived,
class MeanType,
class Weights>
930template<
class Derived,
class MeanType>
935template<
class Derived,
class MeanType,
class Weights>
949template<
class Derived,
class MeanType>
954template<
class Derived,
class MeanType,
class Weights>
959template<
class Derived,
class MeanType>
964template<
class Derived,
class MeanType,
class Weights>
969template<
class Derived,
class MeanType>
974template<
class Derived,
class MeanType,
class Weights>
984#undef FUNCTION_ON_ARRAY
In this file we define the way to apply functors to Expressions.
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
#define FUNCTION_ON_ARRAY(funct, Op)
#define STK_STATIC_ASSERT_ONE_DIMENSION_ONLY(EXPR)
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
double Real
STK fundamental type of Real values.
hidden::FunctorTraits< Derived, VarianceWithFixedMeanOp >::Row varianceWithFixedMean(Derived const &A, MeanType const &mean, bool unbiased)
Compute the VarianceWithFixedMean(s) value(s) of A.
hidden::FunctorTraits< Derived, VarianceSafeOp >::Row varianceSafe(Derived const &A, bool unbiased=false)
Compute safely the variance(s) value(s) of A.
hidden::FunctorTraits< Derived, MinSafeOp >::Row minSafe(Derived const &A)
Compute safely the minimal(s) [weighted] value(s) of A.
hidden::FunctorTraits< Derived, MaxOp >::Row max(Derived const &A)
Compute the maximal(s) value(s) of A.
hidden::FunctorTraits< Derived, SumOp >::Row sum(Derived const &A)
Compute the sum of A.
hidden::FunctorTraits< Derived, MaxSafeOp >::Row maxSafe(Derived const &A)
Compute safely the maximal(s) value(s) of A.
hidden::FunctorTraits< Derived, MeanOp >::Row mean(Derived const &A)
Compute the mean(s) value(s) of A.
hidden::FunctorTraits< Derived, VarianceOp >::Row variance(Derived const &A, bool unbiased=false)
Compute the variance(s) value(s) of A.
hidden::FunctorTraits< Derived, VarianceWithFixedMeanSafeOp >::Row varianceWithFixedMeanSafe(Derived const &A, MeanType const &mean, bool unbiased)
Compute safely the VarianceWithFixedMean(s) value(s) of A.
hidden::FunctorTraits< Derived, SumSafeOp >::Row sumSafe(Derived const &A)
Compute safely the mean(s) value(s) of A.
hidden::FunctorTraits< Derived, MeanSafeOp >::Row meanSafe(Derived const &A)
Compute safely the mean(s) value(s) of A.
hidden::FunctorTraits< Derived, MinOp >::Row min(Derived const &A)
Compute the minimal(s) value(s) of A.
hidden::FunctorTraits< Derived, VarianceOp >::Col varianceByRow(Derived const &A, bool unbiased=false)
hidden::FunctorTraits< Derived, VarianceWithFixedMeanSafeOp >::Row varianceWithFixedMeanSafeByCol(Derived const &A, MeanType const &mean, bool unbiased)
hidden::FunctorTraits< Derived, VarianceSafeOp >::Col varianceSafeByRow(Derived const &A, bool unbiased=false)
hidden::FunctorTraits< Derived, VarianceWithFixedMeanOp >::Row varianceWithFixedMeanByCol(Derived const &A, MeanType const &mean, bool unbiased)
hidden::FunctorTraits< Derived, VarianceWithFixedMeanOp >::Col varianceWithFixedMeanByRow(Derived const &A, MeanType const &mean, bool unbiased=false)
hidden::FunctorTraits< Derived, VarianceSafeOp >::Row varianceSafeByCol(Derived const &A, bool unbiased=false)
hidden::FunctorTraits< Derived, VarianceOp >::Row varianceByCol(Derived const &A, bool unbiased=false)
hidden::FunctorTraits< Derived, VarianceWithFixedMeanSafeOp >::Col varianceWithFixedMeanSafeByRow(Derived const &A, MeanType const &mean, bool unbiased)
The namespace STK is the main domain space of the Statistical ToolKit project.
Arithmetic properties of STK fundamental types.
static bool isNA(Type const &x)
Compute the maximal value of the variable V.
Type const operator()(ExprBase< Weights > const &w) const
MaxOp(ExprBase< Derived > const &V)
constructor
Type const operator()() const
Compute safely the maximal value of the variable V.
Type const operator()() const
MaxSafeOp(ExprBase< Derived > const &V)
constructor
Type const operator()(ExprBase< Weights > const &w) const
Compute the mean of the variable V.
MeanOp(ExprBase< Derived > const &V)
constructor
Type const operator()(ExprBase< Weights > const &w) const
Type const operator()() const
Compute safely mean of the variable V.
Type const operator()(ExprBase< Weights > const &w) const
MeanSafeOp(ExprBase< Derived > const &V)
constructor
Type const operator()() const
Compute the minimal value of the variable V.
Type const operator()(ExprBase< Weights > const &w) const
Type const operator()() const
MinOp(ExprBase< Derived > const &V)
constructor
Compute safely the minimal value of the variable V.
Type const operator()() const
MinSafeOp(ExprBase< Derived > const &V)
constructor
Type const operator()(ExprBase< Weights > const &w) const
Compute the sum of the variable V.
Type const operator()() const
SumOp(ExprBase< Derived > const &V)
constructor
Type const operator()(ExprBase< Weights > const &w) const
Compute safely the sum of the variable V.
Type const operator()() const
Type const operator()(ExprBase< Weights > const &w) const
SumSafeOp(ExprBase< Derived > const &V)
constructor
Compute the variance of the variable V.
Type const operator()(ExprBase< Weights > const &w, bool unbiased) const
VarianceOp(ExprBase< Derived > const &V)
constructor
Type const operator()(bool unbiased) const
Compute safely the variance of the variable V.
Type const operator()(bool unbiased) const
Type const operator()(ExprBase< Weights > const &w, bool unbiased) const
VarianceSafeOp(ExprBase< Derived > const &V)
constructor
Compute the variance of the variable V when the mean is given.
VarianceWithFixedMeanOp(ExprBase< Derived > const &V)
constructor
Type const operator()(ExprBase< Weights > const &w, Type const &mu, bool unbiased) const
Type const operator()(Type const &mu, bool unbiased) const
Compute safely the variance of the variable V when the mean is given.
VarianceWithFixedMeanSafeOp(ExprBase< Derived > const &V)
constructor
Type const operator()(ExprBase< Weights > const &w, Type const &mu, bool unbiased) const
Type const operator()(Type mu, bool unbiased) const
FunctorSelector< Derived, Functor,(bool) isVector_ >::RowWeightedOp RowWeightedOp
FunctorSelector< Derived, Functor,(bool) isVector_ >::ColOp ColOp
FunctorSelector< Derived, Functor,(bool) isVector_ >::RowOp RowOp
FunctorSelector< Derived, Functor,(bool) isVector_ >::ColWeightedOp ColWeightedOp