Standard_Real DU0,DU1,Ui,Uj,Eps0,val;
BSplCLib_KnotDistribution KForm = BSplCLib_Uniform;
- Standard_Integer KLower = Knots.Lower();
- const Standard_Real * pkn = &Knots(KLower);
- pkn -= KLower;
- Ui = pkn[FromK1];
+ if (FromK1 + 1 > Knots.Upper())
+ {
+ return BSplCLib_Uniform;
+ }
+
+ Ui = Knots(FromK1);
if (Ui < 0) Ui = - Ui;
- Uj = pkn[FromK1 + 1];
+ Uj = Knots(FromK1 + 1);
if (Uj < 0) Uj = - Uj;
DU0 = Uj - Ui;
if (DU0 < 0) DU0 = - DU0;
Standard_Integer i = FromK1 + 1;
while (KForm != BSplCLib_NonUniform && i < ToK2) {
- Ui = pkn[i];
+ Ui = Knots(i);
if (Ui < 0) Ui = - Ui;
i++;
- Uj = pkn[i];
+ Uj = Knots(i);
if (Uj < 0) Uj = - Uj;
DU1 = Uj - Ui;
if (DU1 < 0) DU1 = - DU1;
First = ToK2;
Last = FromK1;
}
- Standard_Integer MLower = Mults.Lower();
- const Standard_Integer *pmu = &Mults(MLower);
- pmu -= MLower;
- Standard_Integer FirstMult = pmu[First];
+ if (First + 1 > Mults.Upper())
+ {
+ return BSplCLib_Constant;
+ }
+
+ Standard_Integer FirstMult = Mults(First);
BSplCLib_MultDistribution MForm = BSplCLib_Constant;
Standard_Integer i = First + 1;
- Standard_Integer Mult = pmu[i];
+ Standard_Integer Mult = Mults(i);
// while (MForm != BSplCLib_NonUniform && i <= Last) { ???????????JR????????
while (MForm != BSplCLib_NonConstant && i <= Last) {
}
else if (i == Last) {
if (MForm == BSplCLib_QuasiConstant) {
- if (FirstMult != pmu[i]) MForm = BSplCLib_NonConstant;
+ if (FirstMult != Mults(i)) MForm = BSplCLib_NonConstant;
}
else {
- if (Mult != pmu[i]) MForm = BSplCLib_NonConstant;
+ if (Mult != Mults(i)) MForm = BSplCLib_NonConstant;
}
}
else {
- if (Mult != pmu[i]) MForm = BSplCLib_NonConstant;
- Mult = pmu[i];
+ if (Mult != Mults(i)) MForm = BSplCLib_NonConstant;
+ Mult = Mults(i);
}
i++;
}