1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Coding - Fixing clang-tidy warnings #207

First iteration for fixing warnings for:
- TKernel
- TKMath
- TKGeomBase
This commit is contained in:
dpasukhi
2024-12-21 15:32:44 +00:00
parent 0ffcc44c82
commit f7dea47c33
35 changed files with 93 additions and 161 deletions

View File

@@ -52,7 +52,7 @@ void math_BissecNewton::Perform(math_FunctionWithDerivative& F,
Standard_Boolean GOOD;
Standard_Integer j;
Standard_Real dxold, fh, fl;
Standard_Real swap, temp, xh, xl;
Standard_Real temp, xh, xl;
GOOD = F.Values(Bound1, fl, df);
if(!GOOD) {
@@ -83,9 +83,6 @@ void math_BissecNewton::Perform(math_FunctionWithDerivative& F,
else {
xl = Bound2;
xh = Bound1;
swap = fl;
fl = fh;
fh = swap;
}
// Modified by Sergey KHROMOV - Wed Jan 22 12:06:49 2003 End
x = 0.5 * (Bound1 + Bound2);
@@ -133,11 +130,9 @@ void math_BissecNewton::Perform(math_FunctionWithDerivative& F,
}
if(f < 0.0) {
xl = x;
fl = f;
}
else if(f > 0.0) {
xh = x;
fh = f;
}
else {
TheStatus = math_OK;

View File

@@ -90,7 +90,7 @@ void math_Householder::Perform(const math_Matrix& A, const math_Matrix& B,
const Standard_Real EPS) {
Standard_Integer i, j, k, n, l, m;
Standard_Real scale, f, g, h = 0., alfaii;
Standard_Real f, g, h = 0., alfaii;
Standard_Real qki;
Standard_Real cj;
n = Q.ColNumber();
@@ -112,7 +112,7 @@ void math_Householder::Perform(const math_Matrix& A, const math_Matrix& B,
// Traitement de chaque colonne de A:
for (i = 1; i <= n; i++) {
h = scale = 0.0;
h = 0.0;
for (k = i; k <= l; k++) {
qki = Q(k, i);
h += qki*qki; // = ||a||*||a|| = EUAI
@@ -126,7 +126,7 @@ void math_Householder::Perform(const math_Matrix& A, const math_Matrix& B,
h -= f*g; // = (v*v)/2 = C1
alfaii = g-f; // = v = ALFAII
for (j =i+1; j <= n; j++) {
scale = 0.0;
Standard_Real scale = 0.0;
for (k = i; k <= l; k++) {
scale += Q(k,i)* Q(k,j); // = SCAL
}
@@ -140,7 +140,7 @@ void math_Householder::Perform(const math_Matrix& A, const math_Matrix& B,
// Modification de B:
for (j = 1; j <= m; j++) {
scale= Q(i,i)*B2(i,j);
Standard_Real scale= Q(i,i)*B2(i,j);
for (k = i+1; k <= l; k++) {
scale += Q(k,i)*B2(k,j);
}
@@ -158,7 +158,7 @@ void math_Householder::Perform(const math_Matrix& A, const math_Matrix& B,
for (j = 1; j <= m; j++) {
Sol(n,j) = B2(n,j)/Q(n,n);
for (i = n -1; i >=1; i--) {
scale= 0.0;
Standard_Real scale= 0.0;
for(k = i+1; k <= n; k++) {
scale += Q(i,k) * Sol(k,j);
}

View File

@@ -92,7 +92,6 @@ void math_NewtonMinimum::Perform(math_MultipleVarFunctionWithHessian& F,
math_Vector Point2(1, F.NbVariables());
math_Vector* precedent = &Point1;
math_Vector* suivant = &Point2;
math_Vector* auxiliaire = precedent;
Standard_Boolean Ok = Standard_True;
Standard_Integer NbConv = 0, ii, Nreduction;
@@ -234,7 +233,7 @@ void math_NewtonMinimum::Perform(math_MultipleVarFunctionWithHessian& F,
}
if (VItere <= VPrecedent) {
auxiliaire = precedent;
math_Vector* auxiliaire = precedent;
precedent = suivant;
suivant = auxiliaire;
PreviousMinimum = VPrecedent;

View File

@@ -314,7 +314,7 @@ Standard_Integer SVD_Decompose(math_Matrix& a,
math_Vector& rv1) {
Standard_Integer flag, i, its, j, jj, k, l=0, nm=0;
Standard_Real ar, aw, aik, aki, c, f, h, s, x, y, z;
Standard_Real ar, aw, aik, aki, f, h, s, x, y, z;
Standard_Real anorm = 0.0, g = 0.0, scale = 0.0;
Standard_Integer m = a.RowNumber();
Standard_Integer n = a.ColNumber();
@@ -445,7 +445,6 @@ Standard_Integer SVD_Decompose(math_Matrix& a,
if(fabs(w(nm)) + anorm == anorm) break;
}
if(flag) {
c = 0.0;
s = 1.0;
for(i = l; i <= k; i++) {
f = s * rv1(i);
@@ -454,7 +453,7 @@ Standard_Integer SVD_Decompose(math_Matrix& a,
h = PYTHAG(f, g);
w(i) = h;
h = 1.0 / h;
c = g * h;
Standard_Real c = g * h;
s = (-f * h);
for(j = 1; j <= m; j++) {
y = a(j,nm);
@@ -486,7 +485,7 @@ Standard_Integer SVD_Decompose(math_Matrix& a,
g = PYTHAG(f, 1.0);
f = ((x - z) * (x + z) + h * ((y / ( f + SIGN(g, f))) - h)) / x;
c = s = 1.0;
Standard_Real c = s = 1.0;
for(j = l; j <= nm; j++) {
i = j + 1;
g = rv1(i);