Mercurial > hg > octave-lojdl
changeset 10145:fa01c1670b3e
make p-norms breakable
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 20 Jan 2010 12:24:00 +0100 |
parents | 1b883ce66707 |
children | 9597eea7fa36 |
files | liboctave/ChangeLog liboctave/oct-norm.cc |
diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2010-01-20 Jaroslav Hajek <highegg@gmail.com> + + * oct-norm.cc (norm_accumulator_p::accum, norm_accumulator_mp::accum): + Call octave_quit here. + (higham_subp): Also here. + 2010-01-20 Jaroslav Hajek <highegg@gmail.com> * mx-op-defs.h (SND_MINMAX_FCN, NDS_MINMAX_FCN, NDND_MINMAX_FCN):
--- a/liboctave/oct-norm.cc +++ b/liboctave/oct-norm.cc @@ -73,6 +73,7 @@ template<class U> void accum (U val) { + octave_quit (); R t = std::abs (val); if (scl == t) // we need this to handle Infs properly sum += 1; @@ -100,6 +101,7 @@ template<class U> void accum (U val) { + octave_quit (); R t = 1 / std::abs (val); if (scl == t) sum += 1; @@ -324,6 +326,7 @@ R nrm = 0; for (octave_idx_type i = 0; i < nsamp; i++) { + octave_quit (); R fi = i*M_PI/nsamp, lambda1 = cos (fi), mu1 = sin (fi); R lmnr = std::pow (std::pow (std::abs (lambda1), p) + std::pow (std::abs (mu1), p), 1/p); @@ -354,6 +357,7 @@ // Probe magnitudes for (octave_idx_type i = 0; i < nsamp; i++) { + octave_quit (); R fi = i*M_PI/nsamp, lambda1 = cos (fi), mu1 = sin (fi); R lmnr = std::pow (std::pow (std::abs (lambda1), p) + std::pow (std::abs (mu1), p), 1/p); @@ -370,6 +374,7 @@ // Probe orientation for (octave_idx_type i = 0; i < nsamp; i++) { + octave_quit (); R fi = i*M_PI/nsamp; lamcu = CR (cos (fi), sin (fi)); R nrm1 = vector_norm (lama * lamcu * y + mu * col, p);