Warning, /include/opencascade/math_NewtonMinimum.lxx is written in an unsupported language. File is not indexed.
0001 // Created on: 1996-05-03
0002 // Created by: Philippe MANGIN
0003 // Copyright (c) 1996-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016
0017 #include <StdFail_NotDone.hxx>
0018
0019 inline Standard_Boolean math_NewtonMinimum::IsConverged() const
0020 {
0021 return ( (TheStep.Norm() <= XTol ) ||
0022 ( Abs(TheMinimum-PreviousMinimum) <= XTol * Abs(PreviousMinimum) ));
0023 }
0024
0025 inline Standard_Boolean math_NewtonMinimum::IsDone() const
0026 {
0027 return Done;
0028 }
0029
0030 inline const math_Vector& math_NewtonMinimum::Location() const
0031 {
0032 StdFail_NotDone_Raise_if(!Done, "NewtonMinimum");
0033 return TheLocation;
0034 }
0035
0036 inline void math_NewtonMinimum::Location(math_Vector& Loc) const
0037 {
0038 StdFail_NotDone_Raise_if(!Done, "NewtonMinimum");
0039 Loc = TheLocation;
0040 }
0041
0042 inline Standard_Real math_NewtonMinimum::Minimum() const
0043 {
0044 StdFail_NotDone_Raise_if(!Done, "NewtonMinimum");
0045 return TheMinimum;
0046 }
0047
0048 inline const math_Vector& math_NewtonMinimum::Gradient() const
0049 {
0050 StdFail_NotDone_Raise_if(!Done, "NewtonMinimum");
0051 return TheGradient;
0052 }
0053
0054 inline void math_NewtonMinimum::Gradient(math_Vector& Grad) const
0055 {
0056 StdFail_NotDone_Raise_if(!Done, "NewtonMinimum");
0057 Grad = TheGradient;
0058 }
0059
0060 inline Standard_Integer math_NewtonMinimum::NbIterations() const
0061 {
0062 StdFail_NotDone_Raise_if(!Done, "NewtonMinimum");
0063 return nbiter;
0064 }
0065
0066 inline math_Status math_NewtonMinimum::GetStatus() const
0067 {
0068 return TheStatus;
0069 }