A library of intervals, relations and algorithms.

Usage

Add the following dependency to your build.sbt:

libraryDependencies += "com.github.gchudnov" %% "mindthegap" % "1.0.0"

Import the package:

import com.github.gchudnov.mtg.*

An example application:

package com.example

import com.github.gchudnov.mtg.*

object Hello extends App {
  val a = Interval.closed(0, 5)
  val b = Interval.closed(1, 6)

  val c = a.intersection(b)

  println(c)
  // Interval(At(Finite(1)),At(Finite(5)))

  println(c.asString)
  // [1,5]
}

Check the examples directory for the list of use-cases.