本文整理匯總了C++中Interval::getS方法的典型用法代碼示例。如果您正苦於以下問題:C++ Interval::getS方法的具體用法?C++ Interval::getS怎麽用?C++ Interval::getS使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Interval
的用法示例。
在下文中一共展示了Interval::getS方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: divide_interval
Point divide_interval(Interval tmp, Fraction K)
{
Point tmp_point;
Fraction S_lg_X = tmp.getS().getX();
Fraction S_lg_Y = tmp.getS().getY();
Fraction E_lg_X = tmp.getE().getX();
Fraction E_lg_Y = tmp.getE().getY();
Fraction rvec_X = E_lg_X - S_lg_X;
Fraction rvec_Y = E_lg_Y - S_lg_Y;
if(K.lg_u_() + rvec_X.lg_u_() + S_lg_X.lg_l_() > 17 ||
K.lg_l_() + rvec_X.lg_l_() + S_lg_X.lg_u_() > 17 ||
K.lg_u_() + rvec_Y.lg_u_() + S_lg_Y.lg_l_() > 17 ||
K.lg_l_() + rvec_Y.lg_l_() + S_lg_Y.lg_u_() > 17 ||
K.lg_l_() + rvec_X.lg_l_() + S_lg_X.lg_l_() > 18 ||
K.lg_l_() + rvec_Y.lg_l_() + S_lg_Y.lg_l_() > 18)
{
double tmp_x = S_lg_X.numerical() + K.numerical() * (E_lg_X.numerical() - S_lg_X.numerical());
double tmp_y = S_lg_Y.numerical() + K.numerical() * (E_lg_Y.numerical() - S_lg_Y.numerical());
Fraction x_(tmp_x, 17);
Fraction y_(tmp_y, 17);
return tmp_point.upload(x_, y_);
}
else
{
Fraction x = S_lg_X + K * rvec_X;
Fraction y = S_lg_Y + K * rvec_Y;
return tmp_point.upload(x, y);
}
}
示例2: s
Interval::Interval(Interval const &tmp) : s(tmp.getS()), e(tmp.getE())
{
}