458
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
458
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
458
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_ColumnVector_h) |
|
25 #define octave_ColumnVector_h 1 |
|
26 |
1214
|
27 #include "MArray.h" |
458
|
28 |
|
29 #include "mx-defs.h" |
|
30 |
3585
|
31 class |
|
32 ColumnVector : public MArray<double> |
458
|
33 { |
|
34 public: |
|
35 |
1214
|
36 ColumnVector (void) : MArray<double> () { } |
3585
|
37 |
5275
|
38 explicit ColumnVector (octave_idx_type n) : MArray<double> (n) { } |
3585
|
39 |
5275
|
40 ColumnVector (octave_idx_type n, double val) : MArray<double> (n, val) { } |
3585
|
41 |
|
42 ColumnVector (const ColumnVector& a) : MArray<double> (a) { } |
|
43 |
1214
|
44 ColumnVector (const MArray<double>& a) : MArray<double> (a) { } |
458
|
45 |
|
46 ColumnVector& operator = (const ColumnVector& a) |
|
47 { |
1214
|
48 MArray<double>::operator = (a); |
458
|
49 return *this; |
|
50 } |
|
51 |
2386
|
52 bool operator == (const ColumnVector& a) const; |
|
53 bool operator != (const ColumnVector& a) const; |
458
|
54 |
1359
|
55 // destructive insert/delete/reorder operations |
458
|
56 |
5275
|
57 ColumnVector& insert (const ColumnVector& a, octave_idx_type r); |
458
|
58 |
|
59 ColumnVector& fill (double val); |
5275
|
60 ColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2); |
458
|
61 |
|
62 ColumnVector stack (const ColumnVector& a) const; |
|
63 |
|
64 RowVector transpose (void) const; |
|
65 |
1205
|
66 friend ColumnVector real (const ComplexColumnVector& a); |
|
67 friend ColumnVector imag (const ComplexColumnVector& a); |
|
68 |
1359
|
69 // resize is the destructive equivalent for this one |
458
|
70 |
5275
|
71 ColumnVector extract (octave_idx_type r1, octave_idx_type r2) const; |
458
|
72 |
5275
|
73 ColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const; |
4316
|
74 |
1359
|
75 // matrix by column vector -> column vector operations |
458
|
76 |
1205
|
77 friend ColumnVector operator * (const Matrix& a, const ColumnVector& b); |
458
|
78 |
1359
|
79 // diagonal matrix by column vector -> column vector operations |
458
|
80 |
1205
|
81 friend ColumnVector operator * (const DiagMatrix& a, const ColumnVector& b); |
458
|
82 |
1359
|
83 // other operations |
458
|
84 |
2676
|
85 ColumnVector map (d_d_Mapper f) const; |
|
86 |
|
87 ColumnVector& apply (d_d_Mapper f); |
458
|
88 |
|
89 double min (void) const; |
|
90 double max (void) const; |
|
91 |
1359
|
92 // i/o |
458
|
93 |
3504
|
94 friend std::ostream& operator << (std::ostream& os, const ColumnVector& a); |
|
95 friend std::istream& operator >> (std::istream& is, ColumnVector& a); |
458
|
96 |
|
97 private: |
|
98 |
5275
|
99 ColumnVector (double *d, octave_idx_type l) : MArray<double> (d, l) { } |
458
|
100 }; |
|
101 |
3573
|
102 MARRAY_FORWARD_DEFS (MArray, ColumnVector, double) |
|
103 |
458
|
104 #endif |
|
105 |
|
106 /* |
|
107 ;;; Local Variables: *** |
|
108 ;;; mode: C++ *** |
|
109 ;;; End: *** |
|
110 */ |