How would I type hint this to get rid of the remaining reflection calls?
(def B
(amap ^"[[D" A i ^"[[D" B
(amap ^doubles (aget A (int i)) j ^doubles row
(* 2 (aget row (int j))))))
There's two reflection calls left, but I don't know how to get rid of them.
You don't show your complete code or the reflection warnings, but if they are what I think they are, you'll need to:
(def ^"[[D" A ...)
wherever you define it(double (* 2 ...))
The process to come up with these fixes is to perform macroexpand on the macro, run that version, see what expressions are causing the reflection warnings, fix them, and hope that you can retrofit the hints into the original macro, which in this case is possible. I still recommend the more straightforward solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With