checkpoint
[anneal.git] / src / edu / berkeley / qfat / geom / AffineConstraint.java
diff --git a/src/edu/berkeley/qfat/geom/AffineConstraint.java b/src/edu/berkeley/qfat/geom/AffineConstraint.java
new file mode 100644 (file)
index 0000000..a6fb01c
--- /dev/null
@@ -0,0 +1,20 @@
+package edu.berkeley.qfat.geom;
+import javax.media.opengl.*;
+
+/** a constraint arising from the conjunction of linear equalities */
+public interface AffineConstraint {
+
+    public Point getProjection(Point p);
+    public AffineConstraint intersect(AffineConstraint c, float epsilon);
+
+    public static class All implements AffineConstraint {
+        public Point getProjection(Point p) { return p; }
+        public AffineConstraint intersect(AffineConstraint c, float epsilon) { return c; }
+    }
+
+    public static class Nothing implements AffineConstraint {
+        public Point getProjection(Point p) { return null; }
+        public AffineConstraint intersect(AffineConstraint c, float epsilon) { return this; }
+    }
+
+}