p***@gmail.com
2007-08-11 04:25:09 UTC
hi all,
i am kind of new to software patching. i was looking for a
fix for the "load .oct file" problem in octave 2.9.12 and stumbled
across the below patch. figured out that i had to do a diff -u -u "old
file" "new file" but can somebody guide me through the process.
thanks for the help in advance.
maverick.
================================================
RCS file: /cvs/octave/src/ov-bool-mat.cc,v
retrieving revision 1.44
diff -u -u -r1.44 ov-bool-mat.cc
--- src/ov-bool-mat.cc 3 Jun 2007 20:58:29 -0000 1.44
+++ src/ov-bool-mat.cc 13 Jun 2007 16:10:42 -0000
<at> <at> -204,24 +204,40 <at> <at>
for (int i = 0; i < mdims; i++)
is >> dv(i);
- NDArray tmp(dv);
- is >> tmp;
+ if (is)
+ {
+ boolNDArray btmp (dv);
+
+ if (btmp.is_empty ())
+ matrix = btmp;
+ else
+ {
+ NDArray tmp(dv);
+ is >> tmp;
- if (!is)
+ if (is)
+ {
+ for (octave_idx_type i = 0; i < btmp.nelem (); i++)
+ btmp.elem (i) = (tmp.elem (i) != 0.);
+
+ matrix = btmp;
+ }
+ else
+ {
+ error ("load: failed to load matrix constant");
+ success = false;
+ }
+ }
+ }
+ else
{
- error ("load: failed to load matrix constant");
+ error ("load: failed to extract dimensions");
success = false;
}
-
i am kind of new to software patching. i was looking for a
fix for the "load .oct file" problem in octave 2.9.12 and stumbled
across the below patch. figured out that i had to do a diff -u -u "old
file" "new file" but can somebody guide me through the process.
thanks for the help in advance.
maverick.
================================================
RCS file: /cvs/octave/src/ov-bool-mat.cc,v
retrieving revision 1.44
diff -u -u -r1.44 ov-bool-mat.cc
--- src/ov-bool-mat.cc 3 Jun 2007 20:58:29 -0000 1.44
+++ src/ov-bool-mat.cc 13 Jun 2007 16:10:42 -0000
<at> <at> -204,24 +204,40 <at> <at>
for (int i = 0; i < mdims; i++)
is >> dv(i);
- NDArray tmp(dv);
- is >> tmp;
+ if (is)
+ {
+ boolNDArray btmp (dv);
+
+ if (btmp.is_empty ())
+ matrix = btmp;
+ else
+ {
+ NDArray tmp(dv);
+ is >> tmp;
- if (!is)
+ if (is)
+ {
+ for (octave_idx_type i = 0; i < btmp.nelem (); i++)
+ btmp.elem (i) = (tmp.elem (i) != 0.);
+
+ matrix = btmp;
+ }
+ else
+ {
+ error ("load: failed to load matrix constant");
+ success = false;
+ }
+ }
+ }
+ else
{
- error ("load: failed to load matrix constant");
+ error ("load: failed to extract dimensions");
success = false;
}
-