@@ -57,7 +57,7 @@ void House(MatrixIndexT dim, const Real *x, Real *v, Real *beta) {
5757 if (max_x == 0.0) max_x = 1.0;
5858 s = 1.0 / max_x;
5959 }
60-
60+
6161 Real sigma = 0.0;
6262 v[0] = 1.0;
6363 for (MatrixIndexT i = 1; i < dim; i++) {
@@ -73,7 +73,7 @@ void House(MatrixIndexT dim, const Real *x, Real *v, Real *beta) {
7373 v[0] = x1 - mu;
7474 } else {
7575 v[0] = -sigma / (x1 + mu);
76- KALDI_ASSERT(KALDI_ISFINITE(v[dim-1]));
76+ KALDI_ASSERT(KALDI_ISFINITE(v[dim-1]));
7777 }
7878 Real v1 = v[0];
7979 Real v1sq = v1 * v1;
@@ -155,11 +155,11 @@ void HouseBackward(MatrixIndexT dim, const Real *x, Real *v, Real *beta) {
155155 with packed lower-triangular matrices to do it this way. There's also
156156 a shift from one-based to zero-based indexing, so the index
157157 k is transformed k -> n - k, and a corresponding transpose...
158-
158+
159159 Let the original *this be A. This algorithms replaces *this with
160160 a tridiagonal matrix T such that T = Q A Q^T for an orthogonal Q.
161161 Caution: Q is transposed vs. Golub and Van Loan.
162- If Q != NULL it outputs Q.
162+ If Q != NULL it outputs Q.
163163*/
164164template <typename Real>
165165void SpMatrix<Real>::Tridiagonalize(MatrixBase<Real> *Q) {
@@ -195,7 +195,7 @@ void SpMatrix<Real>::Tridiagonalize(MatrixBase<Real> *Q) {
195195 if (Q != NULL ) { // C.f. Golub, Q is H_1 .. H_n-2... in this
196196 // case we apply them in the opposite order so it's H_n-1 .. H_1,
197197 // but also Q is transposed so we really have Q = H_1 .. H_n-1.
198- // It's a double negative.
198+ // It's a double negative.
199199 // Anyway, we left-multiply Q by each one. The H_n would each be
200200 // diag(I + beta v v', I) but we don't ever touch the last dims.
201201 // We do (in Matlab notation):
@@ -309,7 +309,7 @@ void QrStep(MatrixIndexT n,
309309 if (k < n-2 ) {
310310 // Next is the elements (k+2, k) and (k+2, k-1), to be rotated, again
311311 // backwards.
312- Real &elem_kp2_k = z,
312+ Real &elem_kp2_k = z,
313313 &elem_kp2_kp1 = off_diag[k+1 ];
314314 // Note: elem_kp2_k == z would start off as zero because it's
315315 // two off the diagonal, and not been touched yet. Therefore
@@ -338,7 +338,7 @@ void QrInternal(MatrixIndexT n,
338338 MatrixIndexT counter = 0 , max_iters = 500 + 4 *n, // Should never take this many iters.
339339 large_iters = 100 + 2 *n;
340340 Real epsilon = (pow (2.0 , sizeof (Real) == 4 ? -23.0 : -52.0 ));
341-
341+
342342 for (; counter < max_iters; counter++) { // this takes the place of "until
343343 // q=n"... we'll break out of the
344344 // loop when we converge.
@@ -356,7 +356,7 @@ void QrInternal(MatrixIndexT n,
356356 off_diag[i] = 0.0 ;
357357 }
358358 // The next code works out p, q, and npq which is n - p - q.
359- // For the definitions of q and p, see Golub and Van Loan; we
359+ // For the definitions of q and p, see Golub and Van Loan; we
360360 // partition the n dims into pieces of size (p, n-p-q, q) where
361361 // the part of size q is diagonal and the part of size n-p-p is
362362 // "unreduced", i.e. has no zero off-diagonal elements.
@@ -392,7 +392,7 @@ void QrInternal(MatrixIndexT n,
392392 } else {
393393 QrStep (npq, diag + p, off_diag + p,
394394 static_cast <MatrixBase<Real>*>(NULL ));
395- }
395+ }
396396 }
397397 if (counter == max_iters) {
398398 KALDI_WARN << " Failure to converge in QR algorithm. "
@@ -490,7 +490,7 @@ void SpMatrix<Real>::TopEigs(VectorBase<Real> *s, MatrixBase<Real> *P,
490490 r.AddSpVec (1.0 , S, Q.Row (d), 0.0 );
491491 // r = S * q_d
492492 MatrixIndexT counter = 0 ;
493- Real end_prod;
493+ Real end_prod = 0 ;
494494 while (1 ) { // Normally we'll do this loop only once:
495495 // we repeat to handle cases where r gets very much smaller
496496 // and we want to orthogonalize again.
@@ -528,11 +528,11 @@ void SpMatrix<Real>::TopEigs(VectorBase<Real> *s, MatrixBase<Real> *P,
528528 }
529529 }
530530
531- Matrix<Real> R (lanczos_dim, lanczos_dim);
531+ Matrix<Real> R (lanczos_dim, lanczos_dim);
532532 R.SetUnit ();
533533 T.Qr (&R); // Diagonalizes T.
534534 Vector<Real> s_tmp (lanczos_dim);
535- s_tmp.CopyDiagFromSp (T);
535+ s_tmp.CopyDiagFromSp (T);
536536
537537 // Now T = R * diag(s_tmp) * R^T.
538538 // The next call sorts the elements of s from greatest to least absolute value,
@@ -544,7 +544,7 @@ void SpMatrix<Real>::TopEigs(VectorBase<Real> *s, MatrixBase<Real> *P,
544544 SubMatrix<Real> Rsub (R, 0 , eig_dim, 0 , lanczos_dim);
545545 SubVector<Real> s_sub (s_tmp, 0 , eig_dim);
546546 s->CopyFromVec (s_sub);
547-
547+
548548 // For working out what to do now, just assume the other eigenvalues were
549549 // zero. This is just for purposes of knowing how to get the result, and
550550 // not getting things wrongly transposed.
0 commit comments