vector<vector<double>> Alignment::get_q_matrix() { if(!model) throw Exception("No model has been set."); RowMatrix<double> gen = model->getGenerator(); size_t nrow = gen.getNumberOfRows(); size_t ncol = gen.getNumberOfColumns(); auto q = vector<vector<double>>(nrow, vector<double>(ncol, 0)); for (size_t i = 0; i < nrow; ++i) { for (size_t j = 0; j < ncol; ++j) { q[i][j] = gen(i, j); } } return q; }
vector<vector<double>> Alignment::get_p_matrix(double time) { if(!model) throw Exception("No model has been set."); RowMatrix<double> pijt = model->getPij_t(time); size_t nrow = pijt.getNumberOfRows(); size_t ncol = pijt.getNumberOfColumns(); auto p = vector<vector<double>>(nrow, vector<double>(ncol, 0)); for (size_t i = 0; i < nrow; ++i) { for (size_t j = 0; j < ncol; ++j) { p[i][j] = pijt(i, j); } } return p; }
vector<vector<double>> Alignment::get_exchangeabilities() { if(!model) throw Exception("No model has been set."); RowMatrix<double> exch = model->getExchangeabilityMatrix(); size_t nrow = exch.getNumberOfRows(); size_t ncol = exch.getNumberOfColumns(); auto s = vector<vector<double>>(nrow, vector<double>(ncol, 0)); for (size_t i = 0; i < nrow; ++i) { vector<double> row; for (size_t j = 0; j < ncol; ++j) { s[i][j] = exch(i, j); } } return s; }