Mercurial > octave-nkf
comparison liboctave/numeric/oct-norm.cc @ 18084:8e056300994b
Follow coding convention of defining and initializing only 1 variable per line in liboctave.
* liboctave/array/Array-b.cc, liboctave/array/Array-util.cc,
liboctave/array/Array.cc, liboctave/array/CDiagMatrix.cc,
liboctave/array/CMatrix.cc, liboctave/array/CSparse.cc,
liboctave/array/MDiagArray2.cc, liboctave/array/MatrixType.cc,
liboctave/array/PermMatrix.cc, liboctave/array/Sparse.cc,
liboctave/array/Sparse.h, liboctave/array/boolSparse.cc,
liboctave/array/dDiagMatrix.cc, liboctave/array/dMatrix.cc,
liboctave/array/dSparse.cc, liboctave/array/dim-vector.cc,
liboctave/array/fCDiagMatrix.cc, liboctave/array/fCMatrix.cc,
liboctave/array/fDiagMatrix.cc, liboctave/array/fMatrix.cc,
liboctave/array/idx-vector.cc, liboctave/array/idx-vector.h,
liboctave/numeric/CmplxLU.cc, liboctave/numeric/CmplxQR.cc,
liboctave/numeric/base-qr.cc, liboctave/numeric/bsxfun-defs.cc,
liboctave/numeric/bsxfun.h, liboctave/numeric/dbleLU.cc,
liboctave/numeric/dbleQR.cc, liboctave/numeric/fCmplxLU.cc,
liboctave/numeric/fCmplxQR.cc, liboctave/numeric/floatLU.cc,
liboctave/numeric/floatQR.cc, liboctave/numeric/lo-specfun.cc,
liboctave/numeric/oct-convn.cc, liboctave/numeric/oct-norm.cc,
liboctave/numeric/sparse-dmsolve.cc, liboctave/operators/mx-inlines.cc,
liboctave/operators/mx-op-defs.h, liboctave/util/caseless-str.h,
liboctave/util/kpse.cc, liboctave/util/lo-utils.cc,
liboctave/util/oct-binmap.h, liboctave/util/oct-cmplx.h,
liboctave/util/oct-inttypes.cc, liboctave/util/oct-inttypes.h,
liboctave/util/oct-sort.cc:
Follow coding convention of defining and initializing only 1 variable per line in liboctave.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 04 Dec 2013 22:13:18 -0800 |
parents | 49a5a4be04a1 |
children | 65554f5847ac |
comparison
equal
deleted
inserted
replaced
18083:938f01339043 | 18084:8e056300994b |
---|---|
325 { | 325 { |
326 R nrm = 0; | 326 R nrm = 0; |
327 for (octave_idx_type i = 0; i < nsamp; i++) | 327 for (octave_idx_type i = 0; i < nsamp; i++) |
328 { | 328 { |
329 octave_quit (); | 329 octave_quit (); |
330 R fi = i*M_PI/nsamp, lambda1 = cos (fi), mu1 = sin (fi); | 330 R fi = i*M_PI/nsamp; |
331 R lambda1 = cos (fi); | |
332 R mu1 = sin (fi); | |
331 R lmnr = std::pow (std::pow (std::abs (lambda1), p) + | 333 R lmnr = std::pow (std::pow (std::abs (lambda1), p) + |
332 std::pow (std::abs (mu1), p), 1/p); | 334 std::pow (std::abs (mu1), p), 1/p); |
333 lambda1 /= lmnr; mu1 /= lmnr; | 335 lambda1 /= lmnr; mu1 /= lmnr; |
334 R nrm1 = vector_norm (lambda1 * y + mu1 * col, p); | 336 R nrm1 = vector_norm (lambda1 * y + mu1 * col, p); |
335 if (nrm1 > nrm) | 337 if (nrm1 > nrm) |
356 CR lamcu = lambda / std::abs (lambda); | 358 CR lamcu = lambda / std::abs (lambda); |
357 // Probe magnitudes | 359 // Probe magnitudes |
358 for (octave_idx_type i = 0; i < nsamp; i++) | 360 for (octave_idx_type i = 0; i < nsamp; i++) |
359 { | 361 { |
360 octave_quit (); | 362 octave_quit (); |
361 R fi = i*M_PI/nsamp, lambda1 = cos (fi), mu1 = sin (fi); | 363 R fi = i*M_PI/nsamp; |
364 R lambda1 = cos (fi); | |
365 R mu1 = sin (fi); | |
362 R lmnr = std::pow (std::pow (std::abs (lambda1), p) + | 366 R lmnr = std::pow (std::pow (std::abs (lambda1), p) + |
363 std::pow (std::abs (mu1), p), 1/p); | 367 std::pow (std::abs (mu1), p), 1/p); |
364 lambda1 /= lmnr; mu1 /= lmnr; | 368 lambda1 /= lmnr; mu1 /= lmnr; |
365 R nrm1 = vector_norm (lambda1 * lamcu * y + mu1 * col, p); | 369 R nrm1 = vector_norm (lambda1 * lamcu * y + mu1 * col, p); |
366 if (nrm1 > nrm) | 370 if (nrm1 > nrm) |
413 { | 417 { |
414 x.resize (m.columns (), 1); | 418 x.resize (m.columns (), 1); |
415 // the OSE part | 419 // the OSE part |
416 VectorT y(m.rows (), 1, 0), z(m.rows (), 1); | 420 VectorT y(m.rows (), 1, 0), z(m.rows (), 1); |
417 typedef typename VectorT::element_type RR; | 421 typedef typename VectorT::element_type RR; |
418 RR lambda = 0, mu = 1; | 422 RR lambda = 0; |
423 RR mu = 1; | |
419 for (octave_idx_type k = 0; k < m.columns (); k++) | 424 for (octave_idx_type k = 0; k < m.columns (); k++) |
420 { | 425 { |
421 octave_quit (); | 426 octave_quit (); |
422 VectorT col (m.column (k)); | 427 VectorT col (m.column (k)); |
423 if (k > 0) | 428 if (k > 0) |