Mercurial > hg > octave-lyh
annotate liboctave/CRowVector.h @ 8500:aaddb450b9aa
[docs] can not => cannot
author | Brian Gough <bjg@gnu.org> |
---|---|
date | Tue, 13 Jan 2009 00:36:52 -0500 |
parents | 82be108cc558 |
children | eb63fbe60fab |
rev | line source |
---|---|
458 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2003, 2004, 2005, |
4 2006, 2007 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_ComplexRowVector_h) | |
25 #define octave_ComplexRowVector_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 ComplexRowVector : public MArray<Complex> |
458 | 34 { |
35 friend class ComplexColumnVector; | |
36 | |
37 public: | |
38 | |
1214 | 39 ComplexRowVector (void) : MArray<Complex> () { } |
3585 | 40 |
5275 | 41 explicit ComplexRowVector (octave_idx_type n) : MArray<Complex> (n) { } |
3585 | 42 |
5275 | 43 ComplexRowVector (octave_idx_type n, const Complex& val) : MArray<Complex> (n, val) { } |
3585 | 44 |
45 ComplexRowVector (const ComplexRowVector& a) : MArray<Complex> (a) { } | |
46 | |
1214 | 47 ComplexRowVector (const MArray<Complex>& a) : MArray<Complex> (a) { } |
3585 | 48 |
49 explicit ComplexRowVector (const RowVector& a); | |
458 | 50 |
51 ComplexRowVector& operator = (const ComplexRowVector& a) | |
52 { | |
1214 | 53 MArray<Complex>::operator = (a); |
458 | 54 return *this; |
55 } | |
56 | |
2386 | 57 bool operator == (const ComplexRowVector& a) const; |
58 bool operator != (const ComplexRowVector& a) const; | |
458 | 59 |
1359 | 60 // destructive insert/delete/reorder operations |
458 | 61 |
5275 | 62 ComplexRowVector& insert (const RowVector& a, octave_idx_type c); |
63 ComplexRowVector& insert (const ComplexRowVector& a, octave_idx_type c); | |
458 | 64 |
65 ComplexRowVector& fill (double val); | |
66 ComplexRowVector& fill (const Complex& val); | |
5275 | 67 ComplexRowVector& fill (double val, octave_idx_type c1, octave_idx_type c2); |
68 ComplexRowVector& fill (const Complex& val, octave_idx_type c1, octave_idx_type c2); | |
458 | 69 |
70 ComplexRowVector append (const RowVector& a) const; | |
71 ComplexRowVector append (const ComplexRowVector& a) const; | |
72 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
73 ComplexColumnVector hermitian (void) const; |
458 | 74 ComplexColumnVector transpose (void) const; |
75 | |
76 friend ComplexRowVector conj (const ComplexRowVector& a); | |
77 | |
1359 | 78 // resize is the destructive equivalent for this one |
458 | 79 |
5275 | 80 ComplexRowVector extract (octave_idx_type c1, octave_idx_type c2) const; |
458 | 81 |
5275 | 82 ComplexRowVector extract_n (octave_idx_type c1, octave_idx_type n) const; |
4316 | 83 |
1359 | 84 // row vector by row vector -> row vector operations |
458 | 85 |
86 ComplexRowVector& operator += (const RowVector& a); | |
87 ComplexRowVector& operator -= (const RowVector& a); | |
88 | |
1359 | 89 // row vector by matrix -> row vector |
458 | 90 |
91 friend ComplexRowVector operator * (const ComplexRowVector& a, | |
92 const ComplexMatrix& b); | |
93 | |
1205 | 94 friend ComplexRowVector operator * (const RowVector& a, |
95 const ComplexMatrix& b); | |
96 | |
1359 | 97 // other operations |
458 | 98 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
99 typedef double (*dmapper) (const Complex&); |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
100 typedef Complex (*cmapper) (const Complex&); |
2676 | 101 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
102 RowVector map (dmapper fcn) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
103 ComplexRowVector map (cmapper fcn) const; |
458 | 104 |
105 Complex min (void) const; | |
106 Complex max (void) const; | |
107 | |
1359 | 108 // i/o |
458 | 109 |
3504 | 110 friend std::ostream& operator << (std::ostream& os, const ComplexRowVector& a); |
111 friend std::istream& operator >> (std::istream& is, ComplexRowVector& a); | |
458 | 112 |
113 private: | |
114 | |
5275 | 115 ComplexRowVector (Complex *d, octave_idx_type l) : MArray<Complex> (d, l) { } |
458 | 116 }; |
117 | |
1205 | 118 // row vector by column vector -> scalar |
119 | |
120 Complex operator * (const ComplexRowVector& a, const ColumnVector& b); | |
121 | |
122 Complex operator * (const ComplexRowVector& a, const ComplexColumnVector& b); | |
123 | |
124 // other operations | |
125 | |
6108 | 126 OCTAVE_API ComplexRowVector linspace (const Complex& x1, const Complex& x2, octave_idx_type n); |
1196 | 127 |
3573 | 128 MARRAY_FORWARD_DEFS (MArray, ComplexRowVector, Complex) |
129 | |
458 | 130 #endif |
131 | |
132 /* | |
133 ;;; Local Variables: *** | |
134 ;;; mode: C++ *** | |
135 ;;; End: *** | |
136 */ |