@@ -43,9 +43,9 @@ const double* LightSpectrum::getHistogram() const { return _histogram; }
4343
4444bool LightSpectrum::addFlux (const double b[], const double azero)
4545{
46- double a0 = std::max (azero, 0 .);
46+ double a0 = fmax (azero, 0 .);
4747 for (int i = 0 ; i < LIGHTSPECTRUM_NUM_BINS_BASE; ++i) {
48- double f = std::max (b[i], 0 .);
48+ double f = fmax (b[i], 0 .);
4949 this ->_histogram [i] += f;
5050 this ->_histogram [LIGHTSPECTRUM_TOTAL_ENERGY_INDEX] += f;
5151 double corrected = f * pow (10 , 0.4 * a0 * EXTINCTION_CURVE[i] / 3.1 );
@@ -57,16 +57,16 @@ bool LightSpectrum::addFlux(const double b[], const double azero)
5757
5858bool LightSpectrum::addPhotometry (double rp, double g, double bp)
5959{
60- this ->_histogram [LIGHTSPECTRUM_RP_INDEX] += std::max (rp, 0 .);
61- this ->_histogram [LIGHTSPECTRUM_G_INDEX] += std::max (g, 0 .);
62- this ->_histogram [LIGHTSPECTRUM_BP_INDEX] += std::max (bp, 0 .);
60+ this ->_histogram [LIGHTSPECTRUM_RP_INDEX] += fmax (rp, 0 .);
61+ this ->_histogram [LIGHTSPECTRUM_G_INDEX] += fmax (g, 0 .);
62+ this ->_histogram [LIGHTSPECTRUM_BP_INDEX] += fmax (bp, 0 .);
6363 return true ;
6464}
6565
6666
6767bool LightSpectrum::addTemperature (double temperature)
6868{
69- this ->_histogram [LIGHTSPECTRUM_TEMPERATURE_INDEX] += std::max (temperature, 0 .);
69+ this ->_histogram [LIGHTSPECTRUM_TEMPERATURE_INDEX] += fmax (temperature, 0 .);
7070 this ->_histogram [LIGHTSPECTRUM_TEMPERATURE_COUNT_INDEX] += temperature > 0 ;
7171 return true ;
7272}
@@ -76,22 +76,22 @@ LightSpectrum LightSpectrum::operator+(const LightSpectrum& b)
7676{
7777 LightSpectrum ls;
7878 for (int i = 0 ; i < LIGHTSPECTRUM_NUM_BINS_TOTAL; ++i)
79- ls._histogram [i] = std::max (this ->_histogram [i] + b._histogram [i], 0 .);
79+ ls._histogram [i] = fmax (this ->_histogram [i] + b._histogram [i], 0 .);
8080 return ls;
8181}
8282
8383LightSpectrum LightSpectrum::operator -(const LightSpectrum& b)
8484{
8585 LightSpectrum ls;
8686 for (int i = 0 ; i < LIGHTSPECTRUM_NUM_BINS_TOTAL; ++i)
87- ls._histogram [i] = std::max (0 ., this ->_histogram [i] - b._histogram [i]);
87+ ls._histogram [i] = fmax (0 ., this ->_histogram [i] - b._histogram [i]);
8888 return ls;
8989}
9090
9191LightSpectrum & LightSpectrum::operator +=(const LightSpectrum &b)
9292{
9393 for (int i = 0 ; i < LIGHTSPECTRUM_NUM_BINS_TOTAL; ++i)
94- this ->_histogram [i] += std::max (b._histogram [i], 0 .);
94+ this ->_histogram [i] += fmax (b._histogram [i], 0 .);
9595 return *this ;
9696}
9797
0 commit comments