kaleidicassociates / lubeck

High level linear algebra library for Dlang
http://lubeck.libmir.org/
Boost Software License 1.0
66 stars 14 forks source link

Can't use tolerance argument of pinv #38

Closed John-Colvin closed 4 years ago

John-Colvin commented 4 years ago

I think this could easily be a dmd problem, but I can't work it out right now.

pinv([1.0, 2, 3, 4].sliced(2, 2), 0.1)
Error: template lubeck.pinv cannot deduce function from argument types !()(Slice!(double*, 2LU, cast(mir_slice_kind)2), double), candidates are:
/home/john/.dub/packages/lubeck-1.1.8/lubeck/source/lubeck.d(754,5):        pinv(Flag allowDestroy = No.allowDestroy, Iterator, mir_slice_kind kind)(Slice!(Iterator, 2, kind) matrix, BlasType!Iterator tolerance = BlasType!Iterator.nan)

workaround is to manually instantiate the template e.g.

pinv!(No.allowDestroy, double*, SliceKind.contiguous)([1.0, 2, 3, 4].sliced(2, 2), 0.1)