458
|
1 // -*- C++ -*- |
|
2 /* |
|
3 |
1011
|
4 Copyright (C) 1992, 1993, 1994, 1995 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 |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
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 |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
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 |
|
31 extern "C++" { |
|
32 |
1214
|
33 class ColumnVector : public MArray<double> |
458
|
34 { |
532
|
35 friend class Matrix; |
458
|
36 friend class RowVector; |
|
37 |
|
38 public: |
|
39 |
1214
|
40 ColumnVector (void) : MArray<double> () { } |
|
41 ColumnVector (int n) : MArray<double> (n) { } |
|
42 ColumnVector (int n, double val) : MArray<double> (n, val) { } |
|
43 ColumnVector (const MArray<double>& a) : MArray<double> (a) { } |
|
44 ColumnVector (const ColumnVector& 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 |
|
52 int operator == (const ColumnVector& a) const; |
|
53 int operator != (const ColumnVector& a) const; |
|
54 |
|
55 // destructive insert/delete/reorder operations |
|
56 |
|
57 ColumnVector& insert (const ColumnVector& a, int r); |
|
58 |
|
59 ColumnVector& fill (double val); |
|
60 ColumnVector& fill (double val, int r1, int r2); |
|
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 |
458
|
69 // resize is the destructive equivalent for this one |
|
70 |
|
71 ColumnVector extract (int r1, int r2) const; |
|
72 |
|
73 // column vector by column vector -> column vector operations |
|
74 |
|
75 ColumnVector& operator += (const ColumnVector& a); |
|
76 ColumnVector& operator -= (const ColumnVector& a); |
|
77 |
1205
|
78 // matrix by column vector -> column vector operations |
458
|
79 |
1205
|
80 friend ColumnVector operator * (const Matrix& a, const ColumnVector& b); |
458
|
81 |
1205
|
82 // diagonal matrix by column vector -> column vector operations |
458
|
83 |
1205
|
84 friend ColumnVector operator * (const DiagMatrix& a, const ColumnVector& b); |
458
|
85 |
|
86 // other operations |
|
87 |
|
88 friend ColumnVector map (d_d_Mapper f, const ColumnVector& a); |
1205
|
89 friend ColumnVector map (d_c_Mapper f, const ComplexColumnVector& a); |
458
|
90 void map (d_d_Mapper f); |
|
91 |
|
92 double min (void) const; |
|
93 double max (void) const; |
|
94 |
|
95 // i/o |
|
96 |
|
97 friend ostream& operator << (ostream& os, const ColumnVector& a); |
532
|
98 friend istream& operator >> (istream& is, ColumnVector& a); |
458
|
99 |
|
100 private: |
|
101 |
1214
|
102 ColumnVector (double *d, int l) : MArray<double> (d, l) { } |
458
|
103 }; |
|
104 |
|
105 } // extern "C++" |
|
106 |
|
107 #endif |
|
108 |
|
109 /* |
|
110 ;;; Local Variables: *** |
|
111 ;;; mode: C++ *** |
|
112 ;;; page-delimiter: "^/\\*" *** |
|
113 ;;; End: *** |
|
114 */ |