changeset 12759:34cd2fcfdcb8

periodic merge of stable to default
author John W. Eaton <jwe@octave.org>
date Mon, 20 Jun 2011 11:12:39 -0400
parents c8f451df37a7 (current diff) ecd1364a2700 (diff)
children f511bfe00d14
files src/Makefile.am
diffstat 8 files changed, 148 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Sat Jun 18 07:37:20 2011 -0700
+++ b/Makefile.am	Mon Jun 20 11:12:39 2011 -0400
@@ -85,7 +85,7 @@
   BUGS \
   INSTALL.OCTAVE
 
-CLEANFILES = $(bin_PROGRAMS) $(bin_SCRIPTS) $(BUILT_SOURCES)
+CLEANFILES = $(BUILT_SOURCES)
 
 DISTCLEANFILES = .gdbinit 
 
@@ -95,7 +95,7 @@
 
 nodist_octinclude_HEADERS = config.h
 
-all-local: $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_SCRIPTS) $(INFO_FILES) .gdbinit
+all-local: $(noinst_SCRIPTS) $(INFO_FILES) .gdbinit
 	@echo ""
 	@echo "Octave successfully built.  Now choose from the following:"
 	@echo ""
@@ -145,36 +145,3 @@
 	$(MKDIR_P) $(addprefix $(DESTDIR), $(DIRS_TO_MAKE))
 
 install-data-local: installdirs-local
-
-install-exec-hook: make-version-links
-
-uninstall-local: remove-version-links
-
-if AMCOND_BUILD_COMPILED_AUX_PROGRAMS
-make-version-links:
-	cd $(DESTDIR)$(bindir) && \
-	for f in $(basename $(bin_PROGRAMS)); do \
-	  mv $$f$(EXEEXT) $$f-$(version)$(EXEEXT) && \
-	    $(LN_S) $$f-$(version)$(EXEEXT) $$f$(EXEEXT); \
-	done
-
-remove-version-links:
-	for f in $(basename $(bin_PROGRAMS)); do \
-	  rm -f $(DESTDIR)$(bindir)/$$f-$(version)$(EXEEXT); \
-	done
-else
-make-version-links:
-	cd $(DESTDIR)$(bindir) && \
-	for f in $(basename $(bin_SCRIPTS)); do \
-	  mv $$f $$f-$(version) && \
-	    $(LN_S) $$f-$(version) $$f; \
-	done
-
-remove-version-links:
-	for f in $(basename $(bin_SCRIPTS)); do \
-	  rm -f $(DESTDIR)$(bindir)/$$f-$(version); \
-	done
-endif
-
-.PHONY: make-version-links remove-version-links
-
--- a/scripts/miscellaneous/mkoctfile.m	Sat Jun 18 07:37:20 2011 -0700
+++ b/scripts/miscellaneous/mkoctfile.m	Mon Jun 20 11:12:39 2011 -0400
@@ -51,13 +51,12 @@
 ## Add the run-time path to the link command.
 ##
 ## @item -Wl,@dots{}
-## Pass flags through the linker e.g. "-Wl,-rpath=@dots{}".
+## Pass flags though the linker like "-Wl,-rpath=@dots{}".
 ## The quotes are needed since commas are interpreted as command
 ## separators.
 ##
-## @item -W,@dots{}
-## Pass flags through the compiler, e.g. "-W,-O2". The quotes are needed
-## since commas are interpreted as command separators.
+## @item -W@dots{}
+## Pass flags though the compiler like "-Wa,OPTION".
 ##
 ## @item -c
 ## Compile but do not link.
--- a/scripts/statistics/distributions/cauchy_cdf.m	Sat Jun 18 07:37:20 2011 -0700
+++ b/scripts/statistics/distributions/cauchy_cdf.m	Mon Jun 20 11:12:39 2011 -0400
@@ -48,8 +48,8 @@
   sz = size (x);
   cdf = NaN (sz);
 
