The Cool-lex order and algorithms were invented and authored by Frank Ruskey and Aaron Williams (http://webhome.cs.uvic.ca/~ruskey/Publications/Coollex/CoolComb.html). You may need to obtain permission to use Cool-lex, as governed by applicable laws and academic practices.
The code in this repository is authored by the cool-lex-java contributors, and is licensed under Apache License, version 2.0 license.
Golang-style iterators offer between 7% and 8% better performance compared to classic Java iterators.
Golang-style iterators:
CoollexLinkedList.sequence(3, 2)
.forEach(
combination -> {
combination.forEach(System.out::print);
System.out.println();
});or
CoollexLinkedList.sequence(3, 2)
.doWhile(
combination -> {
combination.doWhile(
element -> {
System.out.print(element);
return true; // signal the iterator to continue producing elements
});
System.out.println();
return true; // signal the iterator to continue producing combinations
});
// prints:
// 01
// 12
// 02Collections Framework iterators (classic iterators):
CoollexLinkedList.combinations(3, 2)
.forEachRemaining(
combination -> {
combination.forEachRemaining((int element) -> System.out.print(element));
System.out.println();
});
// prints:
// 01
// 12
// 02Minimum Java 8.
Porting to earlier versions is straightforward.
No additional dependencies.
Ideas:
- Research parallelization.
- Incorporation of additional algorithms as presented in the research paper, potentially better optimized for execution on contemporary architectures.
- Development of algorithm implementations suitable for resource-constrained computing environments.
<project>
<repositories>
<repository>
<id>github</id>
<name>GitHub dastoikov Apache Maven Packages</name>
<url>https://maven.pkg.github.com/dastoikov/cool-lex-java</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.samldom.coollex</groupId>
<artifactId>cool-lex-java</artifactId>
<version>1.1.4</version>
</dependency>
</dependencies>
</project>