mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
GENERIC_2D_ARRAY: Pass parameters by reference
This fixes warnings from LGTM: This parameter of type FontClassInfo is 192 bytes - consider passing a pointer/reference instead. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
a7982185c9
commit
238c872753
@ -365,7 +365,7 @@ class GENERIC_2D_ARRAY {
|
||||
}
|
||||
|
||||
// Accumulates the element-wise sums of squares of src into *this.
|
||||
void SumSquares(const GENERIC_2D_ARRAY<T>& src, T decay_factor) {
|
||||
void SumSquares(const GENERIC_2D_ARRAY<T>& src, const T& decay_factor) {
|
||||
T update_factor = 1.0 - decay_factor;
|
||||
int size = num_elements();
|
||||
for (int i = 0; i < size; ++i) {
|
||||
@ -377,7 +377,7 @@ class GENERIC_2D_ARRAY {
|
||||
// Scales each element using the adam algorithm, ie array_[i] by
|
||||
// sqrt(sqsum[i] + epsilon)).
|
||||
void AdamUpdate(const GENERIC_2D_ARRAY<T>& sum,
|
||||
const GENERIC_2D_ARRAY<T>& sqsum, T epsilon) {
|
||||
const GENERIC_2D_ARRAY<T>& sqsum, const T& epsilon) {
|
||||
int size = num_elements();
|
||||
for (int i = 0; i < size; ++i) {
|
||||
array_[i] += sum.array_[i] / (sqrt(sqsum.array_[i]) + epsilon);
|
||||
|
Loading…
Reference in New Issue
Block a user