MAINT: drop asarray for gradient in tnc, allow any sequence and check in C