Skip to content

Commit

Permalink
delete unused returned variable from gauss_newton()
Browse files Browse the repository at this point in the history
  • Loading branch information
w3ntao committed Sep 17, 2023
1 parent 83e4599 commit 880346c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pbrt/cmd/rgb2spec_opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ void eval_jacobian(const double *coeffs, const double *rgb, double **jac) {
}
}

double gauss_newton(const double rgb[3], double coeffs[3], int it = 15) {
void gauss_newton(const double rgb[3], double coeffs[3], int it = 15) {
double r = 0;
for (int i = 0; i < it; ++i) {
double J0[3], J1[3], J2[3], *J[3] = {J0, J1, J2};
Expand Down Expand Up @@ -567,7 +567,6 @@ double gauss_newton(const double rgb[3], double coeffs[3], int it = 15) {
if (r < 1e-6)
break;
}
return std::sqrt(r);
}

static Gamut parse_gamut(const char *str) {
Expand Down Expand Up @@ -841,8 +840,7 @@ int main(int argc, char **argv) {
rgb[(l + 1) % 3] = x * b;
rgb[(l + 2) % 3] = y * b;

double resid = gauss_newton(rgb, coeffs);
(void)resid;
gauss_newton(rgb, coeffs);

double c0 = 360.0, c1 = 1.0 / (830.0 - 360.0);
double A = coeffs[0], B = coeffs[1], C = coeffs[2];
Expand All @@ -863,8 +861,7 @@ int main(int argc, char **argv) {
rgb[(l + 1) % 3] = x * b;
rgb[(l + 2) % 3] = y * b;

double resid = gauss_newton(rgb, coeffs);
(void)resid;
gauss_newton(rgb, coeffs);

double c0 = 360.0, c1 = 1.0 / (830.0 - 360.0);
double A = coeffs[0], B = coeffs[1], C = coeffs[2];
Expand Down

0 comments on commit 880346c

Please sign in to comment.