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
CRowVector.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2017 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 "octave-config.h"
27 
28 #include "MArray.h"
29 #include "dRowVector.h"
30 
31 #include "mx-defs.h"
32 
33 class
34 OCTAVE_API
36 {
37  friend class ComplexColumnVector;
38 
39 public:
40 
41  ComplexRowVector (void) : MArray<Complex> (dim_vector (1, 0)) { }
42 
44  : MArray<Complex> (dim_vector (1, n)) { }
45 
46  explicit ComplexRowVector (const dim_vector& dv) : MArray<Complex> (dv) { }
47 
49  : MArray<Complex> (dim_vector (1, n), val) { }
50 
52 
54  : MArray<Complex> (a.as_row ()) { }
55 
57  : MArray<Complex> (a.as_row ()) { }
58 
59  explicit ComplexRowVector (const RowVector& a) : MArray<Complex> (a) { }
60 
62  {
64  return *this;
65  }
66 
67  bool operator == (const ComplexRowVector& a) const;
68  bool operator != (const ComplexRowVector& a) const;
69 
70  // destructive insert/delete/reorder operations
71 
74 
75  ComplexRowVector& fill (double val);
76  ComplexRowVector& fill (const Complex& val);
80 
81  ComplexRowVector append (const RowVector& a) const;
83 
84  ComplexColumnVector hermitian (void) const;
85  ComplexColumnVector transpose (void) const;
86 
87  friend ComplexRowVector conj (const ComplexRowVector& a);
88 
89  // resize is the destructive equivalent for this one
90 
92 
94 
95  // row vector by row vector -> row vector operations
96 
99 
100  // row vector by matrix -> row vector
101 
103  const ComplexMatrix& b);
104 
105  friend ComplexRowVector operator * (const RowVector& a,
106  const ComplexMatrix& b);
107 
108  // other operations
109 
110  Complex min (void) const;
111  Complex max (void) const;
112 
113  // i/o
114 
115  friend std::ostream& operator << (std::ostream& os,
116  const ComplexRowVector& a);
117  friend std::istream& operator >> (std::istream& is, ComplexRowVector& a);
118 
119  void resize (octave_idx_type n, const Complex& rfv = Complex (0))
120  {
121  Array<Complex>::resize (dim_vector (1, n), rfv);
122  }
123 
125  { Array<Complex>::clear (1, n); }
126 
127 };
128 
129 // row vector by column vector -> scalar
130 
131 Complex OCTAVE_API operator * (const ComplexRowVector& a,
132  const ColumnVector& b);
133 
134 Complex OCTAVE_API operator * (const ComplexRowVector& a,
135  const ComplexColumnVector& b);
136 
137 // other operations
138 
139 OCTAVE_API ComplexRowVector linspace (const Complex& x1, const Complex& x2,
140  octave_idx_type n);
141 
143 
144 #endif
ComplexRowVector(const MArray< Complex > &a)
Definition: CRowVector.h:53
ComplexColumnVector & insert(const ColumnVector &a, octave_idx_type r)
Definition: CColVector.cc:63
void clear(octave_idx_type n)
Definition: CRowVector.h:124
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:567
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
Definition: boolSparse.cc:279
ComplexRowVector(const dim_vector &dv)
Definition: CRowVector.h:46
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
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
ComplexRowVector(octave_idx_type n)
Definition: CRowVector.h:43
ComplexRowVector(const Array< Complex > &a)
Definition: CRowVector.h:56
Array< Complex > as_row(void) const
Return the array as a row vector.
Definition: Array.h:377
#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
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:216
ComplexRowVector(octave_idx_type n, const Complex &val)
Definition: CRowVector.h:48
ComplexColumnVector extract_n(octave_idx_type r1, octave_idx_type n) const
Definition: CColVector.cc:239
ComplexRowVector(void)
Definition: CRowVector.h:41
ComplexColumnVector extract(octave_idx_type r1, octave_idx_type r2) const
Definition: CColVector.cc:224
ComplexRowVector operator-=(ComplexRowVector &x, const Complex &y)
Definition: CRowVector.h:142
Complex OCTAVE_API operator*(const ComplexRowVector &a, const ColumnVector &b)
Definition: CRowVector.cc:398
ComplexRowVector(const ComplexRowVector &a)
Definition: CRowVector.h:51
void resize(const dim_vector &dv, const T &rfv)
Definition: Array.cc:1028
bool append
Definition: load-save.cc:1582
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
Definition: lu.cc:138
void resize(octave_idx_type n, const Complex &rfv=Complex(0))
Definition: CRowVector.h:119
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:538
ComplexRowVector hermitian(void) const
Definition: CColVector.cc:198
ComplexRowVector(const RowVector &a)
Definition: CRowVector.h:59
ComplexColumnVector & fill(double val)
Definition: CColVector.cc:101
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:228
void clear(void)
Definition: Array.cc:95
OCTAVE_API ComplexRowVector linspace(const Complex &x1, const Complex &x2, octave_idx_type n)
Definition: CRowVector.cc:425
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
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
ComplexColumnVector & operator=(const ComplexColumnVector &a)
Definition: CColVector.h:63
MArray< T > & operator=(const MArray< T > &a)
Definition: MArray.h:85
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:205
ComplexRowVector operator+=(ComplexRowVector &x, const Complex &y)
Definition: CRowVector.h:142