Error with the expression b" when b is a string" /var/tmp/oct-AAAa0023H

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error with the expression b" when b is a string" /var/tmp/oct-AAAa0023H

ged-3
Bug report for Octave 1.93 configured for sparc-sun-solaris2.5

Description:
-----------

The following expressions are working without errors with octave 1.1.1

Repeat-By:
---------

Octave, version 1.93 (sparc-sun-solaris2.5).
Copyright (C) 1996 John W. Eaton.
This is free software with ABSOLUTELY NO WARRANTY.
For details, type `warranty'.

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

Fix:
---

  * If possible, replace this item with a description of how to
    fix the problem (if you don't have a fix for the problem, don't
    include this section, but please do submit your report anyway).



Configuration (please do not edit this section):
-----------------------------------------------

uname output:     SunOS gimli 5.5 Generic sun4m sparc SUNW,SPARCstation-20
configure opts:   --prefix=/gimli1/ged/octave2
Fortran compiler: f77
FFLAGS:           -O
F2C:              
F2CFLAGS:        
FLIBS:            -Xlinker -R -Xlinker /logi/prive/opt/lang/SUNWspro/lib:/opt/SUNWspro/lib   -L /logi/prive/opt/lang/SUNWspro/lib -L /logi/prive/opt/lang/SUNWspro/SC4.0/lib -L /opt/SUNWspro/lib -L /usr/ccs/lib -L /usr/lib /logi/prive/opt/lang/SUNWspro/SC4.0/lib/libM77.a -lF77 -lsunmath -lcx
CPPFLAGS:        
INCFLAGS:         -I/gimli1/ged/octave2/include -I/gimli1/ged/octave2/include/octave-1.93
C compiler:       gcc, version 2.7.2
CFLAGS:           -DHAVE_CONFIG_H  -g -O -Wall
CPICFLAG:         -fPIC
C++ compiler:     c++, version 2.7.2
CXXFLAGS:         -DHAVE_CONFIG_H  -fno-implicit-templates  -g -O -Wall
CXXPICFLAG:       -fPIC
LDFLAGS:          -g
LIBFLAGS:         -L/gimli1/ged/octave2/lib
RLD_FLAG:         -Xlinker -R -Xlinker /gimli1/ged/octave2/lib
CXXLIBS:          -lsocket -lsocket -lstdc++ -lm -L/logi/pub/outils/gnu/gcc/gcc-2.7.2/solaris/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2 -L/usr/ccs/bin -L/usr/ccs/lib -L/logi/pub/outils/gnu/gcc/gcc-2.7.2/solaris/lib -lsocket -lstdc++ -lm -lgcc -lc -lgcc
TERMLIBS:         -ltermcap
LIBS:            
LEXLIB:           -ll
LIBPLPLOT:        
LIBDLFCN:        
DEFS:

  -DOCTAVE_SOURCE=1 -DSEPCHAR=':' -DSEPCHAR_STR=":" -DUSE_GNU_INFO=1
  -DUSE_READLINE=1 -DHAVE_LIBSOCKET=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4
  -DSIZEOF_LONG=4 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1
  -DF77_APPEND_UNDERSCORE=1 -DSTDC_HEADERS=1 -DHAVE_DIRENT_H=1
  -DTIME_WITH_SYS_TIME=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_ASSERT_H=1
  -DHAVE_CURSES_H=1 -DHAVE_FCNTL_H=1 -DHAVE_FLOAT_H=1
  -DHAVE_FLOATINGPOINT_H=1 -DHAVE_GRP_H=1 -DHAVE_IEEEFP_H=1
  -DHAVE_LIMITS_H=1 -DHAVE_MEMORY_H=1 -DHAVE_NAN_H=1 -DHAVE_PWD_H=1
  -DHAVE_SGTTY_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
  -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_SELECT_H=1
  -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMES_H=1
  -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_UTSNAME_H=1 -DHAVE_TERMIO_H=1
  -DHAVE_TERMIOS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_VARARGS_H=1
  -DNPSOL_MISSING=1 -DQPSOL_MISSING=1 -DFSQP_MISSING=1 -DHAVE_ATEXIT=1
  -DHAVE_BCOPY=1 -DHAVE_BZERO=1 -DHAVE_DUP2=1 -DHAVE_ENDGRENT=1
  -DHAVE_ENDPWENT=1 -DHAVE_EXECVP=1 -DHAVE_FCNTL=1 -DHAVE_FORK=1
  -DHAVE_GETCWD=1 -DHAVE_GETEGID=1 -DHAVE_GETEUID


Reply | Threaded
Open this post in threaded view
|

Error with the expression b' when b is a string

John W. Eaton-6
On 21-Nov-1996, [hidden email] <[hidden email]> 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; }