changeset 6371:b51f76ee24bb

[project @ 2007-03-01 14:55:23 by dbateman]
author dbateman
date Thu, 01 Mar 2007 14:55:24 +0000
parents 6edb00b095a3
children a9a95bb1bf9e
files src/ChangeLog src/DLD-FUNCTIONS/matrix_type.cc
diffstat 2 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Feb 28 23:15:23 2007 +0000
+++ b/src/ChangeLog	Thu Mar 01 14:55:24 2007 +0000
@@ -1,3 +1,8 @@
+2007-03-01  David Bateman  <dbateman@free.fr>
+
+	* DLD-FUNCTIONS/matrix_type.cc (Fmatrix_type): Special case scalar
+	types and always return "Full" matrix type.
+
 2007-02-28  John W. Eaton  <jwe@octave.org>
 
 	* input.cc (interactive_input): Also call flush_octave_stdout
--- a/src/DLD-FUNCTIONS/matrix_type.cc	Wed Feb 28 23:15:23 2007 +0000
+++ b/src/DLD-FUNCTIONS/matrix_type.cc	Thu Mar 01 14:55:24 2007 +0000
@@ -109,13 +109,20 @@
     error ("matrix_type: incorrect number of arguments");
   else
     {
-      if (args(0).is_sparse_type ())
+      if (args(0).is_scalar_type())
+	{
+	  if (nargin == 1)
+	    retval = octave_value ("Full");
+	  else
+	    retval = args(0);
+	}
+      else if (args(0).is_sparse_type ())
 	{
 	  if (nargin == 1)
 	    {
 	      MatrixType mattyp;
 
-	      if (args(0).type_name () == "sparse complex matrix" ) 
+	      if (args(0).is_complex_type ()) 
 		{
 		  mattyp = args(0).matrix_type ();
 
@@ -283,7 +290,7 @@
 		      if (! error_state)
 			{
 			  // Set the matrix type
-			  if (args(0).type_name () == "sparse complex matrix" ) 
+			  if (args(0).is_complex_type ())
 			    retval = 
 			      octave_value (args(0).sparse_complex_matrix_value (), 
 					    mattyp);
@@ -301,7 +308,7 @@
 	    {
 	      MatrixType mattyp;
 
-	      if (args(0).type_name () == "complex matrix" ) 
+	      if (args(0).is_complex_type ())
 		{
 		  mattyp = args(0).matrix_type ();
 
@@ -426,7 +433,7 @@
 		      if (! error_state)
 			{
 			  // Set the matrix type
-			  if (args(0).type_name () == "complex matrix" ) 
+			  if (args(0).is_complex_type())
 			    retval = 
 			      octave_value (args(0).complex_matrix_value (), 
 					    mattyp);