101 if (lim && lim !=
'r') {
122 switch (f2.
Which()) {
133 SetAlt().push_back(*it + n1 - n2);
146 static const double kInfinity = 1.0e20;
147 bool hit_pct =
false, hit_unk =
false, hit_circle =
false;
148 double min_delta = 0.0, max_delta = 0.0;
150 for (
int i = 0;
i < 2; ++
i) {
156 min_delta -=
f.GetP_m();
157 max_delta +=
f.GetP_m();
161 min_delta -=
n -
f.GetRange().GetMin();
162 max_delta +=
f.GetRange().GetMax() -
n;
166 min_delta -= 0.001 *
n *
f.GetPct();
167 max_delta += 0.001 *
n *
f.GetPct();
172 switch (
f.GetLim()) {
175 min_delta = -kInfinity;
178 max_delta = kInfinity;
181 min_delta = -kInfinity;
201 if (
f.GetAlt().empty()) {
211 min_delta = max_delta =
f.GetAlt().front();
213 if (*it < min_delta) {
215 }
else if (*it > max_delta) {
219 min_delta += *
offsets.rbegin();
238 if (
mode ==
eReduce && max_delta - min_delta < kInfinity / 2) {
239 swap(min_delta, max_delta);
243 if (min_delta > max_delta) {
244 swap(min_delta, max_delta);
250 if (min_delta < -kInfinity / 2) {
251 if (max_delta > kInfinity / 2) {
265 }
else if (max_delta > kInfinity / 2) {
271 }
else if ( !
offsets.empty() ) {
272 if (max_delta - min_delta < 0.5) {
276 alt.push_back(n1 + *it + min_delta_sp);
280 min_delta += *
offsets.rbegin();
282 if (min_delta > max_delta) {
283 swap(min_delta, max_delta);
285 r.SetMin(n1 + min_delta_sp);
286 r.SetMax(n1 + max_delta_sp);
290 r.SetMin(n1 + min_delta_sp + *
offsets.begin());
291 r.SetMax(n1 + max_delta_sp + *
offsets.rbegin());
293 }
else if (max_delta - min_delta < 0.5) {
294 double delta = 0.5 * (min_delta + max_delta);
295 double rdelta = floor(
delta + 0.5);
297 if (
delta - rdelta > 0.25) {
299 }
else if (
delta - rdelta < -0.25) {
301 }
else if (hit_circle) {
306 }
else if (hit_pct) {
307 n1 += (
TSignedSeqPos)floor(0.5 * (min_delta + max_delta + 1));
308 SetPct((
TSeqPos)floor(500.0 * (max_delta - min_delta) / n1 + 0.5));
309 }
else if (min_delta + max_delta < 0.5) {
313 r.SetMin(n1 + min_delta_sp);
314 r.SetMax(n1 + max_delta_sp);
330 r.SetMax(
n +
n -
r.GetMin());
331 r.SetMin(
n +
n - old_max);
void Add(const CInt_fuzz &f2, TSeqPos &n1, TSeqPos n2, ECombine mode=eAmplify)
void AssignTranslated(const CInt_fuzz &f2, TSeqPos n1, TSeqPos n2)
n1 and n2 are the targets of the fuzz
@ eReduce
go for the smallest range that allows each value individually to vary freely as long as the other bal...
void GetLabel(string *label, TSeqPos pos, bool right=true) const
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
int TSignedSeqPos
Type for signed sequence position.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static const char label[]
void SetMin(TMin value)
Assign a value to Min data member.
TRange & SetRange(void)
Select the variant.
TAlt & SetAlt(void)
Select the variant.
TPct GetPct(void) const
Get the variant data.
TLim GetLim(void) const
Get the variant data.
TP_m & SetP_m(void)
Select the variant.
TMin GetMin(void) const
Get the Min member data.
void SetMax(TMax value)
Assign a value to Max data member.
E_Choice Which(void) const
Which variant is currently selected.
TLim & SetLim(void)
Select the variant.
const TAlt & GetAlt(void) const
Get the variant data.
TPct & SetPct(void)
Select the variant.
TMax GetMax(void) const
Get the Max member data.
TP_m GetP_m(void) const
Get the variant data.
const TRange & GetRange(void) const
Get the variant data.
@ eLim_other
something else
@ eLim_circle
artificial break at origin of circle
@ eLim_tl
space to left of position
@ eLim_tr
space to right of position
@ e_Pct
% plus or minus (x10) 0-1000
@ e_Alt
set of alternatives for the integer
@ e_P_m
plus or minus fixed amount
Int4 delta(size_t dimension_, const Int4 *score_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
double f(double x_, const double &y_)
static PCRE2_SIZE * offsets