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
CRowVector.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2013 John W. Eaton
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 3 of the License, or (at your
10 option) any 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, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if !defined (octave_CRowVector_h)
24 #define octave_CRowVector_h 1
25 
26 #include "MArray.h"
27 #include "dRowVector.h"
28 
29 #include "mx-defs.h"
30 
31 class
32 OCTAVE_API
34 {
35  friend class ComplexColumnVector;
36 
37 public:
38 
39  ComplexRowVector (void) : MArray<Complex> (dim_vector (1, 0)) { }
40 
42  : MArray<Complex> (dim_vector (1, n)) { }
43 
44  explicit ComplexRowVector (const dim_vector& dv) : MArray<Complex> (dv) { }
45 
47  : MArray<Complex> (dim_vector (1, n), val) { }
48 
50 
52  : MArray<Complex> (a.as_row ()) { }
53 
55  : MArray<Complex> (a.as_row ()) { }
56 
57  explicit ComplexRowVector (const RowVector& a) : MArray<Complex> (a) { }
58 
60  {
62  return *this;
63  }
64 
65  bool operator == (const ComplexRowVector& a) const;
66  bool operator != (const ComplexRowVector& a) const;
67 
68  // destructive insert/delete/reorder operations
69 
72 
73  ComplexRowVector& fill (double val);
74  ComplexRowVector& fill (const Complex& val);
76  ComplexRowVector& fill (const Complex& val,
78 
79  ComplexRowVector append (const RowVector& a) const;
80  ComplexRowVector append (const ComplexRowVector& a) const;
81 
82  ComplexColumnVector hermitian (void) const;
83  ComplexColumnVector transpose (void) const;
84 
85  friend ComplexRowVector conj (const ComplexRowVector& a);
86 
87  // resize is the destructive equivalent for this one
88 
90 
92 
93  // row vector by row vector -> row vector operations
94 
97 
98  // row vector by matrix -> row vector
99 
101  const ComplexMatrix& b);
102 
103  friend ComplexRowVector operator * (const RowVector& a,
104  const ComplexMatrix& b);
105 
106  // other operations
107 
108  Complex min (void) const;
109  Complex max (void) const;
110 
111  // i/o
112 
113  friend std::ostream& operator << (std::ostream& os,
114  const ComplexRowVector& a);
115  friend std::istream& operator >> (std::istream& is, ComplexRowVector& a);
116 
117  void resize (octave_idx_type n, const Complex& rfv = Complex (0))
118  {
119  Array<Complex>::resize (dim_vector (1, n), rfv);
120  }
121 
123  { Array<Complex>::clear (1, n); }
124 
125 };
126 
127 // row vector by column vector -> scalar
128 
129 Complex OCTAVE_API operator * (const ComplexRowVector& a,
130  const ColumnVector& b);
131 
132 Complex OCTAVE_API operator * (const ComplexRowVector& a,
133  const ComplexColumnVector& b);
134 
135 // other operations
136 
137 OCTAVE_API ComplexRowVector linspace (const Complex& x1, const Complex& x2,
138  octave_idx_type n);
139 
141 
142 #endif