Mercurial > octave
annotate liboctave/CColVector.h @ 9612:66970dd627f6
further liboctave design improvements
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 04 Sep 2009 11:22:53 +0200 |
parents | 3c1762c7e787 |
children | f80c566bc751 |
rev | line source |
---|---|
458 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2003, 2004, 2005, |
8920 | 4 2006, 2007, 2008 John W. Eaton |
458 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
458 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
458 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_ComplexColumnVector_h) | |
25 #define octave_ComplexColumnVector_h 1 | |
26 | |
1214 | 27 #include "MArray.h" |
458 | 28 |
29 #include "mx-defs.h" | |
30 | |
3585 | 31 class |
6108 | 32 OCTAVE_API |
3585 | 33 ComplexColumnVector : public MArray<Complex> |
458 | 34 { |
1205 | 35 friend class ComplexMatrix; |
458 | 36 friend class ComplexRowVector; |
37 | |
38 public: | |
39 | |
1214 | 40 ComplexColumnVector (void) : MArray<Complex> () { } |
3585 | 41 |
5275 | 42 explicit ComplexColumnVector (octave_idx_type n) : MArray<Complex> (n) { } |
3585 | 43 |
9612
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9237
diff
changeset
|
44 explicit ComplexColumnVector (const dim_vector& dv) : MArray<Complex> (dv) { } |
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9237
diff
changeset
|
45 |
5275 | 46 ComplexColumnVector (octave_idx_type n, const Complex& val) |
3585 | 47 : MArray<Complex> (n, val) { } |
48 | |
49 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { } | |
50 | |
1214 | 51 ComplexColumnVector (const MArray<Complex>& a) : MArray<Complex> (a) { } |
3585 | 52 |
53 explicit ComplexColumnVector (const ColumnVector& a); | |
458 | 54 |
55 ComplexColumnVector& operator = (const ComplexColumnVector& a) | |
56 { | |
1214 | 57 MArray<Complex>::operator = (a); |
458 | 58 return *this; |
59 } | |
60 | |
2386 | 61 bool operator == (const ComplexColumnVector& a) const; |
62 bool operator != (const ComplexColumnVector& a) const; | |
458 | 63 |
1359 | 64 // destructive insert/delete/reorder operations |
458 | 65 |
5275 | 66 ComplexColumnVector& insert (const ColumnVector& a, octave_idx_type r); |
67 ComplexColumnVector& insert (const ComplexColumnVector& a, octave_idx_type r); | |
458 | 68 |
69 ComplexColumnVector& fill (double val); | |
70 ComplexColumnVector& fill (const Complex& val); | |
5275 | 71 ComplexColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2); |
72 ComplexColumnVector& fill (const Complex& val, octave_idx_type r1, octave_idx_type r2); | |
458 | 73 |
74 ComplexColumnVector stack (const ColumnVector& a) const; | |
75 ComplexColumnVector stack (const ComplexColumnVector& a) const; | |
76 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
77 ComplexRowVector hermitian (void) const; |
458 | 78 ComplexRowVector transpose (void) const; |
79 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
80 friend OCTAVE_API ComplexColumnVector conj (const ComplexColumnVector& a); |
458 | 81 |
1359 | 82 // resize is the destructive equivalent for this one |
458 | 83 |
5275 | 84 ComplexColumnVector extract (octave_idx_type r1, octave_idx_type r2) const; |
458 | 85 |
5275 | 86 ComplexColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const; |
4316 | 87 |
1359 | 88 // column vector by column vector -> column vector operations |
458 | 89 |
90 ComplexColumnVector& operator += (const ColumnVector& a); | |
91 ComplexColumnVector& operator -= (const ColumnVector& a); | |
92 | |
1359 | 93 // matrix by column vector -> column vector operations |
1205 | 94 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
95 friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a, |
1205 | 96 const ColumnVector& b); |
97 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
98 friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a, |
1205 | 99 const ComplexColumnVector& b); |
458 | 100 |
1359 | 101 // matrix by column vector -> column vector operations |
1205 | 102 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
103 friend OCTAVE_API ComplexColumnVector operator * (const Matrix& a, |
1205 | 104 const ComplexColumnVector& b); |
105 | |
1359 | 106 // diagonal matrix by column vector -> column vector operations |
1205 | 107 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
108 friend OCTAVE_API ComplexColumnVector operator * (const DiagMatrix& a, |
1205 | 109 const ComplexColumnVector& b); |
110 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
111 friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
1205 | 112 const ColumnVector& b); |
113 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
114 friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
1205 | 115 const ComplexColumnVector& b); |
116 | |
1359 | 117 // other operations |
458 | 118 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
119 typedef double (*dmapper) (const Complex&); |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
120 typedef Complex (*cmapper) (const Complex&); |
2676 | 121 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
122 ColumnVector map (dmapper fcn) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
123 ComplexColumnVector map (cmapper fcn) const; |
458 | 124 |
125 Complex min (void) const; | |
126 Complex max (void) const; | |
127 | |
1359 | 128 // i/o |
458 | 129 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
130 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const ComplexColumnVector& a); |
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
131 friend OCTAVE_API std::istream& operator >> (std::istream& is, ComplexColumnVector& a); |
458 | 132 |
1205 | 133 private: |
134 | |
5275 | 135 ComplexColumnVector (Complex *d, octave_idx_type l) : MArray<Complex> (d, l) { } |
458 | 136 }; |
137 | |
3573 | 138 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex) |
139 | |
458 | 140 #endif |
141 | |
142 /* | |
143 ;;; Local Variables: *** | |
144 ;;; mode: C++ *** | |
145 ;;; End: *** | |
146 */ |