[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to compile communications-1.0.9 with octave 3.1.53?
From: |
David Bateman |
Subject: |
Re: How to compile communications-1.0.9 with octave 3.1.53? |
Date: |
Fri, 15 May 2009 00:04:43 +0200 |
User-agent: |
Mozilla-Thunderbird 2.0.0.19 (X11/20090103) |
子鳴 wrote:
Hi, can someone tell me how to deal with the follow error? Thanks!
Compiling galois.o
g++ -c -I/mnt/septem/math/include/ -fPIC
-I/mnt/septem/math/include/octave-3.1.55
-I/mnt/septem/math/include/octave-3.1.55/octave -I/mnt/septem/math/include
-I/usr/include/freetype2 -D H5_USE_16_API -Wall -O2 -g -mtune=athlon64 -m64
-fPIC -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-all
--param=ssp-buffer-size=4 -DHAVE_OCTAVE_31 -DGALOIS_DISP_PRIVATES galois.cc
-o galois.o
In file included from galois.cc:27:
galois.h:134: error: wrong number of template arguments (4, should be 1)
/mnt/septem/math/include/octave-3.1.55/octave/base-lu.h:32: error: provided
for ‘template<class lu_type> class base_lu’
galois.h: In constructor ‘LU::LU()’:
galois.h:144: error: wrong number of template arguments (4, should be 1)
/mnt/septem/math/include/octave-3.1.55/octave/base-lu.h:32: error: provided
for ‘template<class lu_type> class base_lu’
galois.h: In copy constructor ‘LU::LU(const LU&)’:
galois.h:150: error: wrong number of template arguments (4, should be 1)
/mnt/septem/math/include/octave-3.1.55/octave/base-lu.h:32: error: provided
for ‘template<class lu_type> class base_lu’
galois.h: In member function ‘LU& LU::operator=(const LU&)’:
galois.h:155: error: wrong number of template arguments (4, should be 1)
/mnt/septem/math/include/octave-3.1.55/octave/base-lu.h:32: error: provided
for ‘template<class lu_type> class base_lu’
galois.cc: In member function ‘boolMatrix galois::all(int) const’:
galois.cc:712: error: ‘MX_ALL_OP’ was not declared in this scope
galois.cc: In member function ‘boolMatrix galois::any(int) const’:
galois.cc:718: error: ‘MX_ANY_OP’ was not declared in this scope
galois.cc: At global scope:
galois.cc:880: error: wrong number of template arguments (4, should be 1)
/mnt/septem/math/include/octave-3.1.55/octave/base-lu.h:32: error: provided
for ‘template<class lu_type> class base_lu’
galois.cc: In member function ‘void LU::factor(const galois&, const
LU::pivot_type&)’:
galois.cc:891: error: ‘ipvt’ was not declared in this scope
galois.cc:893: error: ‘a_fact’ was not declared in this scope
galois.cc: In member function ‘galois LU::L() const’:
galois.cc:965: error: ‘a_fact’ was not declared in this scope
galois.cc: In member function ‘galois LU::U() const’:
galois.cc:984: error: ‘a_fact’ was not declared in this scope
galois.cc: In member function ‘Matrix LU::P() const’:
galois.cc:999: error: ‘a_fact’ was not declared in this scope
galois.cc:1008: error: ‘ipvt’ was not declared in this scope
galois.cc: In member function ‘Array<int> LU::IP() const’:
galois.cc:1031: error: ‘ipvt’ was not declared in this scope
galois.cc: In member function ‘galois LU::A() const’:
galois.cc:1037: error: ‘a_fact’ was not declared in this scope
The LU class was refactored in 3.1.x and this is an effect.. Ok, I've
converted the galois field code in the codes package to be compatible
with the 3.1.x way of doing things and committed the code to the
repository. The patch against the repository is attached..
D.
--
David Bateman address@hidden
35 rue Gambetta +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)
Index: DESCRIPTION
===================================================================
--- DESCRIPTION (revision 5779)
+++ DESCRIPTION (working copy)
@@ -1,11 +1,11 @@
Name: Communications
-Version: 1.0.9
-Date: 2009-05-03
+Version: 1.0.10
+Date: 2009-05-14
Author: David Bateman
Maintainer: David Bateman
Title: Communications.
Description: Digital Communications, Error Correcting Codes (Channel Code),
Source Code functions, Modulation and Galois Fields
-Depends: octave (> 2.9.14), signal (>= 1.0.0)
+Depends: octave (> 3.1.54), signal (>= 1.0.0)
Autoload: yes
License: GPL version 2 or later
Url: http://octave.sf.net
Index: src/gf.cc
===================================================================
--- src/gf.cc (revision 5779)
+++ src/gf.cc (working copy)
@@ -872,7 +872,9 @@
case 1:
case 2:
{
- Matrix P = fact.P ();
+ // While we don't have sparse galois matrices converting the
+ // permutation matrix to a full matrix is the best we can do.
+ Matrix P = Matrix (fact.P ());
galois L = P.transpose () * fact.L ();
retval(1) = new octave_galois (fact.U ());
retval(0) = new octave_galois (L);
Index: src/ov-galois.cc
===================================================================
--- src/ov-galois.cc (revision 5779)
+++ src/ov-galois.cc (working copy)
@@ -369,12 +369,14 @@
case 2:
{
idx_vector i = idx (0).index_vector ();
- idx_vector j = idx (1).index_vector ();
- gval.set_index (i);
- gval.set_index (j);
+ if (! error_state)
+ {
+ idx_vector j = idx (1).index_vector ();
- ::assign (gval, rhs);
+ if (! error_state)
+ gval.assign (i, j, rhs);
+ }
}
break;
@@ -382,9 +384,8 @@
{
idx_vector i = idx (0).index_vector ();
- gval.set_index (i);
-
- ::assign (gval, rhs);
+ if (! error_state)
+ gval.assign (i, rhs);
}
break;
Index: src/galois.cc
===================================================================
--- src/galois.cc (revision 5779)
+++ src/galois.cc (working copy)
@@ -28,6 +28,8 @@
#include "galoisfield.h"
#include "galois-def.h"
+#include <octave/base-lu.cc>
+
galois_field_list stored_galois_fields;
// galois class
@@ -709,13 +711,13 @@
boolMatrix
galois::all (int dim) const
{
- MX_ALL_OP (dim);
+ return do_mx_red_op<boolMatrix> (*this, dim, mx_inline_all);
}
boolMatrix
galois::any (int dim) const
{
- MX_ANY_OP (dim);
+ return do_mx_red_op<boolMatrix> (*this, dim, mx_inline_any);
}
galois
@@ -877,7 +879,7 @@
return retval;
}
-template class base_lu <galois, int, Matrix, double>;
+template class base_lu <galois>;
void
LU::factor (const galois& a, const pivot_type& typ)
@@ -993,51 +995,7 @@
return u;
}
-Matrix
-LU::P (void) const
-{
- int a_nr = a_fact.rows ();
- int a_nc = a_fact.cols ();
- int n = (ptype == LU::ROW ? a_nr : a_nc);
-
- Array<int> pvt (n);
-
- for (int i = 0; i < n; i++)
- pvt (i) = i;
-
- for (int i = 0; i < ipvt.length(); i++)
- {
- int k = ipvt (i);
-
- if (k != i)
- {
- int tmp = pvt (k);
- pvt (k) = pvt (i);
- pvt (i) = tmp;
- }
- }
-
- Matrix p(n, n, 0.0);
-
- for (int i = 0; i < n; i++)
- p (i, pvt (i)) = 1.0;
-
- return p;
-}
-
-Array<int>
-LU::IP (void) const
-{
- return Array<int> (ipvt);
-}
-
galois
-LU::A (void) const
-{
- return galois (a_fact);
-}
-
-galois
galois::inverse (void) const
{
int info;
@@ -1094,7 +1052,7 @@
LU fact (*this);
if ( ! fact.singular()) {
- galois A (fact.A());
+ galois A (fact.a_fact);
info = 0;
retval(0,0) = A(0,0);
@@ -1163,8 +1121,8 @@
return galois();
} else {
- galois A (fact.A());
- Array<int> IP (fact.IP());
+ galois A (fact.a_fact);
+ Array<int> IP (fact.ipvt);
// Resize the number of solution rows if needed
if (nc > nr)
@@ -1226,8 +1184,8 @@
return galois();
} else {
- galois A (fact.A());
- Array<int> IP (fact.IP());
+ galois A (fact.a_fact);
+ Array<int> IP (fact.ipvt);
// Apply row interchanges to the right hand sides.
for (int j=0; j<IP.length(); j++) {
Index: src/galois.h
===================================================================
--- src/galois.h (revision 5779)
+++ src/galois.h (working copy)
@@ -131,7 +131,7 @@
};
class
-LU : public base_lu <galois, int, Matrix, double>
+LU : public base_lu <galois>
{
friend class galois;
public:
@@ -141,18 +141,18 @@
COL
};
- LU (void) : base_lu <galois, int, Matrix, double> () { }
+ LU (void) : base_lu <galois> () { }
LU (const galois& a, const pivot_type& typ) { factor (a, typ); }
LU (const galois& a) { factor (a, LU::ROW); }
- LU (const LU& a) : base_lu <galois, int, Matrix, double> (a) { }
+ LU (const LU& a) : base_lu <galois> (a) { }
LU& operator = (const LU& a)
{
if (this != &a)
- base_lu <galois, int, Matrix, double> :: operator = (a);
+ base_lu <galois> :: operator = (a);
return *this;
}
@@ -163,18 +163,12 @@
galois U (void) const;
- Matrix P (void) const;
+ bool singular (void) const { return info != 0; }
- bool singular (void) const { return info != 0; }
-
pivot_type type (void) const { return ptype; }
private:
void factor (const galois& a, const pivot_type& typ);
- Array<int> IP (void) const;
-
- galois A (void) const;
-
int info;
pivot_type ptype;