13 throw Exception(
"OneJumpSubstitutionCount::getAllNumberOfSubstitutions: model not defined.");
15 tmp_ = model_->getPij_t(length);
16 size_t n = model_->getNumberOfStates();
17 auto probs = make_unique<LinearMatrix<double>>(n, n);
18 for (
size_t i = 0; i < n; ++i)
20 for (
size_t j = 0; j < n; ++j)
22 (*probs)(i, j) = (i == j ? 1. - tmp_(i, j) : 1.);
31 throw Exception(
"OneJumpSubstitutionCount::storeNumberOfSubstitutions: model not defined.");
33 tmp_ = model_->getPij_t(length);
34 auto n = Eigen::Index(model_->getNumberOfStates());
37 for (
auto i = 0; i < n; i++)
39 for (
auto j = 0; j < n; j++)
41 mat(i, j) = (i == j ? 1. - tmp_(
size_t(i),
size_t(j)) : 1.);
std::unique_ptr< Matrix< double > > getAllNumbersOfSubstitutions(double length, size_t type=1) const override
Get the numbers of susbstitutions on a branch, for each initial and final states, and given the branc...
void storeAllNumbersOfSubstitutions(double length, size_t type, Eigen::MatrixXd &mat) const override
Stores the numbers of susbstitutions on a branch, for each initial and final states,...
Defines the basic types of data flow nodes.