comparison liboctave/fCColVector.h @ 7789:82be108cc558

First attempt at single precision tyeps * * * corrections to qrupdate single precision routines * * * prefer demotion to single over promotion to double * * * Add single precision support to log2 function * * * Trivial PROJECT file update * * * Cache optimized hermitian/transpose methods * * * Add tests for tranpose/hermitian and ChangeLog entry for new transpose code
author David Bateman <dbateman@free.fr>
date Sun, 27 Apr 2008 22:34:17 +0200
parents
children eb63fbe60fab
comparison
equal deleted inserted replaced
7788:45f5faba05a2 7789:82be108cc558
1 /*
2
3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2003, 2004, 2005,
4 2006, 2007 John W. Eaton
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_FloatComplexColumnVector_h)
25 #define octave_FloatComplexColumnVector_h 1
26
27 #include "MArray.h"
28
29 #include "mx-defs.h"
30
31 class
32 OCTAVE_API
33 FloatComplexColumnVector : public MArray<FloatComplex>
34 {
35 friend class FloatComplexMatrix;
36 friend class FloatComplexRowVector;
37
38 public:
39
40 FloatComplexColumnVector (void) : MArray<FloatComplex> () { }
41
42 explicit FloatComplexColumnVector (octave_idx_type n) : MArray<FloatComplex> (n) { }
43
44 FloatComplexColumnVector (octave_idx_type n, const FloatComplex& val)
45 : MArray<FloatComplex> (n, val) { }
46
47 FloatComplexColumnVector (const FloatComplexColumnVector& a) : MArray<FloatComplex> (a) { }
48
49 FloatComplexColumnVector (const MArray<FloatComplex>& a) : MArray<FloatComplex> (a) { }
50
51 explicit FloatComplexColumnVector (const FloatColumnVector& a);
52
53 FloatComplexColumnVector& operator = (const FloatComplexColumnVector& a)
54 {
55 MArray<FloatComplex>::operator = (a);
56 return *this;
57 }
58
59 bool operator == (const FloatComplexColumnVector& a) const;
60 bool operator != (const FloatComplexColumnVector& a) const;
61
62 // destructive insert/delete/reorder operations
63
64 FloatComplexColumnVector& insert (const FloatColumnVector& a, octave_idx_type r);
65 FloatComplexColumnVector& insert (const FloatComplexColumnVector& a, octave_idx_type r);
66
67 FloatComplexColumnVector& fill (float val);
68 FloatComplexColumnVector& fill (const FloatComplex& val);
69 FloatComplexColumnVector& fill (float val, octave_idx_type r1, octave_idx_type r2);
70 FloatComplexColumnVector& fill (const FloatComplex& val, octave_idx_type r1, octave_idx_type r2);
71
72 FloatComplexColumnVector stack (const FloatColumnVector& a) const;
73 FloatComplexColumnVector stack (const FloatComplexColumnVector& a) const;
74
75 FloatComplexRowVector hermitian (void) const;
76 FloatComplexRowVector transpose (void) const;
77
78 friend FloatComplexColumnVector conj (const FloatComplexColumnVector& a);
79
80 // resize is the destructive equivalent for this one
81
82 FloatComplexColumnVector extract (octave_idx_type r1, octave_idx_type r2) const;
83
84 FloatComplexColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const;
85
86 // column vector by column vector -> column vector operations
87
88 FloatComplexColumnVector& operator += (const FloatColumnVector& a);
89 FloatComplexColumnVector& operator -= (const FloatColumnVector& a);
90
91 // matrix by column vector -> column vector operations
92
93 friend FloatComplexColumnVector operator * (const FloatComplexMatrix& a,
94 const FloatColumnVector& b);
95
96 friend FloatComplexColumnVector operator * (const FloatComplexMatrix& a,
97 const FloatComplexColumnVector& b);
98
99 // matrix by column vector -> column vector operations
100
101 friend FloatComplexColumnVector operator * (const FloatMatrix& a,
102 const FloatComplexColumnVector& b);
103
104 // diagonal matrix by column vector -> column vector operations
105
106 friend FloatComplexColumnVector operator * (const FloatDiagMatrix& a,
107 const FloatComplexColumnVector& b);
108
109 friend FloatComplexColumnVector operator * (const FloatComplexDiagMatrix& a,
110 const ColumnVector& b);
111
112 friend FloatComplexColumnVector operator * (const FloatComplexDiagMatrix& a,
113 const FloatComplexColumnVector& b);
114
115 // other operations
116
117 typedef float (*dmapper) (const FloatComplex&);
118 typedef FloatComplex (*cmapper) (const FloatComplex&);
119
120 FloatColumnVector map (dmapper fcn) const;
121 FloatComplexColumnVector map (cmapper fcn) const;
122
123 FloatComplex min (void) const;
124 FloatComplex max (void) const;
125
126 // i/o
127
128 friend std::ostream& operator << (std::ostream& os, const FloatComplexColumnVector& a);
129 friend std::istream& operator >> (std::istream& is, FloatComplexColumnVector& a);
130
131 private:
132
133 FloatComplexColumnVector (FloatComplex *d, octave_idx_type l) : MArray<FloatComplex> (d, l) { }
134 };
135
136 MARRAY_FORWARD_DEFS (MArray, FloatComplexColumnVector, FloatComplex)
137
138 #endif
139
140 /*
141 ;;; Local Variables: ***
142 ;;; mode: C++ ***
143 ;;; End: ***
144 */