Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/math_BracketMinimum.lxx is written in an unsupported language. File is not indexed.

0001 // Copyright (c) 1997-1999 Matra Datavision
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 // math_BracketMinimum.lxx
0016 
0017 #include <Precision.hxx>
0018 
0019 inline math_BracketMinimum::math_BracketMinimum(const double A, const double B)
0020     : Done(false),
0021       Ax(A),
0022       Bx(B),
0023       Cx(0.),
0024       FAx(0.),
0025       FBx(0.),
0026       FCx(0.),
0027       myLeft(-Precision::Infinite()),
0028       myRight(Precision::Infinite()),
0029       myIsLimited(false),
0030       myFA(false),
0031       myFB(false)
0032 {
0033 }
0034 
0035 inline bool math_BracketMinimum::IsDone() const
0036 {
0037   return Done;
0038 }
0039 
0040 inline Standard_OStream& operator<<(Standard_OStream& o, const math_BracketMinimum& Br)
0041 {
0042   Br.Dump(o);
0043   return o;
0044 }
0045 
0046 inline void math_BracketMinimum::SetLimits(const double theLeft, const double theRight)
0047 {
0048   myLeft      = theLeft;
0049   myRight     = theRight;
0050   myIsLimited = true;
0051 }
0052 
0053 inline void math_BracketMinimum::SetFA(const double theValue)
0054 {
0055   FAx  = theValue;
0056   myFA = true;
0057 }
0058 
0059 inline void math_BracketMinimum::SetFB(const double theValue)
0060 {
0061   FBx  = theValue;
0062   myFB = true;
0063 }
0064 
0065 inline double math_BracketMinimum::Limited(const double theValue) const
0066 {
0067   return theValue < myLeft ? myLeft : theValue > myRight ? myRight : theValue;
0068 }