octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error with the expression b' when b is a string


From: John W. Eaton
Subject: Error with the expression b' when b is a string
Date: Thu, 21 Nov 1996 12:30:31 -0600

On 21-Nov-1996, address@hidden <address@hidden> wrote:

: The following expressions are working without errors with octave 1.1.1
: 
: octave:1> implicit_str_to_num_ok =1
: implicit_str_to_num_ok = 1
: octave:2> b='hello'
: b = hello
: octave:3> b'
: error: octave_base_value::hermitian(): wrong type argument `string'
: error: evaluating unary operator `'' near line 3, column 1
: error: evaluating assignment expression near line 3, column 1

Please try the following patch.  It will make Octave actually
transpose the string (no matter what the value of
implicit_str_to_num_ok).  If you really want to convert it to numeric
ASCII values, you will have to use toascii now in addition to the
transpose operator.

Thanks,

jwe

Index: ov-str-mat.h
===================================================================
RCS file: /home/jwe/src/master/octave/src/ov-str-mat.h,v
retrieving revision 1.7
diff -c -r1.7 ov-str-mat.h
*** ov-str-mat.h        1996/11/11 02:39:25     1.7
--- ov-str-mat.h        1996/11/21 18:25:37
***************
*** 102,107 ****
--- 102,113 ----
  
    string string_value (void) const;
  
+   octave_value transpose (void) const
+     { return octave_value (matrix.transpose (), true); }
+ 
+   octave_value hermitian (void) const
+     { return octave_value (matrix.transpose (), true); }
+ 
    void print (ostream& os, bool pr_as_read_syntax = false);
  
    int type_id (void) const { return t_id; }

Index: ov-ch-mat.h
===================================================================
RCS file: /home/jwe/src/master/octave/src/ov-ch-mat.h,v
retrieving revision 1.5
diff -c -r1.5 ov-ch-mat.h
*** ov-ch-mat.h 1996/11/07 16:47:00     1.5
--- ov-ch-mat.h 1996/11/21 18:19:18
***************
*** 116,121 ****
--- 116,127 ----
    octave_value convert_to_str (void) const
      { return octave_value (matrix); }
  
+   octave_value transpose (void) const
+     { return octave_value (matrix.transpose ()); }
+ 
+   octave_value hermitian (void) const
+     { return octave_value (matrix.transpose ()); }
+ 
    void print (ostream& os, bool pr_as_read_syntax = false);
  
    int type_id (void) const { return t_id; }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]