STK++ 0.9.13
STK_Stat_Functors.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2016 Serge Iovleff, Université Lille 1, Inria
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place,
18 Suite 330,
19 Boston, MA 02111-1307
20 USA
21
22 Contact : S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23*/
24
25/*
26 * Project: stkpp::STatistiK::StatDesc
27 * Purpose: Compute elementary 1D statistics for all variables.
28 * Author: Serge Iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 **/
30
35#ifndef STK_STAT_FUNCTORS_H
36#define STK_STAT_FUNCTORS_H
37
39
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);}
65
66
67namespace STK
68{
69
70
71namespace Stat
72{
76template<class Derived>
77struct MinOp
78{
79 typedef typename Derived::Type Type;
81 inline MinOp( ExprBase<Derived> const& V): V_(V.asDerived())
86 Type const operator()() const
87 {
89 for (int i=V_.begin(); i<V_.end(); i++)
90 { min = std::min(min, V_[i]);}
91 return min;
92 }
97 template< class Weights>
98 Type const operator()( ExprBase<Weights> const& w) const
99 {
102 for (int i=V_.begin(); i<V_.end(); i++)
103 { min = std::min(min, w[i]*V_[i]);}
104 return min;
105 }
106 protected:
107 Derived const& V_;
108};
109
113template<class Derived>
115{
116 typedef typename Derived::Type Type;
118 inline MinSafeOp( ExprBase<Derived> const& V) : V_(V.asDerived())
121 Type const operator()() const
122 {
124 for (int i=V_.begin(); i<V_.end(); i++)
125 { if (Arithmetic<Type>::isFinite(V_[i])) min = std::min(min, V_[i]);}
126 return min;
127 }
131 template< class Weights>
132 Type const operator()( ExprBase<Weights> const& w) const
133 {
136 for (int i=V_.begin(); i<V_.end(); i++)
137 { if (!Arithmetic<Type>::isNA(V_[i])) min = std::min(min, w[i]*V_[i]);}
138 return min;
139 }
140 protected:
141 Derived const& V_;
142};
143
147template<class Derived>
148struct MaxOp
149{
150 typedef typename Derived::Type Type;
152 inline MaxOp( ExprBase<Derived> const& V) : V_(V.asDerived())
157 Type const operator()() const
158 {
160 for (int i=V_.begin(); i<V_.end(); i++)
161 { max = std::max(max, V_[i]);}
162 return max;
163 }
168 template< class Weights>
169 Type const operator()( ExprBase<Weights> const& w) const
170 {
173 for (int i=V_.begin(); i<V_.end(); i++)
174 { max = std::max(max, w[i]*V_[i]);}
175 return max;
176 }
177 protected:
178 Derived const& V_;
179};
180
184template<class Derived>
186{
187 typedef typename Derived::Type Type;
189 inline MaxSafeOp( ExprBase<Derived> const& V) : V_(V.asDerived())
192 Type const operator()() const
193 {
195 for (int i=V_.begin(); i<V_.end(); i++)
196 { if (!Arithmetic<Type>::isNA(V_[i])) max = std::max(max, V_[i]);}
197 return max;
198 }
202 template< class Weights>
203 Type const operator()( ExprBase<Weights> const& w) const
204 {
207 for (int i=V_.begin(); i<V_.end(); i++)
208 { if (!Arithmetic<Type>::isNA(V_[i])) max = std::max(max, w[i]*V_[i]);}
209 return max;
210 }
211 protected:
212 Derived const& V_;
213};
214
218template<class Derived>
219struct SumOp
220{
221 typedef typename Derived::Type Type;
223 inline SumOp( ExprBase<Derived> const& V) : V_(V.asDerived())
228 Type const operator()() const
229 {
230 Type sum = 0.;
231 for (int i=V_.begin(); i<V_.end(); i++) { sum += V_[i];}
232 return sum;
233 }
238 template< class Weights>
239 Type const operator()( ExprBase<Weights> const& w) const
240 {
242 // sum the weighted samples
243 Type sum = 0.0;
244 for (int i=V_.begin(); i<V_.end(); i++) { sum += w[i] * V_[i];}
245 return sum;
246 }
247 protected:
248 Derived const& V_;
249};
250
254template<class Derived>
256{
257 typedef typename Derived::Type Type;
259 inline SumSafeOp( ExprBase<Derived> const& V) : V_(V.asDerived())
262 Type const operator()() const
263 {
264 // sum the samples
265 Type sum = 0.0;
266 for (int i=V_.begin(); i<V_.end(); i++)
267 { if (!Arithmetic<Type>::isNA(V_[i])) sum += V_[i];}
268 return sum;
269 }
273 template< class Weights>
274 inline Type const operator()( ExprBase<Weights> const& w) const
275 {
277#ifdef STK_BOUNDS_CHECK
278 if (V_.range() != w.range())
279 STKRUNTIME_ERROR_NO_ARG(wmeanSafe,V.range()!=w.range());
280#endif
281 // sum the weighted samples
282 Type sum = 0.0;
283 for (int i=V_.begin(); i<V_.end(); i++)
285 { sum += std::abs(w[i]) * V_[i];}
286 }
287 return sum;
288 }
289 protected:
290 Derived const& V_;
291};
292
296template<class Derived>
297struct MeanOp
298{
299 typedef typename Derived::Type Type;
301 inline MeanOp( ExprBase<Derived> const& V) : V_(V.asDerived())
306 Type const operator()() const
307 {
308 // no samples
309 if (V_.empty()) { return Type(0);}
310 // sum the samples
311 Type sum = 0.;
312 for (int i=V_.begin(); i<V_.end(); i++) { sum += V_[i];}
313 return sum /= (Type)(V_.size());
314 }
319 template< class Weights>
320 Type const operator()( ExprBase<Weights> const& w) const
321 {
323 // no samples
324 if (V_.empty()) { return Type(0);}
325 // sum the weighted samples
326 Type sum = 0.0, sumweights= 0.0;
327 for (int i=V_.begin(); i<V_.end(); i++)
328 {
329 Type const weight = std::abs(w[i]);
331 sum += weight * V_[i];
332 }
333 // compute the weighted mean. If all weights are 0, we get 0
334 return (sumweights) ? sum /= sumweights: Type(0);
335 }
336 protected:
337 Derived const& V_;
338};
339
343template<class Derived>
345{
346 typedef typename Derived::Type Type;
348 inline MeanSafeOp( ExprBase<Derived> const& V) : V_(V.asDerived())
351 Type const operator()() const
352 {
353 // no samples
354 if (V_.empty()) { return Type(0);}
355 // get dimensions
356 int nobs = V_.size();
357 // sum the samples
358 Type sum = 0.0;
359 for (int i=V_.begin(); i<V_.end(); i++)
360 { (!Arithmetic<Type>::isNA(V_[i])) ? sum += V_[i] : nobs--;}
361 // compute the mean
362 return nobs ? (sum /= Type(nobs)) : Type(0);
363 }
367 template< class Weights>
368 inline Type const operator()( ExprBase<Weights> const& w) const
369 {
371 // no samples
372 if (V_.empty()) { return Type(0);}
373#ifdef STK_BOUNDS_CHECK
374 if (V_.range() != w.range())
375 STKRUNTIME_ERROR_NO_ARG(wmeanSafe,V.range()!=w.range());
376#endif
377 // sum the weighted samples
378 Type sum = 0.0, sumweights= 0.0;
379 for (int i=V_.begin(); i<V_.end(); i++)
381 {
382 Type weight = std::abs(w[i]);
384 sum += weight * V_[i];
385 }
386 }
387 // compute the weighted mean. If all weights are 0, we get 0
388 return (sumweights) ? (sum / sumweights) : Type(0);
389 }
390 protected:
391 Derived const& V_;
392};
393
397template<class Derived>
399{
400 typedef typename Derived::Type Type;
402 inline VarianceOp( ExprBase<Derived> const& V) : V_(V.asDerived())
409 inline Type const operator()(bool unbiased) const
410 {
411 // no samples
412 if (V_.empty()) { return Type(0);}
413
414 int nobs = V_.size();
415 // Compute the mean and sum
416 Type mu = MeanOp<Derived>(V_)();
417 Type sum = 0.0, var = 0.0, dev;
418 for (int i=V_.begin(); i<V_.end(); i++)
419 {
420 sum += (dev = V_[i] - mu); // deviation from the mean
421 var += (dev*dev); // squared value
422 }
423 // compute the variance
424 return (unbiased) ?
425 (nobs > 1) ? (var - (sum*sum)/Type(nobs))/Type(nobs -1)
427 :
428 (nobs > 0) ? (var - (sum*sum)/(Type)nobs)/(Type)(nobs)
429 : Type(0);
430 }
442 template< class Weights>
443 inline Type const operator()( ExprBase<Weights> const& w, bool unbiased) const
444 {
446 // no samples
447 if (V_.empty()) { return Type(0);}
448 // Compute the mean
449 Type mu = MeanOp<Derived>(V_)(w);
450 // sum the weighted samples
451 Type sum = 0.0, sum1weights= 0.0, sum2weights = 0.0;
452 for (int i=V_.begin(); i<V_.end(); i++)
453 {
454 Type const weight = w[i];
457 sum += weight*(V_[i]-mu)*(V_[i]-mu); // deviation from the mean
458 }
459 // compute the variance
460 return(unbiased) ?
462 :
463 (sum1weights) ? (sum/sum1weights) : Type(0);
464 }
465 protected:
466 Derived const& V_;
467};
468
472template<class Derived>
474{
475 typedef typename Derived::Type Type;
477 inline VarianceSafeOp( ExprBase<Derived> const& V) : V_(V.asDerived())
484 Type const operator()(bool unbiased) const
485 {
486 // no samples
487 if (V_.empty()) { return Type(0);}
488 int nobs = V_.size();
489 // Compute the mean
491 // sum
492 Type sum = 0.0, var = 0.0, dev;
493 for (int i=V_.begin(); i<V_.end(); i++)
494 {
496 {
497 sum += (dev = V_[i] - mu); // deviation from the mean
498 var += (dev*dev); // squared value
499 }
500 else nobs--;
501 }
502 // compute the variance
503 return (unbiased) ?
504 (nobs > 1) ? (var - (sum*sum)/Type(nobs))/Type(nobs -1)
506 :
507 (nobs > 0) ? (var - (sum*sum)/(Type)nobs)/(Type)(nobs)
508 : Type(0);
509 }
521 template< class Weights>
522 Type const operator()( ExprBase<Weights> const& w, bool unbiased) const
523 {
525 // no samples
526 if (V_.empty()) { return Type(0);}
527 // Compute the mean
529#ifdef STK_BOUNDS_CHECK
530 if (V_.range() != w.range())
531 STKRUNTIME_ERROR_NO_ARG(VarianceSafeOp,V.range()!=w.range());
532#endif
533 // sum the weighted samples
534 Type sum = 0.0, sum1weights= 0.0, sum2weights = 0.0;
535 for (int i=V_.begin(); i<V_.end(); i++)
537 {
538 Type weight = std::abs(w[i]);
541 sum += weight*(V_[i]-mu)*(V_[i]-mu); // deviation from the mean
542 }
543 }
544 // compute the variance
545 return (unbiased) ?
547 :
548 (sum1weights) ? (sum/sum1weights) : 0.;
549 }
550 protected:
551 Derived const& V_;
552};
553
557template<class Derived>
559{
560 typedef typename Derived::Type Type;
562 inline VarianceWithFixedMeanOp( ExprBase<Derived> const& V) : V_(V.asDerived())
575 Type const operator()( Type const& mu, bool unbiased) const
576 {
577 // no samples
578 if (V_.empty()) { return Type(0);}
579 int nobs = V_.size();
580 // sum
581 Type sum = 0., var = 0., dev;
582 for (int i=V_.begin(); i<V_.end(); i++)
583 {
584 sum += (dev = V_[i] - mu); // deviation from the mean
585 var += (dev*dev); // squared value
586 }
587 // unbiased variance
588 return (unbiased) ?
589 (nobs > 1) ? (var - (sum*sum)/(Type)(nobs))/((Type)nobs -1)
591 :
592 (nobs > 0) ? (var - (sum*sum)/Type(nobs))/Type(nobs) : Type(0);
593 }
605 template< class Weights>
606 Type const operator()( ExprBase<Weights> const& w, Type const& mu, bool unbiased) const
607 {
609 // no samples
610 if (V_.empty()) { return Type(0);}
611 // sum the weighted samples
612 Type sum = 0.0, sum1weights = 0.0, sum2weights = 0.0;
613 for (int i=V_.begin(); i<V_.end(); i++)
614 {
615 Real weight = std::abs(w[i]); // only positive weights
618 sum += weight * (V_[i]-mu)*(V_[i]-mu); // deviation from the mean
619 }
620 // compute the variance
621 return (unbiased) ?
624 :
625 (sum1weights) ? (sum/sum1weights) : Type(0);
626 }
627 protected:
628 Derived const& V_;
629};
630
634template<class Derived>
636{
637 typedef typename Derived::Type Type;
652 Type const operator()( Type mu, bool unbiased) const
653 {
654 // no samples
655 if (V_.empty()) { return Type(0);}
656 int nobs = V_.size();
657 // sum
658 Type sum = 0.0, var = 0.0, dev;
659 for (int i=V_.begin(); i<V_.end(); i++)
660 {
662 {
663 sum += (dev = V_[i] - mu); // deviation from the mean
664 var += (dev*dev); // squared value
665 }
666 else nobs--;
667 }
668 // compute the variance
669 return (unbiased) ?
670 (nobs > 1) ? (var - (sum*sum)/Type(nobs))/Type(nobs -1)
672 :
673 (nobs > 0) ? (var - (sum*sum)/(Type)nobs)/(Type)(nobs)
674 : Type(0.);
675 }
676
686 template< class Weights>
687 Type const operator()( ExprBase<Weights> const& w, Type const& mu, bool unbiased) const
688 {
690 // no samples
691 if (V_.empty()) { return Type(0);}
692 if (V_.range() != w.range())
693 STKRUNTIME_ERROR_NO_ARG(wmeanSafe,V.range()!=w.range());
694 // sum the weighted samples
695 Type sum = 0.0, sum1weights = 0.0, sum2weights = 0.0;
696 for (int i=V_.begin(); i<V_.end(); i++)
697 {
699 { Type weight = std::abs(w[i]);
702 sum += weight*(V_[i]-mu)*(V_[i]-mu); // deviation from the mean
703 }
704 }
705 // compute the variance
706 return (unbiased) ?
709 :
710 (sum1weights) ? (sum/sum1weights) : Type(0);
711 }
712 protected:
713 Derived const& V_;
714};
715
727
728
741
754
766
777
788
800
812
824template< class Derived>
825typename hidden::FunctorTraits<Derived, VarianceOp >::Row
828
829template< class Derived, class Weights>
831variance(Derived const& A, ExprBase<Weights> const& w, bool unbiased = false)
833
834template< class Derived>
836varianceByCol(Derived const& A, bool unbiased = false)
838
839template< class Derived, class Weights>
843
844template< class Derived>
846varianceByRow(Derived const& A, bool unbiased = false)
848
849
850template< class Derived, class Weights>
854
867template< class Derived>
869varianceSafe(Derived const& A, bool unbiased = false)
871
872template< class Derived, class Weights>
876
877template< class Derived>
881
882template< class Derived, class Weights>
886
887template< class Derived>
891
892template< class Derived, class Weights>
896
910template< class Derived, class MeanType>
914
915template< class Derived, class MeanType, class Weights>
919
920template< class Derived, class MeanType>
924
925template< class Derived, class MeanType, class Weights>
929
930template< class Derived, class MeanType>
934
935template< class Derived, class MeanType, class Weights>
939
949template< class Derived, class MeanType>
953
954template< class Derived, class MeanType, class Weights>
958
959template< class Derived, class MeanType>
963
964template< class Derived, class MeanType, class Weights>
968
969template< class Derived, class MeanType>
973
974template< class Derived, class MeanType, class Weights>
978
979
980} // namespace Stat
981
982} // namespace STK
983
984#undef FUNCTION_ON_ARRAY
985
986#endif /*STK_STAT_FUNCTORS_H*/
In this file we define the way to apply functors to Expressions.
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
Definition STK_Macros.h:138
#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
Derived const & V_
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
Derived const & V_
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
Derived const & V_
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