changeset 12760:e8fe03bfc051 stable

allow concatenation of scalar structures with [] * op-struct.cc (DEFNDCATOP_FN (s_s_concat, ...)): Rename from DEFNDCATOP_FN (struct_struct)). (DEFNDCATOP_FN (s_ss_concat, ...): New function. (DEFNDCATOP_FN (ss_s_concat, ...): New function. (DEFNDCATOP_FN (ss_ss_concat, ...): New function. (install_struct_ops): Install new concat functions.
author John W. Eaton <jwe@octave.org>
date Mon, 20 Jun 2011 12:52:28 -0400
parents ecd1364a2700
children 13bcd62824a7
files src/OPERATORS/op-struct.cc
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/OPERATORS/op-struct.cc	Mon Jun 20 11:11:16 2011 -0400
+++ b/src/OPERATORS/op-struct.cc	Mon Jun 20 12:52:28 2011 -0400
@@ -54,7 +54,10 @@
   return octave_value (v.scalar_map_value ());
 }
 
-DEFNDCATOP_FN (struct_struct, struct, struct, map, map, concat)
+DEFNDCATOP_FN (s_s_concat, struct, struct, map, map, concat)
+DEFNDCATOP_FN (s_ss_concat, struct, scalar_struct, map, map, concat)
+DEFNDCATOP_FN (ss_s_concat, scalar_struct, struct, map, map, concat)
+DEFNDCATOP_FN (ss_ss_concat, scalar_struct, scalar_struct, map, map, concat)
 
 static octave_value
 oct_catop_struct_matrix (octave_base_value& a1, const octave_base_value& a2,
@@ -95,7 +98,11 @@
   INSTALL_UNOP (op_transpose, octave_scalar_struct, scalar_transpose);
   INSTALL_UNOP (op_hermitian, octave_scalar_struct, scalar_transpose);
 
-  INSTALL_CATOP (octave_struct, octave_struct, struct_struct);
+  INSTALL_CATOP (octave_struct, octave_struct, s_s_concat);
+  INSTALL_CATOP (octave_struct, octave_scalar_struct, s_ss_concat)
+  INSTALL_CATOP (octave_scalar_struct, octave_struct, ss_s_concat)
+  INSTALL_CATOP (octave_scalar_struct, octave_scalar_struct, ss_ss_concat)
+
   INSTALL_CATOP (octave_struct, octave_matrix, struct_matrix);
   INSTALL_CATOP (octave_matrix, octave_struct, matrix_struct);
 }