Skip to content

Commit fc35980

Browse files
committed
Fixed Linux warnings
1 parent f603d9d commit fc35980

8 files changed

+19
-34
lines changed

docs/HTML/pca_by_eigen.html

+1-14
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,6 @@
9898
</td>
9999
</tr>
100100

101-
102-
103-
104-
105-
106-
107-
108-
109-
110-
111-
112-
113-
114101
<tr bgcolor="Azure">
115102
<td bgcolor="blue"> <font color="white">
116103
<PRE><B>
@@ -129,7 +116,7 @@
129116
In linear algebra, SVD is a factorization of a real or complex matrix into a rotation, followed by a rescaling followed by another rotation. It generalizes the eigen-decomposition of a square normal matrix with an orthonormal eigenbasis to any ⁠mXn matrix.<BR>
130117
It returns the 3 metrices U, &Sigma;, and V inside a std::tuple.<BR><BR>
131118
<I>U</I> contains the left singular vectors of the original matrix, meaning its columns are orthonormal vectors that span the row space of the matrix.<BR>
132-
<I>S</I> is a diagonal matrix that contains sqrt of eigenvalues of the original matrix, arranged in descending order.<BR>
119+
<I>&Sigma;</I> is a diagonal matrix that contains sqrt of eigenvalues of the original matrix, arranged in descending order.<BR>
133120
<I>V</I> contains the right singular vectors of the original matrix, represented as its columns.<BR>
134121
Original matrix (A) = U * &Sigma; * V<sup>T</sup><BR>
135122
</td>

include/DataFrame/DataFrameMLVisitors.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,7 @@ struct AffinityPropVisitor {
490490
const long col_s = std::min(std::distance(idx_begin, idx_end),
491491
std::distance(column_begin, column_end));
492492

493-
const vec_t<double> simil =
494-
std::move(get_similarity_(column_begin, col_s));
493+
const vec_t<double> simil = get_similarity_(column_begin, col_s);
495494
vec_t<double> avail;
496495
vec_t<double> respon;
497496

include/DataFrame/DataFrameStatsVisitors.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3689,7 +3689,7 @@ struct SymmTriangleMovingMeanVisitor {
36893689
break;
36903690

36913691
const auto triangle =
3692-
std::move(gen_sym_triangle<value_type>(roll_period_, 1, true));
3692+
gen_sym_triangle<value_type>(roll_period_, 1, true);
36933693
result_type result (col_s, std::numeric_limits<T>::quiet_NaN());
36943694

36953695
for (size_type i { starting + roll_period_ };

include/DataFrame/Internals/DataFrame_misc.tcc

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ DataFrame<I, H>::print_binary_functor_<Ts ...>::operator() (const T &vec) {
238238

239239
char col_name[64];
240240

241-
std::strncpy(col_name, name, sizeof(col_name));
241+
std::strncpy(col_name, name, sizeof(col_name) - 1);
242242
os.write(col_name, sizeof(col_name));
243243

244244
const long local_start_row = std::min (long(vec.size()), start_row);

include/DataFrame/Internals/DataFrame_read.tcc

+2-1
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,8 @@ read_csv2_(std::FILE *stream,
787787
spec_vec.reserve(32);
788788
while (! std::feof(stream)) {
789789
line[0] = '\0';
790-
std::fgets(line, sizeof(line) - 1, stream);
790+
if (std::fgets(line, sizeof(line) - 1, stream) == nullptr)
791+
continue;
791792

792793
if (line[0] == '\0' || line[0] == '#') [[unlikely]] continue;
793794

include/DataFrame/Internals/DataFrame_set.tcc

+3-5
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void DataFrame<I, H>::remove_column (const char *name) {
7474

7575
// Free the memory space
7676
//
77-
vec = std::move(ColumnVecType<T>{ });
77+
vec = ColumnVecType<T>{ };
7878

7979
// I do not erase the column from the data_ vector, because it will mess up
8080
// indices in the hash table column_tb_
@@ -213,8 +213,7 @@ DataFrame<I, H>::load_data (IndexVecType &&indices, Ts&& ... args) {
213213
"Only a StdDataFrame can call load_data()");
214214

215215
size_type cnt = load_index(std::forward<IndexVecType>(indices));
216-
auto args_tuple =
217-
std::move(std::tuple<Ts ...>(std::forward<Ts>(args) ...));
216+
auto args_tuple = std::tuple<Ts ...>(std::forward<Ts>(args) ...);
218217
// const size_type tuple_size =
219218
// std::tuple_size<decltype(args_tuple)>::value;
220219
auto fc = [this, &cnt](auto &pa) mutable -> void {
@@ -837,8 +836,7 @@ DataFrame<I, H>::append_row (IndexType *idx_val, Ts&& ... args) {
837836
indices_.push_back(*idx_val);
838837

839838
size_type cnt = 1;
840-
auto args_tuple =
841-
std::move(std::tuple<Ts ...>(std::forward<Ts>(args) ...));
839+
auto args_tuple = std::tuple<Ts ...>(std::forward<Ts>(args) ...);
842840
auto fc = [this, &cnt](auto &pa) mutable -> void {
843841
cnt += this->append_row_(pa);
844842
};

include/DataFrame/Internals/DataFrame_standalone.tcc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1067,9 +1067,9 @@ _write_binary_common_(STRM &strm, [[maybe_unused]] const V &vec,
10671067
const auto &citer = _typeinfo_name_.find(typeid(ValueType));
10681068

10691069
if (citer != _typeinfo_name_.end()) [[likely]]
1070-
std::strncpy(buffer, citer->second, sizeof(buffer));
1070+
std::strncpy(buffer, citer->second, sizeof(buffer) - 1);
10711071
else
1072-
std::strncpy(buffer, "N/A", sizeof(buffer));
1072+
std::strncpy(buffer, "N/A", sizeof(buffer) - 1);
10731073
strm.write(buffer, sizeof(buffer));
10741074

10751075
const uint64_t vec_size = end_row - start_row;

include/DataFrame/Utils/Matrix.tcc

+8-8
Original file line numberDiff line numberDiff line change
@@ -473,14 +473,14 @@ hessenberg_to_schur_(MA1 &e_vecs,
473473
size_type iter { 0 };
474474
size_type n { e_vecs.cols() - 1 };
475475
value_type exshift { 0 };
476-
value_type p;
477-
value_type q;
478-
value_type oo;
479-
value_type s;
480-
value_type z;
481-
value_type w;
482-
value_type x;
483-
value_type y;
476+
value_type p { 0 };
477+
value_type q { 0 };
478+
value_type oo { 0 };
479+
value_type s { 0 };
480+
value_type z { 0 };
481+
value_type w { 0 };
482+
value_type x { 0 };
483+
value_type y { 0 };
484484

485485
// Outer loop over eigenvalue index
486486
//

0 commit comments

Comments
 (0)