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
fColVector.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_fColVector_h)
25 #define octave_fColVector_h 1
26 
27 #include "MArray.h"
28 
29 #include "mx-defs.h"
30 
31 class
32 OCTAVE_API
34 {
35 public:
36 
37  FloatColumnVector (void) : MArray<float> (dim_vector (0, 1)) { }
38 
40  : MArray<float> (dim_vector (n, 1)) { }
41 
42  explicit FloatColumnVector (const dim_vector& dv)
43  : MArray<float> (dv.as_column ()) { }
44 
46  : MArray<float> (dim_vector (n, 1), val) { }
47 
49 
51  : MArray<float> (a.as_column ()) { }
52 
54  : MArray<float> (a.as_column ()) { }
55 
57  {
59  return *this;
60  }
61 
62  bool operator == (const FloatColumnVector& a) const;
63  bool operator != (const FloatColumnVector& a) const;
64 
65  // destructive insert/delete/reorder operations
66 
68 
69  FloatColumnVector& fill (float val);
71 
72  FloatColumnVector stack (const FloatColumnVector& a) const;
73 
74  FloatRowVector transpose (void) const;
75 
76  friend OCTAVE_API FloatColumnVector real (const FloatComplexColumnVector& a);
77  friend OCTAVE_API FloatColumnVector imag (const FloatComplexColumnVector& a);
78 
79  // resize is the destructive equivalent for this one
80 
82 
84 
85  // matrix by column vector -> column vector operations
86 
87  friend OCTAVE_API FloatColumnVector operator * (const FloatMatrix& a,
88  const FloatColumnVector& b);
89 
90  // diagonal matrix by column vector -> column vector operations
91 
92  friend OCTAVE_API FloatColumnVector operator * (const FloatDiagMatrix& a,
93  const FloatColumnVector& b);
94 
95  // other operations
96 
97  float min (void) const;
98  float max (void) const;
99 
100  FloatColumnVector abs (void) const;
101 
102  // i/o
103 
104  friend OCTAVE_API std::ostream& operator << (std::ostream& os,
105  const FloatColumnVector& a);
106  friend OCTAVE_API std::istream& operator >> (std::istream& is,
107  FloatColumnVector& a);
108 
109  void resize (octave_idx_type n, const float& rfv = 0)
110  {
111  Array<float>::resize (dim_vector (n, 1), rfv);
112  }
113 
115  { Array<float>::clear (n, 1); }
116 
117 };
118 
119 // Publish externally used friend functions.
120 
121 extern OCTAVE_API FloatColumnVector real (const FloatComplexColumnVector& a);
122 extern OCTAVE_API FloatColumnVector imag (const FloatComplexColumnVector& a);
123 
125 
126 #endif
OCTAVE_API FloatColumnVector real(const FloatComplexColumnVector &a)
Definition: fColVector.cc:155
FloatComplexRowVector & fill(float val)
Definition: fCRowVector.cc:122
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:548
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
Definition: boolSparse.cc:279
FloatComplexRowVector & operator=(const FloatComplexRowVector &a)
Definition: fCRowVector.h:63
FloatColumnVector operator*(const FloatColumnVector &x, const float &y)
Definition: fColVector.h:124
FloatColumnVector(const FloatColumnVector &a)
Definition: fColVector.h:48
FloatColumnVector(void)
Definition: fColVector.h:37
void resize(octave_idx_type n, const float &rfv=0)
Definition: fColVector.h:109
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
FloatColumnVector(const dim_vector &dv)
Definition: fColVector.h:42
void clear(octave_idx_type n)
Definition: fColVector.h:114
FloatComplexRowVector extract_n(octave_idx_type c1, octave_idx_type n) const
Definition: fCRowVector.cc:260
OCTAVE_API FloatColumnVector imag(const FloatComplexColumnVector &a)
Definition: fColVector.cc:161
FloatColumnVector(const Array< float > &a)
Definition: fColVector.h:53
Array< FloatComplex > 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
FloatComplexRowVector extract(octave_idx_type c1, octave_idx_type c2) const
Definition: fCRowVector.cc:245
void resize(const dim_vector &dv, const T &rfv)
Definition: Array.cc:1033
FloatColumnVector(octave_idx_type n)
Definition: fColVector.h:39
#define MARRAY_FORWARD_DEFS(B, R, T)
Definition: MArray-decl.h:236
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:519
FloatColumnVector(octave_idx_type n, float val)
Definition: fColVector.h:45
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:233
void clear(void)
Definition: Array.cc:84
FloatColumnVector(const MArray< float > &a)
Definition: fColVector.h:50
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
FloatComplexRowVector & insert(const FloatRowVector &a, octave_idx_type c)
Definition: fCRowVector.cc:77
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type r1
T abs(T x)
Definition: pr-output.cc:3062
MArray< T > & operator=(const MArray< T > &a)
Definition: MArray.h:65
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:210