Mercurial > hg > jslab
comparison src/samer/maths/opt/GConvergence.java @ 0:bf79fb79ee13
Initial Mercurial check in.
author | samer |
---|---|
date | Tue, 17 Jan 2012 17:50:20 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:bf79fb79ee13 |
---|---|
1 /* | |
2 * Copyright (c) 2000, Samer Abdallah, King's College London. | |
3 * All rights reserved. | |
4 * | |
5 * This software is provided AS iS and WITHOUT ANY WARRANTY; | |
6 * without even the implied warranty of MERCHANTABILITY or | |
7 * FITNESS FOR A PARTICULAR PURPOSE. | |
8 */ | |
9 | |
10 package samer.maths.opt; | |
11 import samer.maths.*; | |
12 | |
13 public class GConvergence | |
14 { | |
15 double GTOL; | |
16 | |
17 public void setGTolerance( double tolg) { GTOL=tolg; } | |
18 | |
19 public boolean isSatisfied(double [] g, Constraints C) | |
20 { | |
21 for (int k=0; k<C.m; k++) { | |
22 int i=C.active[k]; | |
23 if (g[i]>GTOL) return false; | |
24 } | |
25 return true; | |
26 } | |
27 | |
28 public boolean isSatisfied(double [] g, State S) | |
29 { | |
30 for (int i=0; i<S.n; i++) { | |
31 if (g[i]>GTOL) return false; | |
32 } | |
33 return true; | |
34 } | |
35 } |