Esempio n. 1
0
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);
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
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);
}
Esempio n. 4
0
 double & host_get(size_t row, size_t col) const
 {
     return hostMatrix(row, col);
 }