annotate main/fixed/src/fixedCColVector.cc @ 9481:d84d2fea3c90 octave-forge

Re-enable compilation of fixed package
author jordigh
date Wed, 22 Feb 2012 22:07:33 +0000
parents f8d77845533f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
1 // Fixed Point Complex ColumnVector manipulations.
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
2 /*
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
3
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
4 Copyright (C) 2003 Motorola Inc
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
5 Copyright (C) 2003 David Bateman
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
6
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
7 This program is free software; you can redistribute it and/or modify it
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
10 later version.
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
11
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
12 This program is distributed in the hope that it will be useful, but WITHOUT
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
15 for more details.
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
16
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
4404
2de537641f94 More copyright updates
adb014
parents: 3272
diff changeset
18 along with this program; see the file COPYING. If not, see
2de537641f94 More copyright updates
adb014
parents: 3272
diff changeset
19 <http://www.gnu.org/licenses/>.
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
20
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
21 In addition to the terms of the GPL, you are permitted to link
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
22 this program with any Open Source program, as defined by the
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
23 Open Source Initiative (www.opensource.org)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
24
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
25 */
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
26
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
27 #include <iostream>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
28
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
29 #include <octave/config.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
30 #include <octave/lo-utils.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
31 #include <octave/lo-error.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
32 #include <octave/error.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
33 #include <octave/gripes.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
34 #include <octave/ops.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
35
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
36 #include "fixedCMatrix.h"
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
37 #include "fixedCRowVector.h"
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
38 #include "fixedCColVector.h"
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
39
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
40 // Fixed Point Complex Column Vector class
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
41
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
42
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
43 FixedComplexColumnVector::FixedComplexColumnVector (const MArray<int> &is,
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
44 const MArray<int> &ds)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
45 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
46 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
47 if (length() != ds.length()) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
48 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
49 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
50 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
51
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
52 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
53 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
54 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
55
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
56 FixedComplexColumnVector::FixedComplexColumnVector (const ColumnVector &is,
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
57 const ColumnVector &ds)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
58 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
59 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
60 if (length() != ds.length()) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
61 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
62 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
63 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
64
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
65 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
66 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
67 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
68
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
69 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
70 (const ComplexColumnVector &is, const ComplexColumnVector &ds)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
71 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
72 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
73 if (length() != ds.length()) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
74 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
75 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
76 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
77
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
78 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
79 elem (i) = FixedPointComplex(is(i), ds(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
80 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
81
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
82 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
83 (unsigned int is, unsigned int ds, const FixedComplexColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
84 : MArray<FixedPointComplex> (dim_vector (a.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
85 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
86 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
87 elem (i) = FixedPointComplex(is, ds, a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
88 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
89
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
90 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
91 (Complex is, Complex ds, const FixedComplexColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
92 : MArray<FixedPointComplex> (dim_vector (a.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
93 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
94 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
95 elem (i) = FixedPointComplex(is, ds, a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
96 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
97
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
98 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
99 (const MArray<int> &is, const MArray<int> &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
100 const FixedComplexColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
101 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
102 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
103 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
104 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
105 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
106 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
107
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
108 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
109 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i),
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
110 a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
111 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
112
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
113 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
114 (const ColumnVector &is, const ColumnVector &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
115 const FixedComplexColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
116 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
117 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
118 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
119 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
120 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
121 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
122
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
123 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
124 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i),
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
125 a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
126 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
127
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
128 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
129 (const ComplexColumnVector &is, const ComplexColumnVector &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
130 const FixedComplexColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
131 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
132 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
133 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
134 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
135 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
136 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
137
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
138 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
139 elem (i) = FixedPointComplex(is(i), ds(i), a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
140 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
141
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
142 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
143 (unsigned int is, unsigned int ds, const FixedColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
144 : MArray<FixedPointComplex> (dim_vector (a.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
145 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
146 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
147 elem (i) = FixedPointComplex(is, ds, a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
148 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
149
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
150 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
151 (Complex is, Complex ds, const FixedColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
152 : MArray<FixedPointComplex> (dim_vector (a.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
153 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
154 for (int i = 0; i < length (); i++)
3071
fa041e4681b4 Fix MSVC compilation.
goffioul
parents: 2394
diff changeset
155 elem (i) = FixedPointComplex(is, ds, FixedPointComplex(a(i)));
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
156 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
157
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
158 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
159 (const MArray<int> &is, const MArray<int> &ds, const FixedColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
160 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
161 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
162 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
163 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
164 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
165 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
166
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
167 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
168 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i),
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
169 a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
170 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
171
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
172 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
173 (const ColumnVector &is, const ColumnVector &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
174 const FixedColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
175 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
176 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
177 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
178 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
179 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
180 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
181
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
182 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
183 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i),
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
184 a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
185 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
186
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
187 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
188 (const ComplexColumnVector &is, const ComplexColumnVector &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
189 const FixedColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
190 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
191 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
192 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
193 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
194 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
195 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
196
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
197 for (int i = 0; i < length (); i++)
3071
fa041e4681b4 Fix MSVC compilation.
goffioul
parents: 2394
diff changeset
198 elem (i) = FixedPointComplex(is(i), ds(i), FixedPointComplex(a(i)));
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
199 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
200
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
201 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
202 (unsigned int is, unsigned int ds, const ComplexColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
203 : MArray<FixedPointComplex> (dim_vector (a.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
204 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
205 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
206 elem (i) = FixedPointComplex(is, ds, a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
207 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
208
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
209 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
210 (Complex is, Complex ds, const ComplexColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
211 : MArray<FixedPointComplex> (dim_vector (a.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
212 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
213 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
214 elem (i) = FixedPointComplex(is, ds, a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
215 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
216
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
217 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
218 (const MArray<int> &is, const MArray<int> &ds, const ComplexColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
219 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
220 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
221 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
222 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
223 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
224 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
225
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
226 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
227 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i),
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
228 a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
229 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
230
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
231 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
232 (const ColumnVector &is, const ColumnVector &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
233 const ComplexColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
234 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
235 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
236 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
237 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
238 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
239 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
240
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
241 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
242 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i),
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
243 a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
244 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
245
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
246 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
247 (const ComplexColumnVector &is, const ComplexColumnVector &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
248 const ComplexColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
249 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
250 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
251 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
252 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
253 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
254 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
255
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
256 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
257 elem (i) = FixedPointComplex(is(i), ds(i), a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
258 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
259
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
260 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
261 (unsigned int is, unsigned int ds, const ColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
262 : MArray<FixedPointComplex> (dim_vector (a.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
263 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
264 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
265 elem (i) = FixedPointComplex(is, ds, a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
266 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
267
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
268 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
269 (Complex is, Complex ds, const ColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
270 : MArray<FixedPointComplex> (dim_vector (a.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
271 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
272 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
273 elem (i) = FixedPointComplex(is, ds, a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
274 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
275
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
276 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
277 (const MArray<int> &is, const MArray<int> &ds, const ColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
278 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
279 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
280 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
281 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
282 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
283 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
284
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
285 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
286 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i),
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
287 a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
288 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
289
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
290 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
291 (const ColumnVector &is, const ColumnVector &ds, const ColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
292 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
293 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
294 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
295 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
296 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
297 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
298
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
299 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
300 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i),
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
301 a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
302 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
303
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
304 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
305 (const ComplexColumnVector &is, const ComplexColumnVector &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
306 const ColumnVector& a)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
307 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
308 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
309 if ((length() != ds.length()) || (length() != a.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
310 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
311 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
312 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
313
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
314 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
315 elem (i) = FixedPointComplex(is(i), ds(i), a(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
316 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
317
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
318 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
319 (unsigned int is, unsigned int ds, const ComplexColumnVector& a,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
320 const ComplexColumnVector& b)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
321 : MArray<FixedPointComplex> (dim_vector (a.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
322 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
323 if (length() != b.length()) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
324 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
325 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
326 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
327
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
328 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
329 elem (i) = FixedPointComplex(is, ds, a(i), b(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
330 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
331
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
332 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
333 (Complex is, Complex ds, const ComplexColumnVector& a,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
334 const ComplexColumnVector& b)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
335 : MArray<FixedPointComplex> (dim_vector (a.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
336 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
337 if (length() != b.length()) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
338 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
339 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
340 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
341
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
342 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
343 elem (i) = FixedPointComplex(is, ds, a(i), b(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
344 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
345
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
346 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
347 (const MArray<int> &is, const MArray<int> &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
348 const ComplexColumnVector& a, const ComplexColumnVector& b)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
349 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
350 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
351 if ((length() != ds.length()) || (length() != a.length()) ||
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
352 (length() != b.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
353 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
354 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
355 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
356
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
357 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
358 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i),
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
359 a(i), b(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
360 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
361
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
362 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
363 (const ColumnVector &is, const ColumnVector &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
364 const ComplexColumnVector& a, const ComplexColumnVector& b)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
365 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
366 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
367 if ((length() != ds.length()) || (length() != a.length()) ||
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
368 (length() != b.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
369 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
370 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
371 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
372
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
373 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
374 elem (i) = FixedPointComplex((unsigned int)is(i), (unsigned int)ds(i),
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
375 a(i), b(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
376 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
377
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
378 FixedComplexColumnVector::FixedComplexColumnVector
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
379 (const ComplexColumnVector &is, const ComplexColumnVector &ds,
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
380 const ComplexColumnVector& a, const ComplexColumnVector& b)
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
381 : MArray<FixedPointComplex> (dim_vector (is.length(), 1))
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
382 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
383 if ((length() != ds.length()) || (length() != a.length()) ||
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
384 (length() != b.length())) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
385 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
386 return;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
387 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
388
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
389 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
390 elem (i) = FixedPointComplex(is(i), ds(i), a(i), b(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
391 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
392
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
393 #define GET_FIXED_PROP(METHOD) \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
394 ComplexColumnVector \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
395 FixedComplexColumnVector:: METHOD (void) const \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
396 { \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
397 int len = length(); \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
398 ComplexColumnVector retval(len); \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
399 for (int i = 0; i < len; i++) \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
400 retval(i) = elem(i) . METHOD (); \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
401 return retval; \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
402 } \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
403
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
404 GET_FIXED_PROP(sign);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
405 GET_FIXED_PROP(getdecsize);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
406 GET_FIXED_PROP(getintsize);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
407 GET_FIXED_PROP(getnumber);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
408 GET_FIXED_PROP(fixedpoint);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
409
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
410 #undef GET_FIXED_PROP
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
411
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
412 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
413 FixedComplexColumnVector::chdecsize (const Complex n)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
414 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
415 int len = length();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
416 FixedComplexColumnVector retval(len);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
417
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
418 for (int i = 0; i < len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
419 retval(i) = FixedPointComplex(elem(i).getintsize(), n, elem(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
420
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
421 return retval;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
422 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
423
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
424 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
425 FixedComplexColumnVector::chdecsize (const ComplexColumnVector &n)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
426 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
427 int len = length();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
428
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
429 if (len != n.length()) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
430 (*current_liboctave_error_handler) ("vector size mismatch in chdecsize");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
431 return FixedComplexColumnVector();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
432 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
433
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
434 FixedComplexColumnVector retval(len);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
435
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
436 for (int i = 0; i < len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
437 retval(i) = FixedPointComplex(elem(i).getintsize(), n(i), elem(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
438
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
439 return retval;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
440 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
441
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
442 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
443 FixedComplexColumnVector::chintsize (const Complex n)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
444 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
445 int len = length();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
446 FixedComplexColumnVector retval(len);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
447
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
448 for (int i = 0; i < len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
449 retval(i) = FixedPointComplex(n, elem(i).getdecsize(), elem(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
450
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
451 return retval;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
452 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
453
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
454 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
455 FixedComplexColumnVector::chintsize (const ComplexColumnVector &n)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
456 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
457 int len = length();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
458
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
459 if (len != n.length()) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
460 (*current_liboctave_error_handler) ("vector size mismatch in chdecsize");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
461 return FixedComplexColumnVector();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
462 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
463
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
464 FixedComplexColumnVector retval(len);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
465
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
466 for (int i = 0; i < len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
467 retval(i) = FixedPointComplex(n(i), elem(i).getdecsize(), elem(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
468
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
469 return retval;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
470 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
471
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
472 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
473 FixedComplexColumnVector::incdecsize (const Complex n) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
474 return chdecsize(n + getdecsize());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
475 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
476
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
477 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
478 FixedComplexColumnVector::incdecsize (const ComplexColumnVector &n) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
479 if (n.length() != length()) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
480 (*current_liboctave_error_handler) ("vector size mismatch in incdecsize");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
481 return FixedComplexColumnVector();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
482 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
483 return chdecsize(n + getdecsize());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
484 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
485
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
486 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
487 FixedComplexColumnVector::incdecsize () {
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
488 return chdecsize(Complex (1) + getdecsize());
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
489 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
490
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
491 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
492 FixedComplexColumnVector::incintsize (const Complex n) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
493 return chintsize(n + getintsize());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
494 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
495
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
496 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
497 FixedComplexColumnVector::incintsize (const ComplexColumnVector &n) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
498 if (n.length() != length()) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
499 (*current_liboctave_error_handler) ("vector size mismatch in incintsize");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
500 return FixedComplexColumnVector();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
501 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
502 return chintsize(n + getintsize());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
503 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
504
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
505 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
506 FixedComplexColumnVector::incintsize () {
9481
d84d2fea3c90 Re-enable compilation of fixed package
jordigh
parents: 5248
diff changeset
507 return chintsize(Complex (1) + getintsize());
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
508 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
509
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
510 // Fixed Point Complex Column Vector class.
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
511
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
512 bool
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
513 FixedComplexColumnVector::operator == (const FixedComplexColumnVector& a) const
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
514 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
515 int len = length ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
516 if (len != a.length ())
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
517 return 0;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
518
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
519 for (int i = 0; i < len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
520 if (elem(i) != a.elem(i))
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
521 return false;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
522 return true;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
523 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
524
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
525 bool
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
526 FixedComplexColumnVector::operator != (const FixedComplexColumnVector& a) const
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
527 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
528 return !(*this == a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
529 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
530
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
531 FixedComplexColumnVector&
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
532 FixedComplexColumnVector::insert (const FixedComplexColumnVector& a, int r)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
533 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
534 int a_len = a.length ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
535
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
536 if (r < 0 || r + a_len > length ())
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
537 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
538 (*current_liboctave_error_handler) ("range error for insert");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
539 return *this;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
540 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
541
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
542 if (a_len > 0)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
543 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
544 make_unique ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
545
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
546 for (int i = 0; i < a_len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
547 xelem (r+i) = a.elem (i);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
548 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
549
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
550 return *this;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
551 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
552
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
553 FixedComplexColumnVector&
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
554 FixedComplexColumnVector::fill (FixedPointComplex val)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
555 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
556 int len = length ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
557
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
558 if (len > 0)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
559 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
560 make_unique ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
561
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
562 for (int i = 0; i < len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
563 xelem (i) = val;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
564 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
565
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
566 return *this;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
567 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
568
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
569 FixedComplexColumnVector&
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
570 FixedComplexColumnVector::fill (FixedPointComplex val, int r1, int r2)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
571 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
572 int len = length ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
573
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
574 if (r1 < 0 || r2 < 0 || r1 >= len || r2 >= len)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
575 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
576 (*current_liboctave_error_handler) ("range error for fill");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
577 return *this;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
578 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
579
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
580 if (r1 > r2) { int tmp = r1; r1 = r2; r2 = tmp; }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
581
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
582 if (r2 >= r1)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
583 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
584 make_unique ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
585
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
586 for (int i = r1; i <= r2; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
587 xelem (i) = val;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
588 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
589
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
590 return *this;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
591 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
592
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
593 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
594 FixedComplexColumnVector::stack (const FixedComplexColumnVector& a) const
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
595 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
596 int len = length ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
597 int nr_insert = len;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
598 FixedComplexColumnVector retval (len + a.length ());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
599 retval.insert (*this, 0);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
600 retval.insert (a, nr_insert);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
601 return retval;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
602 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
603
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
604 FixedComplexRowVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
605 FixedComplexColumnVector::transpose (void) const
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
606 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
607 return FixedComplexRowVector (*this);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
608 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
609
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
610 // resize is the destructive equivalent for this one
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
611
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
612 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
613 FixedComplexColumnVector::extract (int r1, int r2) const
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
614 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
615 if (r1 > r2) { int tmp = r1; r1 = r2; r2 = tmp; }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
616
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
617 int new_r = r2 - r1 + 1;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
618
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
619 FixedComplexColumnVector result (new_r);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
620
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
621 for (int i = 0; i < new_r; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
622 result.xelem (i) = elem (r1+i);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
623
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
624 return result;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
625 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
626
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
627 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
628 FixedComplexColumnVector::extract_n (int r1, int n) const
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
629 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
630 FixedComplexColumnVector result (n);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
631
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
632 for (int i = 0; i < n; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
633 result.xelem (i) = elem (r1+i);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
634
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
635 return result;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
636 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
637
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
638 // fixed point matrix by fixed column vector -> fixed column vector operations
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
639
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
640 FixedComplexColumnVector
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
641 operator * (const FixedComplexMatrix& m, const FixedComplexColumnVector& a)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
642 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
643 FixedComplexColumnVector retval;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
644
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
645 int nr = m.rows ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
646 int nc = m.cols ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
647
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
648 int a_len = a.length ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
649
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
650 if (nc != a_len)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
651 gripe_nonconformant ("operator *", nr, nc, a_len, 1);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
652 else
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
653 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
654 retval.resize (nr, FixedPointComplex());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
655 if (nr != 0 && nc != 0)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
656 for (int i = 0; i < nc; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
657 for (int j = 0; j < nr; j++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
658 retval.elem (j) += a.elem(i) * m.elem(j,i);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
659 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
660
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
661 return retval;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
662 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
663
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
664 // other operations
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
665
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
666 FixedComplexColumnVector
5248
f8d77845533f Changes for compilation with 3.1.51+
adb014
parents: 4404
diff changeset
667 FixedComplexColumnVector::map (fpc_fpc_Mapper f) const
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
668 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
669 FixedComplexColumnVector b (*this);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
670 return b.apply (f);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
671 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
672
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
673 FixedComplexColumnVector&
5248
f8d77845533f Changes for compilation with 3.1.51+
adb014
parents: 4404
diff changeset
674 FixedComplexColumnVector::apply (fpc_fpc_Mapper f)
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
675 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
676 FixedPointComplex *d = fortran_vec (); // Ensures only one reference to my privates!
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
677
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
678 for (int i = 0; i < length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
679 d[i] = f (d[i]);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
680
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
681 return *this;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
682 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
683
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
684 FixedPointComplex
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
685 FixedComplexColumnVector::min (void) const
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
686 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
687 int len = length ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
688 if (len == 0)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
689 return FixedPointComplex();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
690
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
691 FixedPointComplex res = elem (0);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
692 double res_val = std::abs(res.fixedpoint ());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
693
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
694 for (int i = 1; i < len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
695 if (std::abs(elem (i) .fixedpoint ()) < res_val) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
696 res = elem (i);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
697 res_val = std::abs(res.fixedpoint ());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
698 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
699
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
700 return res;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
701 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
702
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
703 FixedPointComplex
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
704 FixedComplexColumnVector::max (void) const
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
705 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
706 int len = length ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
707 if (len == 0)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
708 return FixedPointComplex();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
709
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
710 FixedPointComplex res = elem (0);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
711 double res_val = std::abs(res.fixedpoint ());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
712
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
713 for (int i = 1; i < len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
714 if (std::abs(elem (i) .fixedpoint ()) > res_val) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
715 res = elem (i);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
716 res_val = std::abs(res.fixedpoint ());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
717 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
718
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
719 return res;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
720 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
721
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
722 #define DO_FIXED_VEC_FUNC(FUNC, MT) \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
723 MT FUNC (const FixedComplexColumnVector& x) \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
724 { \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
725 MT retval (x.length()); \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
726 for (int i = 0; i < x.length(); i++) \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
727 retval(i) = FUNC ( x (i) ); \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
728 return retval; \
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
729 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
730
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
731 DO_FIXED_VEC_FUNC(real, FixedColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
732 DO_FIXED_VEC_FUNC(imag, FixedColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
733 DO_FIXED_VEC_FUNC(conj, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
734 DO_FIXED_VEC_FUNC(abs, FixedColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
735 DO_FIXED_VEC_FUNC(norm, FixedColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
736 DO_FIXED_VEC_FUNC(arg, FixedColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
737 DO_FIXED_VEC_FUNC(cos, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
738 DO_FIXED_VEC_FUNC(cosh, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
739 DO_FIXED_VEC_FUNC(sin, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
740 DO_FIXED_VEC_FUNC(sinh, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
741 DO_FIXED_VEC_FUNC(tan, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
742 DO_FIXED_VEC_FUNC(tanh, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
743 DO_FIXED_VEC_FUNC(sqrt, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
744 DO_FIXED_VEC_FUNC(exp, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
745 DO_FIXED_VEC_FUNC(log, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
746 DO_FIXED_VEC_FUNC(log10, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
747 DO_FIXED_VEC_FUNC(round, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
748 DO_FIXED_VEC_FUNC(rint, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
749 DO_FIXED_VEC_FUNC(floor, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
750 DO_FIXED_VEC_FUNC(ceil, FixedComplexColumnVector);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
751
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
752 FixedComplexColumnVector polar (const FixedColumnVector &r,
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
753 const FixedColumnVector &p)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
754 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
755 if (r.length() != p.length()) {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
756 (*current_liboctave_error_handler) ("vector size mismatch");
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
757 return FixedComplexColumnVector();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
758 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
759
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
760 FixedComplexColumnVector retval ( r.length());
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
761 for (int i = 0; i < r.length(); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
762 retval(i) = polar ( r (i), p (i) );
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
763 return retval;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
764 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
765
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
766 FixedComplexColumnVector elem_pow (const FixedComplexColumnVector &a,
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
767 const FixedComplexColumnVector &b)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
768 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
769 FixedComplexColumnVector retval;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
770 int a_len = a.length ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
771 int b_len = b.length ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
772
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
773 if (a_len == 1)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
774 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
775 retval.resize(b_len);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
776 FixedPointComplex ad = a(0);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
777 for (int i = 0; i < b_len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
778 retval(i) = pow(ad, b(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
779 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
780 else if (b_len == 1)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
781 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
782 retval.resize(a_len);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
783 FixedPointComplex bd = b(0);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
784 for (int i = 0; i < a_len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
785 retval(i) = pow(a(i), bd);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
786 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
787 else if (a_len == b_len)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
788 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
789 retval.resize(a_len);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
790 for (int i = 0; i < a_len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
791 retval(i) = pow(a(i), b(i));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
792 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
793 else
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
794 gripe_nonconformant ("operator .^", a_len, b_len);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
795
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
796 return retval;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
797 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
798
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
799 FixedComplexColumnVector elem_pow (const FixedComplexColumnVector &a, const FixedPointComplex &b)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
800 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
801 return elem_pow (a, FixedComplexColumnVector(1, b));
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
802 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
803
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
804 FixedComplexColumnVector elem_pow (const FixedPointComplex &a, const FixedComplexColumnVector &b)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
805 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
806 return elem_pow (FixedComplexColumnVector(1, a), b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
807 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
808
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
809 std::ostream&
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
810 operator << (std::ostream& os, const FixedComplexColumnVector& a)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
811 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
812 for (int i = 0; i < a.length (); i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
813 os << a.elem (i) << "\n";
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
814 return os;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
815 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
816
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
817 std::istream&
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
818 operator >> (std::istream& is, FixedComplexColumnVector& a)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
819 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
820 int len = a.length();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
821
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
822 if (len < 1)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
823 is.clear (std::ios::badbit);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
824 else
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
825 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
826 FixedPointComplex tmp;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
827 for (int i = 0; i < len; i++)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
828 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
829 is >> tmp;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
830 if (is)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
831 a.elem (i) = tmp;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
832 else
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
833 break;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
834 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
835 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
836 return is;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
837 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
838
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
839 /*
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
840 ;;; Local Variables: ***
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
841 ;;; mode: C++ ***
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
842 ;;; End: ***
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
843 */