void DenseTransitionMatrix<T>::initFromStateGraph(const StateGraph* mc) { size_t omega = mc->getNumStates(); init(omega); ::marathon::cpu::DenseTransitionMatrix<T> hostMatrix(omega); hostMatrix.initFromStateGraph(mc); copy(hostMatrix); }
std::ostream& operator<<(std::ostream& out, const DenseTransitionMatrix<T>& m) { cpu::DenseTransitionMatrix<T> hostMatrix(m.n); cuda::copy2DDeviceToHost(hostMatrix.data, hostMatrix.ld * sizeof(T), m.data, m.ld * sizeof(T), m.n * sizeof(T), m.n); out << hostMatrix; return out; }
void DenseTransitionMatrix<T>::setEye() { ::marathon::cpu::DenseTransitionMatrix<T> hostMatrix(n); hostMatrix.setEye(); cuda::copy2DHostToDevice(data, ld * sizeof(T), hostMatrix.data, hostMatrix.ld * sizeof(T), n * sizeof(T), n); }
double & host_get(size_t row, size_t col) const { return hostMatrix(row, col); }