On Monday, 20 April 2020 at 00:27:40 UTC, 9il wrote:
[snip]
Using two arguments Iterator1, Iterator2 works without
allocation
/+dub.sdl: dependency "mir-algorithm" version="~>3.7.28" +/
import mir.ndslice;
void foo(Iterator1, Iterator2, SliceKind kind)
(Slice!(Iterator1, 1, kind) x,
On Sunday, 19 April 2020 at 22:07:30 UTC, jmh530 wrote:
On Thursday, 16 April 2020 at 20:59:36 UTC, jmh530 wrote:
[snip]
/+dub.sdl:
dependency "mir-algorithm" version="~>3.7.28"
+/
import mir.ndslice;
void foo(Iterator, SliceKind kind)(Slice!(Iterator, 1, kind)
x, Slice!(Iterator, 1, kind) y
On Thursday, 16 April 2020 at 20:59:36 UTC, jmh530 wrote:
[snip]
/+dub.sdl:
dependency "mir-algorithm" version="~>3.7.28"
+/
import mir.ndslice;
void foo(Iterator, SliceKind kind)(Slice!(Iterator, 1, kind) x,
Slice!(Iterator, 1, kind) y) {
import std.stdio : writeln;
writeln("here");
On Sunday, 19 April 2020 at 02:56:30 UTC, 9il wrote:
On Friday, 17 April 2020 at 08:40:36 UTC, WebFreak001 wrote:
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote:
[...]
Use std.algorithm:equal for range compare with approxEqual for
your comparator:
assert(equal!approxEqual(y, [2.5,
On Friday, 17 April 2020 at 08:40:36 UTC, WebFreak001 wrote:
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote:
[...]
Use std.algorithm:equal for range compare with approxEqual for
your comparator:
assert(equal!approxEqual(y, [2.5, 2.5].sliced(2)));
or mir.algorithm.iteration: each
On Friday, 17 April 2020 at 08:40:36 UTC, WebFreak001 wrote:
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote:
[...]
Use std.algorithm:equal for range compare with approxEqual for
your comparator:
assert(equal!approxEqual(y, [2.5, 2.5].sliced(2)));
simplified:
assert(equal!approxE
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote:
In the code below, I multiply some slice by 5 and then check
whether it equals another slice. This fails for mir's
approxEqual because the two are not the same types (yes, I know
that isClose in std.math works). I was trying to convert th
On Thursday, 16 April 2020 at 19:59:57 UTC, Basile B. wrote:
[snip]
And remove the extra assert() BTW... I don't know why this is
accepted.
Thanks, I hadn't realized about approxEqual. I think that
resolves my near-term issue, I would need to play around with
things a little more to be 100%
On Thursday, 16 April 2020 at 19:56:21 UTC, Basile B. wrote:
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote:
[...]
`approxEqual` cant work with ranges. If you look at the
signature there is a use of the constructor syntax, e.g const
`T maxRelDiff = T(0x1p-20f)` so when `T` is not a
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote:
In the code below, I multiply some slice by 5 and then check
whether it equals another slice. This fails for mir's
approxEqual because the two are not the same types (yes, I know
that isClose in std.math works). I was trying to convert th
In the code below, I multiply some slice by 5 and then check
whether it equals another slice. This fails for mir's approxEqual
because the two are not the same types (yes, I know that isClose
in std.math works). I was trying to convert the y variable below
to have the same double* iterator as t
11 matches
Mail list logo