samer@0: /* samer@0: * Copyright (c) 2000, Samer Abdallah, King's College London. samer@0: * All rights reserved. samer@0: * samer@0: * This software is provided AS iS and WITHOUT ANY WARRANTY; samer@0: * without even the implied warranty of MERCHANTABILITY or samer@0: * FITNESS FOR A PARTICULAR PURPOSE. samer@0: */ samer@0: samer@0: package samer.maths.opt; samer@0: import samer.maths.*; samer@0: import samer.core.*; samer@0: samer@0: public abstract class Constraints samer@0: { samer@0: public State S; samer@0: public int[] active; // active dimensions samer@0: public int[] inactive; // inactive dimensions samer@0: public int n,m; // number of active dimensions samer@0: samer@0: public Constraints(State s) samer@0: { samer@0: S=s; n=S.n; samer@0: active = new int[n]; samer@0: inactive = new int[n]; samer@0: activateAll(); samer@0: } samer@0: samer@0: public final int activeCount() { return m; } samer@0: samer@0: public void report() samer@0: { samer@0: Shell.print("inactive dimensions:"); samer@0: for (int i=0; i<(n-m); i++) { samer@0: Shell.print(" - "+inactive[i]); samer@0: } samer@0: Shell.print("active dimensions:"); samer@0: for (int i=0; imax) max=xk; samer@0: } samer@0: return max; samer@0: } samer@0: samer@0: // ugh samer@0: public boolean release(Datum P) { return false; } samer@0: public int getReleasedDimension() { return -1; } samer@0: public int getReleasableDimensions() { return 0; } samer@0: public abstract void lineSearch(Condition c, CubicLineSearch ls, double step); samer@0: public abstract void initialise(); samer@0: samer@0: public interface Factory { samer@0: public Constraints build(MinimiserBase min); samer@0: } samer@0: }