21 #include <basic/Tracer.hh>
22 #include <utility/exit.hh>
25 #include <ObjexxFCL/format.hh>
26 #include <ObjexxFCL/string.functions.hh>
30 static basic::Tracer
tr(
"core.constraints.BoundFunc",basic::t_info);
36 namespace constraints {
48 }
else if (
lb_ <= x ) {
50 }
else if ( x <
lb_ ) {
71 }
else if (
lb_ <= x ) {
73 }
else if ( x <
lb_ ) {
79 return 2.0 * (delta) / ( sd_ * sd_ ) * (( x <
lb_ ) ? (-1.0) : 1.0);
85 if (verbose_level > 100) {
86 out <<
" " <<
type_ <<
" " ;
88 if ( verbose_level > 75 ) {
89 out << x <<
" [ " <<
lb_ <<
" , " <<
ub_ <<
"] ";
90 if ( x <
lb_ && ( this->
func(x) > threshold ) ) out <<
"TOO SHORT";
91 else if ( x > ub_ && ( this->
func(x) > threshold ) ) out <<
"VIOLATED";
93 if ( verbose_level > 80 ) {
94 out <<
" " <<
type_ <<
"\n";
96 }
else if ( verbose_level > 100 ) {
97 out << x <<
" in[ " <<
lb_ <<
" , " <<
ub_ <<
" ] ";
98 if ( x <
lb_ ) out << (x -
lb_) /
sd_ <<
"\n";
99 else if ( x > ub_ ) out << (x -
ub_) /
sd_ <<
"\n";
101 }
else if (verbose_level > 70 ) {
102 if ( x <
lb_ && ( this->
func(x) > threshold ) ) out <<
"-";
103 else if ( x >
ub_ && ( this->
func(x) > threshold )) out <<
"+";
108 if ( this->
func(x) <= threshold )
return 0;
114 using namespace ObjexxFCL::fmt;
115 std::streamsize
const input_precision(out.precision());
116 out <<
"BOUNDED " << std::setprecision( 4 ) << RJ(7,
lb_) <<
" " << RJ(7,
ub_) <<
" " << RJ(3,
sd_) <<
" ";
119 out << std::setprecision(input_precision) <<
"\n";
124 using namespace ObjexxFCL;
125 basic::Tracer trInfo(
"core.io.constraints", basic::t_info );
129 in.setstate( std::ios_base::failbit );
131 if ( is_float( tag ) ) {
145 using namespace ObjexxFCL::fmt;
146 out <<
"PERIODICITYBOUNDED " << RJ(7, periodicity_) <<
" ";
147 parent::show_definition( out );
154 parent::read_data( in );
161 using namespace ObjexxFCL::fmt;
162 out <<
"OFFSETPERIODICITYBOUNDED offset" << RJ(7, offset_) <<
" period " << RJ(7, periodicity_) <<
" ";
163 parent::show_definition( out );
169 in >> offset_ >> periodicity_ ;
170 parent::read_data( in );