change asDoubleArray to toDoubleArray in Linear