GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CColVector.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2013 John W. Eaton
4 Copyright (C) 2010 VZLU Prague
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 3 of the License, or (at your
11 option) any 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, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if !defined (octave_CColVector_h)
25 #define octave_CColVector_h 1
26 
27 #include "MArray.h"
28 
29 #include "mx-defs.h"
30 
31 class
32 OCTAVE_API
34 {
35  friend class ComplexMatrix;
36  friend class ComplexRowVector;
37 
38 public:
39 
41 
43  : MArray<Complex> (dim_vector (n, 1)) { }
44 
45  explicit ComplexColumnVector (const dim_vector& dv)
46  : MArray<Complex> (dv.as_column ()) { }
47 
49  : MArray<Complex> (dim_vector (n, 1), val) { }
50 
52 
54  : MArray<Complex> (a.as_column ()) { }
55 
57  : MArray<Complex> (a.as_column ()) { }
58 
59  explicit ComplexColumnVector (const ColumnVector& a);
60 
62  {
64  return *this;
65  }
66 
67  bool operator == (const ComplexColumnVector& a) const;
68  bool operator != (const ComplexColumnVector& a) const;
69 
70  // destructive insert/delete/reorder operations
71 
74 
75  ComplexColumnVector& fill (double val);
76  ComplexColumnVector& fill (const Complex& val);
77  ComplexColumnVector& fill (double val,
79  ComplexColumnVector& fill (const Complex& val,
81 
82  ComplexColumnVector stack (const ColumnVector& a) const;
83  ComplexColumnVector stack (const ComplexColumnVector& a) const;
84 
85  ComplexRowVector hermitian (void) const;
86  ComplexRowVector transpose (void) const;
87 
88  friend OCTAVE_API ComplexColumnVector conj (const ComplexColumnVector& a);
89 
90  // resize is the destructive equivalent for this one
91 
93 
95 
96  // column vector by column vector -> column vector operations
97 
100 
101  // matrix by column vector -> column vector operations
102 
103  friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a,
104  const ColumnVector& b);
105 
106  friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a,
107  const ComplexColumnVector& b);
108 
109  // matrix by column vector -> column vector operations
110 
111  friend OCTAVE_API ComplexColumnVector operator * (const Matrix& a,
112  const ComplexColumnVector& b);
113 
114  // diagonal matrix by column vector -> column vector operations
115 
116  friend OCTAVE_API ComplexColumnVector operator * (const DiagMatrix& a,
117  const ComplexColumnVector& b);
118 
119  friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a,
120  const ColumnVector& b);
121 
122  friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a,
123  const ComplexColumnVector& b);
124 
125  // other operations
126 
127  Complex min (void) const;
128  Complex max (void) const;
129 
130  ColumnVector abs (void) const;
131 
132  // i/o
133 
134  friend OCTAVE_API std::ostream& operator << (std::ostream& os,
135  const ComplexColumnVector& a);
136  friend OCTAVE_API std::istream& operator >> (std::istream& is,
138 
139  void resize (octave_idx_type n, const Complex& rfv = Complex (0))
140  {
141  Array<Complex>::resize (dim_vector (n, 1), rfv);
142  }
143 
145  { Array<Complex>::clear (n, 1); }
146 
147 };
148 
150 
151 #endif