From: <ad...@us...> - 2008-11-13 11:02:42
|
Revision: 5429 http://octave.svn.sourceforge.net/octave/?rev=5429&view=rev Author: adb014 Date: 2008-11-13 11:02:37 +0000 (Thu, 13 Nov 2008) Log Message: ----------- Update to allow building with 3.1.51+ Modified Paths: -------------- trunk/octave-forge/main/comm/src/galois.cc trunk/octave-forge/main/comm/src/galois.h trunk/octave-forge/main/comm/src/gf.cc Modified: trunk/octave-forge/main/comm/src/galois.cc =================================================================== --- trunk/octave-forge/main/comm/src/galois.cc 2008-11-12 11:28:21 UTC (rev 5428) +++ trunk/octave-forge/main/comm/src/galois.cc 2008-11-13 11:02:37 UTC (rev 5429) @@ -32,6 +32,23 @@ // galois class +galois::galois (const Array<int>& a, const int& _m, const int& _primpoly) : MArray2<int> (a.rows(), a.cols()), field (NULL) { + int _n = (1<<_m) - 1; + + // Check the validity of the data in the matrix + for (int i=0; i<rows(); i++) { + for (int j=0; j<columns(); j++) { + if ((a(i,j) < 0) || (a(i,j) > _n)) { + gripe_range_galois(_m); + return; + } + xelem(i,j) = (int)a(i,j); + } + } + + field = stored_galois_fields.create_galois_field(_m, _primpoly); +} + galois::galois (const MArray2<int>& a, const int& _m, const int& _primpoly) : MArray2<int> (a.rows(), a.cols()), field (NULL) { int _n = (1<<_m) - 1; Modified: trunk/octave-forge/main/comm/src/galois.h =================================================================== --- trunk/octave-forge/main/comm/src/galois.h 2008-11-12 11:28:21 UTC (rev 5428) +++ trunk/octave-forge/main/comm/src/galois.h 2008-11-13 11:02:37 UTC (rev 5429) @@ -60,6 +60,7 @@ { public: galois (void) : field (NULL) { } + galois (const Array<int>& a, const int& m=1, const int& primpoly=0); galois (const MArray2<int>& a, const int& m=1, const int& primpoly=0); galois (const Matrix& a, const int& m=1, const int& primpoly=0); galois (int nr, int nc, const int& val=0, const int& _m=1, const int& _primpoly=0); Modified: trunk/octave-forge/main/comm/src/gf.cc =================================================================== --- trunk/octave-forge/main/comm/src/gf.cc 2008-11-12 11:28:21 UTC (rev 5428) +++ trunk/octave-forge/main/comm/src/gf.cc 2008-11-13 11:02:37 UTC (rev 5429) @@ -128,11 +128,7 @@ install_s_gm_ops (); install_gm_s_ops (); galois_type_loaded = true; - // Lock constructor function in place, otherwise - // "a=gf(1); clear functions; a" generates a seg-fault!! - // The below is the function "mlock", but in a way useable - // for older versions of octave as well. - fbi_sym_tab->lookup("gf")->mark_as_static (); + mlock (); } retval = new octave_galois(data, m, primpoly); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |