Mercurial > octave-nkf
annotate liboctave/array/PermMatrix.h @ 20267:a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
* liboctave/array/Array.h (Array::length): deprecate for ::numel.
* liboctave/array/Sparse.h (Sparse::length): deprecate for ::numel.
* libgui/graphics/QtHandlesUtils.cc, libgui/src/octave-qt-link.cc,
libinterp/corefcn/Cell.cc, libinterp/corefcn/__contourc__.cc,
libinterp/corefcn/__pchip_deriv__.cc, libinterp/corefcn/__qp__.cc,
libinterp/corefcn/cellfun.cc, libinterp/corefcn/daspk.cc,
libinterp/corefcn/dasrt.cc, libinterp/corefcn/dassl.cc,
libinterp/corefcn/data.cc, libinterp/corefcn/filter.cc,
libinterp/corefcn/find.cc, libinterp/corefcn/gl-render.cc,
libinterp/corefcn/gl-render.h, libinterp/corefcn/graphics.cc,
libinterp/corefcn/graphics.in.h, libinterp/corefcn/help.cc,
libinterp/corefcn/hex2num.cc, libinterp/corefcn/input.cc,
libinterp/corefcn/load-path.cc, libinterp/corefcn/load-save.cc,
libinterp/corefcn/ls-oct-ascii.h, libinterp/corefcn/lsode.cc,
libinterp/corefcn/matrix_type.cc, libinterp/corefcn/oct-hist.cc,
libinterp/corefcn/oct-map.cc, libinterp/corefcn/oct-map.h,
libinterp/corefcn/oct-obj.h, libinterp/corefcn/oct-stream.cc,
libinterp/corefcn/oct-stream.h, libinterp/corefcn/pr-output.cc,
libinterp/corefcn/quadcc.cc, libinterp/corefcn/rand.cc,
libinterp/corefcn/regexp.cc, libinterp/corefcn/strfns.cc,
libinterp/corefcn/sub2ind.cc, libinterp/corefcn/symtab.h,
libinterp/corefcn/syscalls.cc, libinterp/corefcn/tsearch.cc,
libinterp/corefcn/urlwrite.cc, libinterp/corefcn/utils.cc,
libinterp/corefcn/variables.cc, libinterp/corefcn/xdiv.cc,
libinterp/corefcn/xpow.cc, libinterp/dldfcn/__glpk__.cc,
libinterp/dldfcn/__init_fltk__.cc, libinterp/dldfcn/__magick_read__.cc,
libinterp/dldfcn/audiodevinfo.cc, libinterp/dldfcn/ccolamd.cc,
libinterp/dldfcn/colamd.cc, libinterp/octave-value/ov-cell.cc,
libinterp/octave-value/ov-class.cc, libinterp/octave-value/ov-class.h,
libinterp/octave-value/ov-fcn-inline.cc, libinterp/octave-value/ov-java.cc,
libinterp/octave-value/ov-perm.cc, libinterp/octave-value/ov-struct.cc,
libinterp/octave-value/ov-typeinfo.cc, libinterp/octave-value/ov.cc,
libinterp/operators/op-int.h, libinterp/parse-tree/pt-pr-code.cc,
liboctave/array/Array-util.cc, liboctave/array/Array.cc,
liboctave/array/CColVector.cc, liboctave/array/CDiagMatrix.cc,
liboctave/array/CMatrix.cc, liboctave/array/CRowVector.cc,
liboctave/array/DiagArray2.cc, liboctave/array/DiagArray2.h,
liboctave/array/MArray.cc, liboctave/array/PermMatrix.cc,
liboctave/array/PermMatrix.h, liboctave/array/Sparse.cc,
liboctave/array/boolMatrix.cc, liboctave/array/chMatrix.cc,
liboctave/array/chNDArray.cc, liboctave/array/dColVector.cc,
liboctave/array/dDiagMatrix.cc, liboctave/array/dMatrix.cc,
liboctave/array/dRowVector.cc, liboctave/array/fCColVector.cc,
liboctave/array/fCDiagMatrix.cc, liboctave/array/fCMatrix.cc,
liboctave/array/fCRowVector.cc, liboctave/array/fColVector.cc,
liboctave/array/fDiagMatrix.cc, liboctave/array/fMatrix.cc,
liboctave/array/fRowVector.cc, liboctave/array/idx-vector.cc,
liboctave/array/intNDArray.cc, liboctave/numeric/CmplxCHOL.cc,
liboctave/numeric/CmplxLU.cc, liboctave/numeric/CmplxQR.cc,
liboctave/numeric/DASPK.cc, liboctave/numeric/DASRT.cc,
liboctave/numeric/DASSL.cc, liboctave/numeric/LSODE.cc,
liboctave/numeric/ODES.cc, liboctave/numeric/ODES.h,
liboctave/numeric/base-dae.h, liboctave/numeric/base-lu.cc,
liboctave/numeric/dbleCHOL.cc, liboctave/numeric/dbleLU.cc,
liboctave/numeric/dbleQR.cc, liboctave/numeric/eigs-base.cc,
liboctave/numeric/fCmplxCHOL.cc, liboctave/numeric/fCmplxLU.cc,
liboctave/numeric/fCmplxQR.cc, liboctave/numeric/floatCHOL.cc,
liboctave/numeric/floatLU.cc, liboctave/numeric/floatQR.cc,
liboctave/numeric/lo-specfun.cc, liboctave/numeric/oct-rand.cc,
liboctave/numeric/oct-spparms.cc, liboctave/numeric/sparse-base-chol.cc,
liboctave/operators/mx-inlines.cc, liboctave/system/file-ops.cc,
liboctave/util/glob-match.h, liboctave/util/kpse.cc,
liboctave/util/lo-regexp.cc, liboctave/util/oct-glob.cc,
liboctave/util/pathsearch.cc, liboctave/util/str-vec.cc,
liboctave/util/str-vec.h, liboctave/util/url-transfer.cc: replace all usage
of Array::length() and Sparse::length() with ::numel().
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Sat, 30 May 2015 03:14:07 +0100 |
parents | 00cf2847355d |
children |
rev | line source |
---|---|
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
1 /* |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
2 |
19731
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
18883
diff
changeset
|
3 Copyright (C) 2008-2015 Jaroslav Hajek |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
4 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
5 This file is part of Octave. |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
6 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
10 option) any later version. |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
11 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
15 for more details. |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
16 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
20 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
21 */ |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
22 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
23 #if !defined (octave_PermMatrix_h) |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
24 #define octave_PermMatrix_h 1 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
25 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
26 #include "Array.h" |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
27 #include "mx-defs.h" |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
28 |
8524
937921654627
clean up Array and DiagArray2
Jaroslav Hajek <highegg@gmail.com>
parents:
8375
diff
changeset
|
29 // Array<T> is inherited privately so that some methods, like index, don't |
937921654627
clean up Array and DiagArray2
Jaroslav Hajek <highegg@gmail.com>
parents:
8375
diff
changeset
|
30 // produce unexpected results. |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
31 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8958
diff
changeset
|
32 class OCTAVE_API PermMatrix : protected Array<octave_idx_type> |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
33 { |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
34 public: |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
35 |
18883
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
36 PermMatrix (void) : Array<octave_idx_type> () { } |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
37 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
38 PermMatrix (octave_idx_type n); |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
39 |
18883
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
40 PermMatrix (const Array<octave_idx_type>& p) GCC_ATTR_DEPRECATED; |
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
41 |
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
42 PermMatrix (const Array<octave_idx_type>& p, bool colp, bool check = true); |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
43 |
18883
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
44 PermMatrix (const PermMatrix& m) : Array<octave_idx_type> (m) { } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
45 |
18883
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
46 PermMatrix (const idx_vector& idx) GCC_ATTR_DEPRECATED; |
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
47 |
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
48 PermMatrix (const idx_vector& idx, bool colp, octave_idx_type n = 0); |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
49 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
50 octave_idx_type dim1 (void) const |
20267
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20263
diff
changeset
|
51 { return Array<octave_idx_type>::numel (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
52 octave_idx_type dim2 (void) const |
20267
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20263
diff
changeset
|
53 { return Array<octave_idx_type>::numel (); } |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
54 |
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
55 octave_idx_type rows (void) const { return dim1 (); } |
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
56 octave_idx_type cols (void) const { return dim2 (); } |
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
57 octave_idx_type columns (void) const { return dim2 (); } |
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
58 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
59 octave_idx_type perm_length (void) const |
20267
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20263
diff
changeset
|
60 { return Array<octave_idx_type>::numel (); } |
9698
7c6d5d8c8d37
fix diag*diag multiplication
Jaroslav Hajek <highegg@gmail.com>
parents:
9237
diff
changeset
|
61 // FIXME: a dangerous ambiguity? |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
62 octave_idx_type length (void) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
63 { return perm_length (); } |
20263
00cf2847355d
Deprecate Array::nelem() and Range::nelem() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
19731
diff
changeset
|
64 GCC_ATTR_DEPRECATED octave_idx_type nelem (void) const { return numel (); } |
00cf2847355d
Deprecate Array::nelem() and Range::nelem() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
19731
diff
changeset
|
65 octave_idx_type numel (void) const { return dim1 () * dim2 (); } |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
66 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
67 size_t byte_size (void) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
68 { return Array<octave_idx_type>::byte_size (); } |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
69 |
8524
937921654627
clean up Array and DiagArray2
Jaroslav Hajek <highegg@gmail.com>
parents:
8375
diff
changeset
|
70 dim_vector dims (void) const { return dim_vector (dim1 (), dim2 ()); } |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
71 |
18883
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
72 const Array<octave_idx_type>& col_perm_vec (void) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
73 { return *this; } |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
74 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
75 octave_idx_type |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
76 elem (octave_idx_type i, octave_idx_type j) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
77 { |
18883
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
78 return (Array<octave_idx_type>::elem (j) == i) ? 1 : 0; |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
79 } |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
80 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
81 octave_idx_type |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
82 checkelem (octave_idx_type i, octave_idx_type j) const; |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
83 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
84 octave_idx_type |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
85 operator () (octave_idx_type i, octave_idx_type j) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
86 { |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
87 #if defined (BOUNDS_CHECKING) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
88 return checkelem (i, j); |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
89 #else |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
90 return elem (i, j); |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
91 #endif |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
92 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
93 |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
94 // These are, in fact, super-fast. |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
95 PermMatrix transpose (void) const; |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
96 PermMatrix inverse (void) const; |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
97 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
98 // Determinant, i.e. the sign of permutation. |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
99 octave_idx_type determinant (void) const; |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
100 |
8958
6ccc12cc65ef
implement raising a permutation matrix to integer power
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
101 // Efficient integer power of a permutation. |
6ccc12cc65ef
implement raising a permutation matrix to integer power
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
102 PermMatrix power (octave_idx_type n) const; |
6ccc12cc65ef
implement raising a permutation matrix to integer power
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
103 |
18883
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
104 bool is_col_perm (void) const { return true; } |
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
105 bool is_row_perm (void) const { return false; } |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
106 |
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
107 void print_info (std::ostream& os, const std::string& prefix) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
108 { Array<octave_idx_type>::print_info (os, prefix); } |
8375
e3c9102431a9
fix design problems of diag & perm matrix classes
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
109 |
9708 | 110 static PermMatrix eye (octave_idx_type n); |
111 | |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
112 private: |
18883
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
113 |
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
114 PermMatrix pos_power (octave_idx_type m) const; |
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
115 |
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
116 void setup (const Array<octave_idx_type>& p, bool colp, bool check); |
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
117 |
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
118 void setup (const idx_vector& idx, bool colp, octave_idx_type n); |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
119 }; |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
120 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
121 // Multiplying permutations together. |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
122 PermMatrix |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8958
diff
changeset
|
123 OCTAVE_API |
18883
aa9ca67f09fb
make all permutation matrices column permutations (bug #42418)
David Spies <dnspies@gmail.com>
parents:
17769
diff
changeset
|
124 operator * (const PermMatrix& a, const PermMatrix& b); |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
125 |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
126 #endif |