GNU Octave  4.0.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-2015 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
ComplexRowVector & fill(double val)
Definition: CRowVector.cc:121
ComplexColumnVector hermitian(void) const
Definition: CRowVector.cc:224
void resize(octave_idx_type n, const Complex &rfv=Complex(0))
Definition: CColVector.h:139
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:548
ComplexColumnVector(const Array< Complex > &a)
Definition: CColVector.h:56
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
Definition: boolSparse.cc:279
ComplexRowVector extract_n(octave_idx_type c1, octave_idx_type n) const
Definition: CRowVector.cc:259
ComplexRowVector extract(octave_idx_type c1, octave_idx_type c2) const
Definition: CRowVector.cc:244
static void transpose(octave_idx_type N, const octave_idx_type *ridx, const octave_idx_type *cidx, octave_idx_type *ridx2, octave_idx_type *cidx2)
Definition: symrcm.cc:382
ComplexColumnVector(octave_idx_type n, const Complex &val)
Definition: CColVector.h:48
Array< Complex > as_column(void) const
Return the array as a column vector.
Definition: Array.h:279
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type octave_idx_type r2
ComplexColumnVector(const ComplexColumnVector &a)
Definition: CColVector.h:51
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:244
ComplexRowVector & operator=(const ComplexRowVector &a)
Definition: CRowVector.h:59
friend class ComplexColumnVector
Definition: CRowVector.h:35
void resize(const dim_vector &dv, const T &rfv)
Definition: Array.cc:1033
ComplexColumnVector operator*(const ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:149
ComplexColumnVector operator-=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:149
void clear(octave_idx_type n)
Definition: CColVector.h:144
#define MARRAY_FORWARD_DEFS(B, R, T)
Definition: MArray-decl.h:236
Definition: dMatrix.h:35
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:519
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:233
void clear(void)
Definition: Array.cc:84
ComplexColumnVector(const dim_vector &dv)
Definition: CColVector.h:45
ComplexColumnVector operator+=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:149
ComplexColumnVector(void)
Definition: CColVector.h:40
ComplexRowVector & insert(const RowVector &a, octave_idx_type c)
Definition: CRowVector.cc:77
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type r1
std::complex< double > Complex
Definition: oct-cmplx.h:29
ComplexColumnVector(octave_idx_type n)
Definition: CColVector.h:42
T abs(T x)
Definition: pr-output.cc:3062
MArray< T > & operator=(const MArray< T > &a)
Definition: MArray.h:65
ComplexColumnVector(const MArray< Complex > &a)
Definition: CColVector.h:53
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:210