Mercurial > hg > octave-nkf
annotate liboctave/CColVector.h @ 8920:eb63fbe60fab
update copyright notices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 07 Mar 2009 10:41:27 -0500 |
parents | 82be108cc558 |
children | 3c1762c7e787 |
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 |
5275 | 44 ComplexColumnVector (octave_idx_type n, const Complex& val) |
3585 | 45 : MArray<Complex> (n, val) { } |
46 | |
47 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { } | |
48 | |
1214 | 49 ComplexColumnVector (const MArray<Complex>& a) : MArray<Complex> (a) { } |
3585 | 50 |
51 explicit ComplexColumnVector (const ColumnVector& a); | |
458 | 52 |
53 ComplexColumnVector& operator = (const ComplexColumnVector& a) | |
54 { | |
1214 | 55 MArray<Complex>::operator = (a); |
458 | 56 return *this; |
57 } | |
58 | |
2386 | 59 bool operator == (const ComplexColumnVector& a) const; |
60 bool operator != (const ComplexColumnVector& a) const; | |
458 | 61 |
1359 | 62 // destructive insert/delete/reorder operations |
458 | 63 |
5275 | 64 ComplexColumnVector& insert (const ColumnVector& a, octave_idx_type r); |
65 ComplexColumnVector& insert (const ComplexColumnVector& a, octave_idx_type r); | |
458 | 66 |
67 ComplexColumnVector& fill (double val); | |
68 ComplexColumnVector& fill (const Complex& val); | |
5275 | 69 ComplexColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2); |
70 ComplexColumnVector& fill (const Complex& val, octave_idx_type r1, octave_idx_type r2); | |
458 | 71 |
72 ComplexColumnVector stack (const ColumnVector& a) const; | |
73 ComplexColumnVector stack (const ComplexColumnVector& a) const; | |
74 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
75 ComplexRowVector hermitian (void) const; |
458 | 76 ComplexRowVector transpose (void) const; |
77 | |
78 friend ComplexColumnVector conj (const ComplexColumnVector& a); | |
79 | |
1359 | 80 // resize is the destructive equivalent for this one |
458 | 81 |
5275 | 82 ComplexColumnVector extract (octave_idx_type r1, octave_idx_type r2) const; |
458 | 83 |
5275 | 84 ComplexColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const; |
4316 | 85 |
1359 | 86 // column vector by column vector -> column vector operations |
458 | 87 |
88 ComplexColumnVector& operator += (const ColumnVector& a); | |
89 ComplexColumnVector& operator -= (const ColumnVector& a); | |
90 | |
1359 | 91 // matrix by column vector -> column vector operations |
1205 | 92 |
93 friend ComplexColumnVector operator * (const ComplexMatrix& a, | |
94 const ColumnVector& b); | |
95 | |
96 friend ComplexColumnVector operator * (const ComplexMatrix& a, | |
97 const ComplexColumnVector& b); | |
458 | 98 |
1359 | 99 // matrix by column vector -> column vector operations |
1205 | 100 |
101 friend ComplexColumnVector operator * (const Matrix& a, | |
102 const ComplexColumnVector& b); | |
103 | |
1359 | 104 // diagonal matrix by column vector -> column vector operations |
1205 | 105 |
106 friend ComplexColumnVector operator * (const DiagMatrix& a, | |
107 const ComplexColumnVector& b); | |
108 | |
109 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, | |
110 const ColumnVector& b); | |
111 | |
112 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, | |
113 const ComplexColumnVector& b); | |
114 | |
1359 | 115 // other operations |
458 | 116 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
117 typedef double (*dmapper) (const Complex&); |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
118 typedef Complex (*cmapper) (const Complex&); |
2676 | 119 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
120 ColumnVector map (dmapper fcn) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
121 ComplexColumnVector map (cmapper fcn) const; |
458 | 122 |
123 Complex min (void) const; | |
124 Complex max (void) const; | |
125 | |
1359 | 126 // i/o |
458 | 127 |
3504 | 128 friend std::ostream& operator << (std::ostream& os, const ComplexColumnVector& a); |
129 friend std::istream& operator >> (std::istream& is, ComplexColumnVector& a); | |
458 | 130 |
1205 | 131 private: |
132 | |
5275 | 133 ComplexColumnVector (Complex *d, octave_idx_type l) : MArray<Complex> (d, l) { } |
458 | 134 }; |
135 | |
3573 | 136 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex) |
137 | |
458 | 138 #endif |
139 | |
140 /* | |
141 ;;; Local Variables: *** | |
142 ;;; mode: C++ *** | |
143 ;;; End: *** | |
144 */ |