Use Constant for values in assignment

Avoids recompiling kernels for every CG search direction.