[m-users.] Cartesian product of two sets of things.

Volker Wysk post at volker-wysk.de
Tue Oct 10 17:28:58 AEDT 2023


Am Dienstag, dem 10.10.2023 um 17:06 +1100 schrieb Julien Fischer:
> Hi Volker,
> 
> On Mon, 9 Oct 2023, Volker Wysk wrote:
> 
> > You're welcome. 
> > 
> > I'm not sure how efficient this is, though.
> 
> Not as efficient as it could be -- see cartesian_product1b in the
> attached.

desktop ~/src/cart_prod $ ./cproduct 
N = 250, repeats = 100, time1 = 250 ms, time2 = 2100 ms

That's a high difference in speed... solutions/2 and solutions_set/2 should
be avoided when speed is essential.

Thanks for that.

Volker


More information about the users mailing list