annotate src/of-communications-2-fixes.patch @ 4733:1ecb1e67eaa1

* src/src-msys-dos2unix.mk: update checksum
author John Donoghue <john.donoghue@ieee.org>
date Sat, 09 Jun 2018 10:13:46 -0400
parents f7fce04ebafa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4199
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 diff --git a/src/base-lu.cc b/src/base-lu.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 new file mode 100644
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 --- /dev/null
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 +++ b/src/base-lu.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 @@ -0,0 +1,191 @@
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 +/*
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 +Copyright (C) 1996-2015 John W. Eaton
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 +Copyright (C) 2009 VZLU Prague
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 +This file is part of Octave.
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 +Octave is free software; you can redistribute it and/or modify it
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 +under the terms of the GNU General Public License as published by the
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 +Free Software Foundation; either version 3 of the License, or (at your
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 +option) any later version.
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 +Octave is distributed in the hope that it will be useful, but WITHOUT
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 +for more details.
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23 +You should have received a copy of the GNU General Public License
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 +along with Octave; see the file COPYING. If not, see
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 +<http://www.gnu.org/licenses/>.
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 +*/
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 +#ifdef HAVE_CONFIG_H
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 +#include <config.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 +#endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 +#include "base-lu.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 +base_lu<lu_type>::base_lu (const lu_type& l, const lu_type& u,
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 + const PermMatrix& p)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 + : a_fact (u), l_fact (l), ipvt (p.transpose ().col_perm_vec ())
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 + if (l.columns () != u.rows ())
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 + (*current_liboctave_error_handler) ("lu: dimension mismatch");
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 +}
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 +bool
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 +base_lu <lu_type> :: packed (void) const
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 + return l_fact.dims () == dim_vector ();
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 +}
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 +void
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 +base_lu <lu_type> :: unpack (void)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 + if (packed ())
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 + l_fact = L ();
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 + a_fact = U (); // FIXME: sub-optimal
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 + ipvt = getp ();
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 +}
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 +lu_type
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 +base_lu <lu_type> :: L (void) const
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 + if (packed ())
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 + octave_idx_type a_nr = a_fact.rows ();
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 + octave_idx_type a_nc = a_fact.cols ();
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 + octave_idx_type mn = (a_nr < a_nc ? a_nr : a_nc);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 + lu_type l (a_nr, mn, lu_elt_type (0.0));
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 + for (octave_idx_type i = 0; i < a_nr; i++)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77 + if (i < a_nc)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 + l.xelem (i, i) = 1.0;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 + for (octave_idx_type j = 0; j < (i < a_nc ? i : a_nc); j++)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 + l.xelem (i, j) = a_fact.xelem (i, j);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 + return l;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 + else
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87 + return l_fact;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 +}
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 +lu_type
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 +base_lu <lu_type> :: U (void) const
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94 + if (packed ())
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 + octave_idx_type a_nr = a_fact.rows ();
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 + octave_idx_type a_nc = a_fact.cols ();
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98 + octave_idx_type mn = (a_nr < a_nc ? a_nr : a_nc);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
100 + lu_type u (mn, a_nc, lu_elt_type (0.0));
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
102 + for (octave_idx_type i = 0; i < mn; i++)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104 + for (octave_idx_type j = i; j < a_nc; j++)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 + u.xelem (i, j) = a_fact.xelem (i, j);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 + return u;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110 + else
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 + return a_fact;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112 +}
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 +lu_type
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 +base_lu <lu_type> :: Y (void) const
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 + if (! packed ())
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 + (*current_liboctave_error_handler)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120 + ("lu: Y () not implemented for unpacked form");
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121 + return a_fact;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
122 +}
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
123 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
124 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
125 +Array<octave_idx_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
126 +base_lu <lu_type> :: getp (void) const
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
127 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
128 + if (packed ())
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
129 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
130 + octave_idx_type a_nr = a_fact.rows ();
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
131 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
132 + Array<octave_idx_type> pvt (dim_vector (a_nr, 1));
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
133 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
134 + for (octave_idx_type i = 0; i < a_nr; i++)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
135 + pvt.xelem (i) = i;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
136 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
137 + for (octave_idx_type i = 0; i < ipvt.length (); i++)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
138 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
139 + octave_idx_type k = ipvt.xelem (i);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
140 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
141 + if (k != i)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
142 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
143 + octave_idx_type tmp = pvt.xelem (k);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
144 + pvt.xelem (k) = pvt.xelem (i);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
145 + pvt.xelem (i) = tmp;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
146 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
147 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
148 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
149 + return pvt;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
150 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
151 + else
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
152 + return ipvt;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
153 +}
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
154 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
155 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
156 +PermMatrix
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
157 +base_lu <lu_type> :: P (void) const
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
158 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
159 + return PermMatrix (getp (), false);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
160 +}
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
161 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
162 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
163 +ColumnVector
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
164 +base_lu <lu_type> :: P_vec (void) const
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
165 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
166 + octave_idx_type a_nr = a_fact.rows ();
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
167 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
168 + ColumnVector p (a_nr);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
169 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
170 + Array<octave_idx_type> pvt = getp ();
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
171 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
172 + for (octave_idx_type i = 0; i < a_nr; i++)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
173 + p.xelem (i) = static_cast<double> (pvt.xelem (i) + 1);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
174 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
175 + return p;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
176 +}
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
177 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
178 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
179 +bool
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
180 +base_lu<lu_type>::regular (void) const
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
181 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
182 + bool retval = true;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
183 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
184 + octave_idx_type k = std::min (a_fact.rows (), a_fact.columns ());
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
185 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
186 + for (octave_idx_type i = 0; i < k; i++)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
187 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
188 + if (a_fact(i, i) == lu_elt_type ())
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
189 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
190 + retval = false;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
191 + break;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
192 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
193 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
194 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
195 + return retval;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
196 +}
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
197 diff --git a/src/base-lu.h b/src/base-lu.h
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
198 new file mode 100644
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
199 --- /dev/null
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
200 +++ b/src/base-lu.h
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
201 @@ -0,0 +1,87 @@
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
202 +/*
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
203 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
204 +Copyright (C) 1996-2015 John W. Eaton
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
205 +Copyright (C) 2009 VZLU Prague
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
206 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
207 +This file is part of Octave.
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
208 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
209 +Octave is free software; you can redistribute it and/or modify it
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
210 +under the terms of the GNU General Public License as published by the
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
211 +Free Software Foundation; either version 3 of the License, or (at your
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
212 +option) any later version.
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
213 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
214 +Octave is distributed in the hope that it will be useful, but WITHOUT
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
215 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
216 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
217 +for more details.
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
218 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
219 +You should have received a copy of the GNU General Public License
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
220 +along with Octave; see the file COPYING. If not, see
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
221 +<http://www.gnu.org/licenses/>.
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
222 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
223 +*/
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
224 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
225 +#if !defined (octave_base_lu_h)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
226 +#define octave_base_lu_h 1
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
227 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
228 +#include "MArray.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
229 +#include "dColVector.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
230 +#include "PermMatrix.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
231 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
232 +template <class lu_type>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
233 +class
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
234 +base_lu
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
235 +{
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
236 +public:
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
237 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
238 + typedef typename lu_type::element_type lu_elt_type;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
239 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
240 + base_lu (void)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
241 + : a_fact (), l_fact (), ipvt () { }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
242 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
243 + base_lu (const base_lu& a)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
244 + : a_fact (a.a_fact), l_fact (a.l_fact), ipvt (a.ipvt) { }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
245 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
246 + base_lu (const lu_type& l, const lu_type& u,
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
247 + const PermMatrix& p);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
248 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
249 + base_lu& operator = (const base_lu& a)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
250 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
251 + if (this != &a)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
252 + {
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
253 + a_fact = a.a_fact;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
254 + l_fact = a.l_fact;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
255 + ipvt = a.ipvt;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
256 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
257 + return *this;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
258 + }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
259 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
260 + virtual ~base_lu (void) { }
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
261 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
262 + bool packed (void) const;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
263 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
264 + void unpack (void);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
265 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
266 + lu_type L (void) const;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
267 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
268 + lu_type U (void) const;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
269 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
270 + lu_type Y (void) const;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
271 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
272 + PermMatrix P (void) const;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
273 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
274 + ColumnVector P_vec (void) const;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
275 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
276 + bool regular (void) const;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
277 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
278 +protected:
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
279 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
280 + Array<octave_idx_type> getp (void) const;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
281 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
282 + lu_type a_fact;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
283 + lu_type l_fact;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
284 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
285 + Array<octave_idx_type> ipvt;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
286 +};
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
287 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
288 +#endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
289 diff --git a/src/galois-ops.h b/src/galois-ops.h
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
290 --- a/src/galois-ops.h
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
291 +++ b/src/galois-ops.h
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
292 @@ -21,6 +21,32 @@
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
293 #if !defined (galois_octave_ops_h)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
294 #define galois_octave_ops_h 1
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
295
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
296 +#if ! defined (CAST_BINOP_ARGS)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
297 +# define CAST_BINOP_ARGS(t1, t2) \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
298 + t1 v1 = dynamic_cast<t1> (a1); \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
299 + t2 v2 = dynamic_cast<t2> (a2)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
300 +#endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
301 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
302 +#if ! defined (CAST_UNOP_ARG)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
303 +# define CAST_UNOP_ARG(t) \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
304 + t v = dynamic_cast<t> (a)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
305 +#endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
306 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
307 +#if ! defined (BINOPDECL)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
308 +# define BINOPDECL(name, a1, a2) \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
309 + static octave_value \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
310 + CONCAT2(oct_binop_, name) (const octave_base_value& a1, \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
311 + const octave_base_value& a2)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
312 +#endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
313 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
314 +#if ! defined (CATOPDECL)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
315 +# define CATOPDECL(name, a1, a2) \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
316 + static octave_value \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
317 + CONCAT2(oct_catop_, name) (octave_base_value& a1, \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
318 + const octave_base_value& a2, \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
319 + const Array<octave_idx_type>& ra_idx)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
320 +#endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
321 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
322 // Override the operator and function definition defines from Octave
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
323
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
324 #define DEFBINOP_OP_G(name, t1, t2, op) \
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
325 diff --git a/src/galois.cc b/src/galois.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
326 --- a/src/galois.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
327 +++ b/src/galois.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
328 @@ -27,7 +27,7 @@
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
329 #include "galoisfield.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
330 #include "galois-def.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
331
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
332 -#include <octave/base-lu.cc>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
333 +#include "base-lu.cc"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
334
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
335 galois_field_list stored_galois_fields;
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
336
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
337 diff --git a/src/galois.h b/src/galois.h
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
338 --- a/src/galois.h
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
339 +++ b/src/galois.h
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
340 @@ -22,10 +22,10 @@
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
341 #define octave_galois_int_h 1
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
342
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
343 #include <octave/config.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
344 -#include <octave/base-lu.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
345 #include <octave/mx-base.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
346
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
347 #include "galoisfield.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
348 +#include "base-lu.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
349
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
350 typedef void (*solve_singularity_handler) (double rcond);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
351
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
352 diff --git a/src/ov-galois.cc b/src/ov-galois.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
353 --- a/src/ov-galois.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
354 +++ b/src/ov-galois.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
355 @@ -24,7 +24,6 @@
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
356 #include <octave/byte-swap.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
357 #include <octave/gripes.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
358 #include <octave/lo-ieee.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
359 -#include <octave/oct-hdf5.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
360 #include <octave/oct-locbuf.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
361 #include <octave/oct-obj.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
362 #include <octave/ov.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
363 @@ -35,6 +34,22 @@
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
364 #include "galois.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
365 #include "ov-galois.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
366
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
367 +#if defined (HAVE_HDF5)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
368 +# if defined (HAVE_HDF5_H)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
369 +# include <hdf5.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
370 +# endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
371 +# include "oct-hdf5-types.h"
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
372 +# if defined (OCTAVE_ENABLE_64)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
373 +# define H5T_NATIVE_IDX H5T_NATIVE_INT64
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
374 +# else
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
375 +# define H5T_NATIVE_IDX H5T_NATIVE_INT
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
376 +# endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
377 +#endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
378 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
379 +#if ! defined (X_CAST)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
380 +# define X_CAST(T, E) (T) (E)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
381 +#endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
382 +
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
383 #if defined (DEFINE_OCTAVE_ALLOCATOR)
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
384 DEFINE_OCTAVE_ALLOCATOR (octave_galois);
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
385 #endif
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
386 diff --git a/src/syndtable.cc b/src/syndtable.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
387 --- a/src/syndtable.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
388 +++ b/src/syndtable.cc
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
389 @@ -20,8 +20,8 @@
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
390
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
391 #include <octave/oct.h>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
392
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
393 -#define COL_MAJ(N) (N / (SIZEOF_INT << 3))
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
394 -#define COL_MIN(N) (N % (SIZEOF_INT << 3))
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
395 +#define COL_MAJ(N) (N / (sizeof (int) << 3))
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
396 +#define COL_MIN(N) (N % (sizeof (int) << 3))
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
397
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
398 Array<int>
f7fce04ebafa temporary fixes for of-communications package
John W. Eaton <jwe@octave.org>
parents:
diff changeset
399 get_errs (const int& nmin, const int& nmax, const int &nerrs)