Ticket #969 (new wish)
Consider making Contingency more efficient
|Reported by:||janez||Owned by:||janez|
In particular, in discrete-vs-discrete case it can be stored as double *, and in continuous-vs-discrete as map<double, TDiscDistribution> (instead of map<double, PDistribution>).
In either case, we will have problems with operator that returns a PDistribution. A possible solution is to allow TDiscDistribution::distribution to point to shared data. In that case, TDiscDistribution::distribution_ would be put in union with a bool telling whether the data is owned or borrowed.
The question is how much would we gain by this optimization, in particular in discrete-vs-discrete case. Discrete contingency tables are typically small.