[octave-communications] fix name clash for class LU with octave 3.6.0

sailer sailer at fedoraproject.org
Wed Jan 18 10:55:27 UTC 2012


commit 895675e2d7c8c9c7a3452db65bdbff5354929709
Author: Thomas Sailer <t.sailer at alumni.ethz.ch>
Date:   Wed Jan 18 11:54:30 2012 +0100

    fix name clash for class LU with octave 3.6.0

 octave-communications.spec   |    4 ++
 octave-rename-galoislu.patch |  115 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 119 insertions(+), 0 deletions(-)
---
diff --git a/octave-communications.spec b/octave-communications.spec
index eea614b..d86c96f 100644
--- a/octave-communications.spec
+++ b/octave-communications.spec
@@ -13,6 +13,9 @@ Source1:        mkdoc
 Source2:        mktexi
 # make build more verbose; local fedora change, not upstreamed
 Patch0:         octave-communications-verbose.patch
+# class LU clashes with class LU now part of octave
+# sent to octave-dev at lists.sourceforge.net
+Patch1:         octave-rename-galoislu.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  octave-devel
@@ -39,6 +42,7 @@ functions, Modulation and Galois Fields
 cp -p %{SOURCE1} %{SOURCE2} .
 chmod a+x mkdoc mktexi
 %patch0 -p0 -b .verbose
+%patch1 -p0 -b .lu
 
 %build
 # octave_pkg_build results in the following errors:
diff --git a/octave-rename-galoislu.patch b/octave-rename-galoislu.patch
new file mode 100644
index 0000000..99a597b
--- /dev/null
+++ b/octave-rename-galoislu.patch
@@ -0,0 +1,115 @@
+--- src/galois.h.orig	2012-01-18 10:31:41.409049497 +0100
++++ src/galois.h	2012-01-18 10:32:12.067052961 +0100
+@@ -131,7 +131,7 @@
+ };
+ 
+ class
+-LU : public base_lu <galois>
++galoisLU : public base_lu <galois>
+ {
+   friend class galois;
+ public:
+@@ -141,15 +141,15 @@
+     COL
+   };
+ 
+-  LU (void) : base_lu <galois> () { }
++  galoisLU (void) : base_lu <galois> () { }
+ 
+-  LU (const galois& a, const pivot_type& typ) { factor (a, typ); }
++  galoisLU (const galois& a, const pivot_type& typ) { factor (a, typ); }
+ 
+-  LU (const galois& a) { factor (a, LU::ROW); }
++  galoisLU (const galois& a) { factor (a, galoisLU::ROW); }
+ 
+-  LU (const LU& a) : base_lu <galois> (a) { }
++  galoisLU (const galoisLU& a) : base_lu <galois> (a) { }
+ 
+-  LU& operator = (const LU& a)
++  galoisLU& operator = (const galoisLU& a)
+     {
+       if (this != &a)
+ 	base_lu <galois> :: operator = (a);
+@@ -157,7 +157,7 @@
+       return *this;
+     }
+ 
+-  ~LU (void) { }
++  ~galoisLU (void) { }
+ 
+   galois L (void) const;
+ 
+--- src/galois.cc.orig	2012-01-18 10:31:47.918050234 +0100
++++ src/galois.cc	2012-01-18 10:32:27.380054691 +0100
+@@ -882,7 +882,7 @@
+ template class base_lu <galois>;
+ 
+ void
+-LU::factor (const galois& a, const pivot_type& typ)
++galoisLU::factor (const galois& a, const pivot_type& typ)
+ {
+   int a_nr = a.rows ();
+   int a_nc = a.cols ();
+@@ -898,7 +898,7 @@
+     int jp = j;
+ 
+     // Find the pivot and test for singularity
+-    if (ptype == LU::ROW) { 
++    if (ptype == galoisLU::ROW) { 
+       for (int i = j+1; i < a_nr; i++)
+ 	if (a_fact(i,j) > a_fact(jp,j))
+ 	  jp = i;
+@@ -911,7 +911,7 @@
+     ipvt(j) = jp;
+ 
+     if (a_fact(jp,j) != 0) {
+-      if (ptype == LU::ROW) { 
++      if (ptype == galoisLU::ROW) { 
+ 	// Apply the interchange to columns 1:NC.
+ 	if (jp != j)
+ 	  for (int i = 0; i < a_nc; i++) {
+@@ -962,7 +962,7 @@
+ }
+ 
+ galois
+-LU::L (void) const
++galoisLU::L (void) const
+ {
+   int a_nr = a_fact.rows ();
+   int a_nc = a_fact.cols ();
+@@ -981,7 +981,7 @@
+ }
+ 
+ galois
+-LU::U (void) const
++galoisLU::U (void) const
+ {
+   int a_nr = a_fact.rows ();
+   int a_nc = a_fact.cols ();
+@@ -1049,7 +1049,7 @@
+     info = 0;
+     retval(0,0) = 1;
+   } else {
+-    LU fact (*this);
++    galoisLU fact (*this);
+ 
+     if ( ! fact.singular()) {
+       galois A (fact.a_fact);
+@@ -1110,7 +1110,7 @@
+     return galois();
+   } else if (nc > nr) {
+     // Under-determined system, use column interchanges.
+-    LU fact ((*this), LU::COL);
++    galoisLU fact ((*this), galoisLU::COL);
+ 
+     if (fact.singular()) {
+       info = -1;
+@@ -1173,7 +1173,7 @@
+     }
+     
+   } else {
+-    LU fact (*this);
++    galoisLU fact (*this);
+ 
+     if (fact.singular()) {
+       info = -1;


More information about the scm-commits mailing list