Mercurial > hg > octave-lyh
annotate liboctave/dColVector.h @ 10521:4d1fc073fbb7
add some missing copyright stmts
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 14 Apr 2010 12:23:13 +0200 |
parents | 96ed7c629bbd |
children | fd0a3ac60b0e |
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 |
10521
4d1fc073fbb7
add some missing copyright stmts
Jaroslav Hajek <highegg@gmail.com>
parents:
10364
diff
changeset
|
5 Copyright (C) 2010 VZLU Prague |
458 | 6 |
7 This file is part of Octave. | |
8 | |
9 Octave is free software; you can redistribute it and/or modify it | |
10 under the terms of the GNU General Public License as published by the | |
7016 | 11 Free Software Foundation; either version 3 of the License, or (at your |
12 option) any later version. | |
458 | 13 |
14 Octave is distributed in the hope that it will be useful, but WITHOUT | |
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
17 for more details. | |
18 | |
19 You should have received a copy of the GNU General Public License | |
7016 | 20 along with Octave; see the file COPYING. If not, see |
21 <http://www.gnu.org/licenses/>. | |
458 | 22 |
23 */ | |
24 | |
25 #if !defined (octave_ColumnVector_h) | |
26 #define octave_ColumnVector_h 1 | |
27 | |
1214 | 28 #include "MArray.h" |
458 | 29 |
30 #include "mx-defs.h" | |
31 | |
3585 | 32 class |
6108 | 33 OCTAVE_API |
3585 | 34 ColumnVector : public MArray<double> |
458 | 35 { |
36 public: | |
37 | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
38 ColumnVector (void) : MArray<double> (0, 1) { } |
3585 | 39 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
40 explicit ColumnVector (octave_idx_type n) : MArray<double> (n, 1) { } |
3585 | 41 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
42 explicit ColumnVector (const dim_vector& dv) |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
43 : MArray<double> (dv.as_column ()) { } |
9612
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
44 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
45 ColumnVector (octave_idx_type n, double val) : MArray<double> (n, 1, val) { } |
3585 | 46 |
47 ColumnVector (const ColumnVector& a) : MArray<double> (a) { } | |
48 | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
49 ColumnVector (const MArray<double>& a) : MArray<double> (a.as_column ()) { } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
50 ColumnVector (const Array<double>& a) : MArray<double> (a.as_column ()) { } |
458 | 51 |
52 ColumnVector& operator = (const ColumnVector& a) | |
53 { | |
1214 | 54 MArray<double>::operator = (a); |
458 | 55 return *this; |
56 } | |
57 | |
2386 | 58 bool operator == (const ColumnVector& a) const; |
59 bool operator != (const ColumnVector& a) const; | |
458 | 60 |
1359 | 61 // destructive insert/delete/reorder operations |
458 | 62 |
5275 | 63 ColumnVector& insert (const ColumnVector& a, octave_idx_type r); |
458 | 64 |
65 ColumnVector& fill (double val); | |
5275 | 66 ColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2); |
458 | 67 |
68 ColumnVector stack (const ColumnVector& a) const; | |
69 | |
70 RowVector transpose (void) const; | |
71 | |
6108 | 72 friend OCTAVE_API ColumnVector real (const ComplexColumnVector& a); |
73 friend OCTAVE_API ColumnVector imag (const ComplexColumnVector& a); | |
1205 | 74 |
1359 | 75 // resize is the destructive equivalent for this one |
458 | 76 |
5275 | 77 ColumnVector extract (octave_idx_type r1, octave_idx_type r2) const; |
458 | 78 |
5275 | 79 ColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const; |
4316 | 80 |
1359 | 81 // matrix by column vector -> column vector operations |
458 | 82 |
6108 | 83 friend OCTAVE_API ColumnVector operator * (const Matrix& a, const ColumnVector& b); |
458 | 84 |
1359 | 85 // diagonal matrix by column vector -> column vector operations |
458 | 86 |
6108 | 87 friend OCTAVE_API ColumnVector operator * (const DiagMatrix& a, const ColumnVector& b); |
458 | 88 |
1359 | 89 // other operations |
458 | 90 |
91 double min (void) const; | |
92 double max (void) const; | |
93 | |
10363
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10350
diff
changeset
|
94 ColumnVector abs (void) const; |
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10350
diff
changeset
|
95 |
1359 | 96 // i/o |
458 | 97 |
6108 | 98 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const ColumnVector& a); |
99 friend OCTAVE_API std::istream& operator >> (std::istream& is, ColumnVector& a); | |
458 | 100 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
101 void resize (octave_idx_type n, const double& rfv = Array<double>::resize_fill_value ()) |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
102 { Array<double>::resize (n, 1, rfv); } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
103 |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
104 void clear (octave_idx_type n) |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
105 { Array<double>::clear (n, 1); } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
106 |
458 | 107 }; |
108 | |
5508 | 109 // Publish externally used friend functions. |
110 | |
6108 | 111 extern OCTAVE_API ColumnVector real (const ComplexColumnVector& a); |
112 extern OCTAVE_API ColumnVector imag (const ComplexColumnVector& a); | |
5508 | 113 |
3573 | 114 MARRAY_FORWARD_DEFS (MArray, ColumnVector, double) |
115 | |
458 | 116 #endif |