8 lines
418 B
Text
8 lines
418 B
Text
fcn factorize(x,y,z,etc){
|
|
xyzs:=vm.arglist;
|
|
fs:=xyzs.apply(factors.strand) // queue up factorizing for x,y,...
|
|
.apply("noop") // wait for all threads to finish factoring
|
|
.apply(fcn{ (0).min(vm.arglist) }); // find minimum factor for x,y...
|
|
[0..].zip(fs).filter(fcn([(n,x)],M){ x==M }.fp1((0).max(fs))) // find max of mins
|
|
.apply('wrap([(n,_)]){ xyzs[n] }) // and pluck src from arglist
|
|
}
|