def cast opts={}
      dt = opts[:dtype]
      raise ArgumentError, "Unsupported dtype #{opts[:dtype]}" unless %i[array nmatrix gsl].include?(dt)

      @data = cast_vector_to dt unless @dtype == dt
    end
def cast opts={}
      dt = opts[:dtype]
      raise ArgumentError, "Unsupported dtype #{opts[:dtype]}" unless %i[array nmatrix gsl].include?(dt)

      @data = cast_vector_to dt unless @dtype == dt
    end
Cast a vector to a new data type.

 == Options

 * +:dtype+ - :array for Ruby Array. :nmatrix for NMatrix.