comparison src/samer/maths/opt/XFConvergence.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 // this used to happen in QuasiNewton
14 // after any step was taken (including during line searches)
15 // of-course, S.h cannot change during a line search
16
17 public class XFConvergence
18 {
19 double XTOL, FTOL; // various tolerances
20
21 public void setXTolerance( double tolx) { XTOL=tolx; }
22 public void setFTolerance( double tolf) { FTOL=tolf; }
23
24 public boolean isSatisfied(State S)
25 {
26 return (Util.maxabs(S.h)<2*XTOL) && (Math.abs(S.P1.s)<2*FTOL);
27 }
28 }