-  k = find ((location > -Inf) & (location < Inf)
-            & (scale > 0) & (scale < Inf));
+  k = find (ones (sz) & (location > -Inf) & (location < Inf)
+                      & (scale > 0) & (scale < Inf));
   if (any (k))
     if (isscalar (location) && isscalar (scale))
       cdf(k) = 0.5 + atan ((x(k) - location) ./ scale) / pi;
--- a/src/Makefile.am	Sat Jun 18 07:37:20 2011 -0700
+++ b/src/Makefile.am	Mon Jun 20 11:12:39 2011 -0400
@@ -844,13 +844,29 @@
 
 make-version-links:
 	cd $(DESTDIR)$(bindir) && \
-	mv octave$(EXEEXT) octave-$(version)$(EXEEXT) && \
-	$(LN_S) octave-$(version)$(EXEEXT) octave$(EXEEXT)
-.PHONY: make-version-links
+	for f in $(basename $(bin_PROGRAMS)); do \
+	  mv $$f$(EXEEXT) $$f-$(version)$(EXEEXT) && \
+	    $(LN_S) $$f-$(version)$(EXEEXT) $$f$(EXEEXT); \
+	done
+if ! AMCOND_BUILD_COMPILED_AUX_PROGRAMS
+	cd $(DESTDIR)$(bindir) && \
+	for f in $(basename $(bin_SCRIPTS)); do \
+	  mv $$f $$f-$(version) && \
+	    $(LN_S) $$f-$(version) $$f; \
+	done
+endif
 
 remove-version-links:
-	rm -f $(DESTDIR)$(bindir)/octave-$(version)$(EXEEXT)
-.PHONY: remove-version-links
+	for f in $(basename $(bin_PROGRAMS)); do \
+	  rm -f $(DESTDIR)$(bindir)/$$f-$(version)$(EXEEXT); \
+	done
+if ! AMCOND_BUILD_COMPILED_AUX_PROGRAMS
+	for f in $(basename $(bin_SCRIPTS)); do \
+	  rm -f $(DESTDIR)$(bindir)/$$f-$(version); \
+	done
+endif
+
+.PHONY: make-version-links remove-version-links
 
 if AMCOND_ENABLE_DYNAMIC_LINKING
 install-oct:
@@ -882,8 +898,8 @@
 endif
 .PHONY: install-oct uninstall-oct
 
-
 CLEANFILES = \
+  $(bin_SCRIPTS) \
   DLD-FUNCTIONS/PKG_ADD \
   doc-files \
   gendoc.cc \
@@ -900,4 +916,3 @@
 
 MAINTAINERCLEANFILES = \
   $(BUILT_DISTFILES)
-
--- a/src/OPERATORS/op-sbm-b.cc	Sat Jun 18 07:37:20 2011 -0700
+++ b/src/OPERATORS/op-sbm-b.cc	Mon Jun 20 11:12:39 2011 -0400
@@ -30,6 +30,14 @@
 #include "ov.h"
 #include "ov-typeinfo.h"
 #include "ov-bool.h"
+#include "ov-int8.h"
+#include "ov-int16.h"
+#include "ov-int32.h"
+#include "ov-int64.h"
+#include "ov-uint8.h"
+#include "ov-uint16.h"
+#include "ov-uint32.h"
+#include "ov-uint64.h"
 #include "ov-scalar.h"
 #include "ops.h"
 
@@ -77,6 +85,24 @@
   return octave_value ();
 }
 
+static octave_value
+oct_assignop_conv_and_assign (octave_base_value& a1,
+                              const octave_value_list& idx,
+                              const octave_base_value& a2)
+{
+  octave_sparse_bool_matrix& v1 = dynamic_cast<octave_sparse_bool_matrix&> (a1);
+
+  // FIXME -- perhaps add a warning for this conversion if the values
+  // are not all 0 or 1?
+
+  SparseBoolMatrix v2 (1, 1, a2.bool_value ());
+
+  if (! error_state)
+    v1.assign (idx, v2);
+
+  return octave_value ();
+}
+
 void
 install_sbm_b_ops (void)
 {
@@ -91,4 +117,25 @@
   INSTALL_CATOP (octave_sparse_matrix, octave_bool, sm_b);
 
   INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_bool, assign);
