Mercurial > octave-nkf
comparison src/sparse-xpow.cc @ 10527:b4d2080b6df7
Replace nzmax by nnz as needed
author | David Bateman <dbateman@free.fr> |
---|---|
date | Fri, 16 Apr 2010 16:14:45 +0200 |
parents | 57a59eae83cc |
children | fd0a3ac60b0e |
comparison
equal
deleted
inserted
replaced
10526:660c244d3206 | 10527:b4d2080b6df7 |
---|---|
305 // sparse matrix with same structure as a, which is strictly | 305 // sparse matrix with same structure as a, which is strictly |
306 // incorrect. Keep compatiability. | 306 // incorrect. Keep compatiability. |
307 | 307 |
308 octave_value retval; | 308 octave_value retval; |
309 | 309 |
310 octave_idx_type nz = a.nzmax (); | 310 octave_idx_type nz = a.nnz (); |
311 | 311 |
312 if (b <= 0.0) | 312 if (b <= 0.0) |
313 { | 313 { |
314 octave_idx_type nr = a.rows (); | 314 octave_idx_type nr = a.rows (); |
315 octave_idx_type nc = a.cols (); | 315 octave_idx_type nc = a.cols (); |
472 if (b == 0.0) | 472 if (b == 0.0) |
473 // Can this case ever happen, due to automatic retyping with maybe_mutate? | 473 // Can this case ever happen, due to automatic retyping with maybe_mutate? |
474 retval = octave_value (NDArray (a.dims (), 1)); | 474 retval = octave_value (NDArray (a.dims (), 1)); |
475 else | 475 else |
476 { | 476 { |
477 octave_idx_type nz = a.nzmax (); | 477 octave_idx_type nz = a.nnz (); |
478 SparseComplexMatrix result (a); | 478 SparseComplexMatrix result (a); |
479 | 479 |
480 for (octave_idx_type i = 0; i < nz; i++) | 480 for (octave_idx_type i = 0; i < nz; i++) |
481 { | 481 { |
482 octave_quit (); | 482 octave_quit (); |
600 | 600 |
601 retval = result; | 601 retval = result; |
602 } | 602 } |
603 else | 603 else |
604 { | 604 { |
605 octave_idx_type nz = a.nzmax (); | 605 octave_idx_type nz = a.nnz (); |
606 | 606 |
607 SparseComplexMatrix result (a); | 607 SparseComplexMatrix result (a); |
608 | 608 |
609 if (xisint (b)) | 609 if (xisint (b)) |
610 { | 610 { |
679 // Can this case ever happen, due to automatic retyping with maybe_mutate? | 679 // Can this case ever happen, due to automatic retyping with maybe_mutate? |
680 retval = octave_value (NDArray (a.dims (), 1)); | 680 retval = octave_value (NDArray (a.dims (), 1)); |
681 else | 681 else |
682 { | 682 { |
683 | 683 |
684 octave_idx_type nz = a.nzmax (); | 684 octave_idx_type nz = a.nnz (); |
685 | 685 |
686 SparseComplexMatrix result (a); | 686 SparseComplexMatrix result (a); |
687 | 687 |
688 for (octave_idx_type i = 0; i < nz; i++) | 688 for (octave_idx_type i = 0; i < nz; i++) |
689 { | 689 { |