Commit b7b6a7e 1 parent e0e3924 commit b7b6a7e Copy full SHA for b7b6a7e
File tree 2 files changed +8
-9
lines changed
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 54
54
# cmake ..
55
55
# make -j
56
56
# sudo make install
57
- #
57
+
58
58
- name : Create Build Directory
59
59
run : cmake -E make_directory ${{runner.workspace}}/build
60
60
72
72
# shell: bash
73
73
# working-directory: ${{github.workspace}}
74
74
# run: ./scripts/run_cppcheck.sh ${{runner.workspace}}/build
75
- #
75
+
76
76
- name : Install clang-tidy
77
77
run : |
78
78
sudo apt-get install clang-tidy-9
Original file line number Diff line number Diff line change 7
7
#ifndef K2_CSRC_UTIL_H_
8
8
#define K2_CSRC_UTIL_H_
9
9
10
+ #include < cfloat>
11
+ #include < cmath>
10
12
#include < functional>
11
13
#include < utility>
12
14
@@ -31,8 +33,8 @@ struct PairHash {
31
33
}
32
34
};
33
35
34
- static const double kMinLogDiffDouble = Log (DBL_EPSILON); // negative!
35
- static const float kMinLogDiffFloat = Log (FLT_EPSILON); // negative!
36
+ static const double kMinLogDiffDouble = log (DBL_EPSILON); // negative!
37
+ static const float kMinLogDiffFloat = log (FLT_EPSILON); // negative!
36
38
37
39
// returns log(exp(x) + exp(y)).
38
40
inline double LogAdd (double x, double y) {
@@ -48,14 +50,13 @@ inline double LogAdd(double x, double y) {
48
50
49
51
if (diff >= kMinLogDiffDouble ) {
50
52
double res;
51
- res = x + Log1p ( Exp (diff));
53
+ res = x + log1p ( exp (diff));
52
54
return res;
53
55
} else {
54
56
return x; // return the larger one.
55
57
}
56
58
}
57
59
58
-
59
60
// returns log(exp(x) + exp(y)).
60
61
inline float LogAdd (float x, float y) {
61
62
float diff;
@@ -70,14 +71,12 @@ inline float LogAdd(float x, float y) {
70
71
71
72
if (diff >= kMinLogDiffFloat ) {
72
73
float res;
73
- res = x + Log1p ( Exp (diff));
74
+ res = x + log1p ( exp (diff));
74
75
return res;
75
76
} else {
76
77
return x; // return the larger one.
77
78
}
78
79
}
79
80
80
-
81
-
82
81
} // namespace k2
83
82
#endif // K2_CSRC_UTIL_H_
You can’t perform that action at this time.
0 commit comments