2

How do I convert a Numeric.LinearAlgebra.Static.R to a Numeric.LinearAlgebra.Static.C (with all imaginary parts being zero?).

Sounds like a straight forward problem, but from what I see all map-like functions have the same input as the output field. Eg:

dvmap :: (...) => (field -> field) -> vec n -> vec n
zipWithVector :: (...) => (field -> field -> field) -> vec n -> vec n -> vec n

This is making it impossible to convert from R to C.

I guess I am just missing something here?

fho
  • 6,787
  • 26
  • 71
  • I'm unfamiliar with those types. I can only see `extract :: R n -> Vector ℝ` and `create :: Vector ℂ -> Maybe (C n)` that could help, even if we need to pass though the "size-unchecked" vector. This is, of course, assuming that we do have a conversion `Vector ℝ -> Vector ℂ`. – chi Feb 02 '20 at 10:32
  • @chi That's what I am doing at the moment. But it feels like a lot of unnecessary conversion for what is basically just a type conversion. – fho Feb 02 '20 at 10:38
  • 2
    `Numeric.LinearAlgebra.Static` generally seems to be pretty focused on Euclidean spaces, and only supports some complex stuff for eigenvalues. Strange that this conversion in particular isn't included; I guess it might be worth filing a pull request for it. – leftaroundabout Feb 02 '20 at 11:14

0 Answers0