+
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_scalar,
+                    conv_and_assign);
+
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_int8_scalar,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_int16_scalar,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_int32_scalar,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_int64_scalar,
+                    conv_and_assign);
+
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint8_scalar,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint16_scalar,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint32_scalar,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint64_scalar,
+                    conv_and_assign);
 }
--- a/src/OPERATORS/op-sbm-bm.cc	Sat Jun 18 07:37:20 2011 -0700
+++ b/src/OPERATORS/op-sbm-bm.cc	Mon Jun 20 11:12:39 2011 -0400
@@ -31,9 +31,19 @@
 #include "ov-typeinfo.h"
 #include "ov-bool-mat.h"
 #include "boolMatrix.h"
+#include "ov-int8.h"
+#include "ov-int16.h"
+#include "ov-int32.h"
+#include "ov-int64.h"
+#include "ov-uint8.h"
+#include "ov-uint16.h"
+#include "ov-uint32.h"
+#include "ov-uint64.h"
+#include "ov-range.h"
 #include "ov-scalar.h"
+#include "ov-str-mat.h"
 #include "ops.h"
-
+#include "ov-null-mat.h"
 #include "ov-re-sparse.h"
 #include "ov-bool-sparse.h"
 #include "smx-bm-sbm.h"
@@ -79,6 +89,26 @@
   return octave_value ();
 }
 
+DEFNULLASSIGNOP_FN (null_assign, sparse_bool_matrix, delete_elements)
+
+static octave_value
+oct_assignop_conv_and_assign (octave_base_value& a1,
+                              const octave_value_list& idx,
+                              const octave_base_value& a2)
+{
+  octave_sparse_bool_matrix& v1 = dynamic_cast<octave_sparse_bool_matrix&> (a1);
+
+  // FIXME -- perhaps add a warning for this conversion if the values
+  // are not all 0 or 1?
+
+  SparseBoolMatrix v2 (a2.bool_array_value ());
+
+  if (! error_state)
+    v1.assign (idx, v2);
+
+  return octave_value ();
+}
+
 void
 install_sbm_bm_ops (void)
 {
@@ -96,4 +126,42 @@
 
   INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix,
                     octave_bool_matrix, assign);
+
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_matrix,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix,
+                    octave_char_matrix_str, conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix,
+                    octave_char_matrix_sq_str, conv_and_assign);
+
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_range,
+                    conv_and_assign);
+
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_sparse_matrix,
+                    conv_and_assign);
+
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_int8_matrix,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_int16_matrix,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_int32_matrix,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_int64_matrix,
+                    conv_and_assign);
+
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint8_matrix,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint16_matrix,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint32_matrix,
+                    conv_and_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint64_matrix,
+                    conv_and_assign);
+
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_null_matrix,
+                    null_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_null_str,
+                    null_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_null_sq_str,
+                    null_assign);
 }
--- a/src/mkoctfile.in	Sat Jun 18 07:37:20 2011 -0700
+++ b/src/mkoctfile.in	Mon Jun 20 11:12:39 2011 -0400
@@ -336,8 +336,8 @@
       incflags="$incflags -I."
       output_ext=".mex"
     ;;
-    -W,*)
-      pass_on_options="$pass_on_options ${1:3}"
+    -W*)
+      pass_on_options="$pass_on_options $1"
     ;;
     *)
       echo "mkoctfile: unrecognized argument $1" 1>&2
--- a/test/build_sparse_tests.sh	Sat Jun 18 07:37:20 2011 -0700
+++ b/test/build_sparse_tests.sh	Mon Jun 20 11:12:39 2011 -0400
@@ -102,7 +102,7 @@
 #    gen_assembly_tests
 #        test for sparse constructors with 'sum' vs. 'unique'
 #    gen_select_tests
-#        indexing tests
+#        indexing and assignment tests
 #    gen_solver_tests
 #        Tests the solve function with triangular/banded, etc matrices