Skip to content

dastoikov/cool-lex-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cool-lex-java

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.

Notes

Golang-style iterators offer between 7% and 8% better performance compared to classic Java iterators.

Examples

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
// 02

Collections Framework iterators (classic iterators):

CoollexLinkedList.combinations(3, 2)
    .forEachRemaining(
        combination -> {
          combination.forEachRemaining((int element) -> System.out.print(element));
          System.out.println();
        });

// prints:
// 01
// 12
// 02

Dependencies

Minimum Java 8.

Porting to earlier versions is straightforward.

No additional dependencies.

Development

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.

Installation

<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>

About

Implementations of the Cool-lex (http://webhome.cs.uvic.ca/~ruskey/Publications/Coollex/CoolComb.html) algorithms.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages