GNU Octave  4.2.1
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-2017 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 "octave-config.h"
28 
29 #include "MArray.h"
30 
31 #include "mx-defs.h"
32 
33 class
34 OCTAVE_API
36 {
37  friend class ComplexMatrix;
38  friend class ComplexRowVector;
39 
40 public:
41 
43 
45  : MArray<Complex> (dim_vector (n, 1)) { }
46 
47  explicit ComplexColumnVector (const dim_vector& dv)
48  : MArray<Complex> (dv.as_column ()) { }
49 
51  : MArray<Complex> (dim_vector (n, 1), val) { }
52 
54 
56  : MArray<Complex> (a.as_column ()) { }
57 
59  : MArray<Complex> (a.as_column ()) { }
60 
61  explicit ComplexColumnVector (const ColumnVector& a);
62 
64  {
66  return *this;
67  }
68 
69  bool operator == (const ComplexColumnVector& a) const;
70  bool operator != (const ComplexColumnVector& a) const;
71 
72  // destructive insert/delete/reorder operations
73 
76 
77  ComplexColumnVector& fill (double val);
79  ComplexColumnVector& fill (double val,
83 
84  ComplexColumnVector stack (const ColumnVector& a) const;
85  ComplexColumnVector stack (const ComplexColumnVector& a) const;
86 
87  ComplexRowVector hermitian (void) const;
88  ComplexRowVector transpose (void) const;
89 
90  friend OCTAVE_API ComplexColumnVector conj (const ComplexColumnVector& a);
91 
92  // resize is the destructive equivalent for this one
93 
95 
97 
98  // column vector by column vector -> column vector operations
99 
102 
103  // matrix by column vector -> column vector operations
104 
105  friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a,
106  const ColumnVector& b);
107 
108  friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a,
109  const ComplexColumnVector& b);
110 
111  // matrix by column vector -> column vector operations
112 
113  friend OCTAVE_API ComplexColumnVector operator * (const Matrix& a,
114  const ComplexColumnVector& b);
115 
116  // diagonal matrix by column vector -> column vector operations
117 
118  friend OCTAVE_API ComplexColumnVector operator * (const DiagMatrix& a,
119  const ComplexColumnVector& b);
120 
121  friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a,
122  const ColumnVector& b);
123 
124  friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a,
125  const ComplexColumnVector& b);
126 
127  // other operations
128 
129  Complex min (void) const;
130  Complex max (void) const;
131 
132  ColumnVector abs (void) const;
133 
134  // i/o
135 
136  friend OCTAVE_API std::ostream& operator << (std::ostream& os,
137  const ComplexColumnVector& a);
138  friend OCTAVE_API std::istream& operator >> (std::istream& is,
140 
141  void resize (octave_idx_type n, const Complex& rfv = Complex (0))
142  {
143  Array<Complex>::resize (dim_vector (n, 1), rfv);
144  }
145 
147  { Array<Complex>::clear (n, 1); }
148 
149 };
150 
152 
153 #endif
ComplexRowVector & fill(double val)
Definition: CRowVector.cc:96
ComplexColumnVector hermitian(void) const
Definition: CRowVector.cc:193
void resize(octave_idx_type n, const Complex &rfv=Complex(0))
Definition: CColVector.h:141
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:567
ComplexColumnVector(const Array< Complex > &a)
Definition: CColVector.h:58
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
Definition: boolSparse.cc:279
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
ComplexRowVector extract_n(octave_idx_type c1, octave_idx_type n) const
Definition: CRowVector.cc:228
ComplexRowVector extract(octave_idx_type c1, octave_idx_type c2) const
Definition: CRowVector.cc:213
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:50
#define MARRAY_FORWARD_DEFS(B, R, T)
Definition: MArray.h:126
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
Array< Complex > as_column(void) const
Return the array as a column vector.
Definition: Array.h:367
ComplexColumnVector(const ComplexColumnVector &a)
Definition: CColVector.h:53
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:216
ComplexRowVector & operator=(const ComplexRowVector &a)
Definition: CRowVector.h:61
friend class ComplexColumnVector
Definition: CRowVector.h:37
void resize(const dim_vector &dv, const T &rfv)
Definition: Array.cc:1028
ComplexColumnVector operator*(const ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:151
ComplexColumnVector operator-=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:151
void clear(octave_idx_type n)
Definition: CColVector.h:146
Definition: dMatrix.h:37
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:538
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:228
void clear(void)
Definition: Array.cc:95
ComplexColumnVector(const dim_vector &dv)
Definition: CColVector.h:47
ComplexColumnVector operator+=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:151
ComplexColumnVector(void)
Definition: CColVector.h:42
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
ComplexRowVector & insert(const RowVector &a, octave_idx_type c)
Definition: CRowVector.cc:58
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
b
Definition: cellfun.cc:398
std::complex< double > Complex
Definition: oct-cmplx.h:31
ComplexColumnVector(octave_idx_type n)
Definition: CColVector.h:44
write the output to stdout if nargout is
Definition: load-save.cc:1576
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:87
dim_vector dv
Definition: sub2ind.cc:263
MArray< T > & operator=(const MArray< T > &a)
Definition: MArray.h:85
ComplexColumnVector(const MArray< Complex > &a)
Definition: CColVector.h:55
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:205