def argmax(self, sol, idx, add_loss=False, add_prior=False, opt_type='linear'):
		# if labels are present, then argmax will solve
		# the loss augmented programm
		T = len(self.X[idx][0,:])
		N = self.states
		F = self.dims

		# get transition matrix from current solution
		A = self.get_transition_matrix(sol)
		# calc emission matrix from current solution, data points and
		# augment with loss if requested
		em = self.calc_emission_matrix(sol, idx, augment_loss=add_loss, augment_prior=add_prior)

		delta = matrix(0.0, (N, T));
		psi = matrix(0, (N, T));
		# initialization
		for i in xrange(N):
			delta[i,0] = self.start_p[i] + em[i,0]
			
		# recursion
		for t in xrange(1,T):    
			for i in xrange(N):
				(delta[i,t], psi[i,t]) = max([(delta[j,t-1] + A[j,i] + em[i,t], j) for j in xrange(N)]);
		
		states = matrix(0, (1, T))
		(prob, states[T-1])  = max([delta[i,T-1], i] for i in xrange(N));    
			
		for t in reversed(xrange(1,T)):
			states[t-1] = psi[states[t],t];
		
		psi_idx = self.get_joint_feature_map(idx,states)
		#psi_idx[0] *= 0.1
		#psi_idx[2] *= 0.1

		val = sol.trans()*psi_idx
		return (val, states, psi_idx)
dataset/ETHPy150Open nicococo/tilitools/so_hmm.py/SOHMM.argmax/original