Description

Linear constraint solving library.

Package Information

Version0.0.1 (2014-Apr-29)
Repository https://github.com/yglukhov/cassowary.d
LicenseLGPL
CopyrightCopyright © 2014, Yuriy Glukhov
AuthorsYuriy Glukhov
Registered byYuriy Glukhov
Dependencies none

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

cassowary.d

Cassowary constraint solving library for D language.

This is a port of Java version of http://www.cs.washington.edu/research/constraints/cassowary/

Usage:

import std.stdio;
import cassowary.d;

unittest
{
	auto x = new ClVariable(123);
	auto y = new ClVariable(30);
	auto solver = new ClSimplexSolver();

	auto eq = new ClLinearEquation(x, y / 3 - 5);
	solver.addStay(y);
	solver.addConstraint(eq);

	assert(x.value() == y.value() / 3 - 5);
	assert(x.value() == 5);
}

Available versions

0.0.1 ~master