From octave-sources-request at bevo dot che dot wisc dot edu Sat Dec 23 10:53:17 2000 Subject: Allows booleans to go through &s and |s From: "Cai Jianming" To: Date: Sun, 24 Dec 2000 00:50:29 +0800 This is a multi-part message in MIME format. ------=_NextPart_000_0012_01C06D43.8325C1A0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0013_01C06D43.8325C1A0" ------=_NextPart_001_0013_01C06D43.8325C1A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, The following patch gives >> typeinfo(1=3D=3D1 & 2=3D=3D2) bool Previously, the result was scalar. Hope this goes into the next = version. Regards, Jianming ------=_NextPart_001_0013_01C06D43.8325C1A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
   The following patch = gives
 >> typeinfo(1=3D=3D1 &=20 2=3D=3D2)
 bool
 
  Previously, the result was = scalar. Hope this=20 goes into the next version.
 
Regards,
Jianming
 
------=_NextPart_001_0013_01C06D43.8325C1A0-- ------=_NextPart_000_0012_01C06D43.8325C1A0 Content-Type: application/octet-stream; name="op-b-b.cc.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="op-b-b.cc.patch" *** octave-2.1.32.orig/src/OPERATORS/op-b-b.cc Wed Feb 2 20:36:31 2000=0A= --- octave-2.1.32/src/OPERATORS/op-b-b.cc Sat Dec 23 23:07:40 2000=0A= *************** DEFUNOP_OP (hermitian, bool, /* no-op */=0A= *** 48,53 ****=0A= --- 48,66 ----=0A= =0A= DEFBINOP_OP (eq, bool, bool, =3D=3D)=0A= DEFBINOP_OP (ne, bool, bool, !=3D)=0A= + // DEFBINOP_OP (el_and, bool, bool, &)=0A= + BINOPDECL(el_and, a1, a2)=0A= + {=0A= + CAST_BINOP_ARGS (const octave_bool &, const octave_bool &);=0A= + return octave_value(bool(v1.bool_value() & v2.bool_value()));=0A= + }=0A= + // DEFBINOP_OP (el_or, bool, bool, |)=0A= + BINOPDECL(el_or, a1, a2)=0A= + {=0A= + CAST_BINOP_ARGS (const octave_bool &, const octave_bool &);=0A= + return octave_value(bool(v1.bool_value() | v2.bool_value()));=0A= + }=0A= + =0A= =0A= void=0A= install_b_b_ops (void)=0A= *************** install_b_b_ops (void)=0A= *** 58,63 ****=0A= --- 71,78 ----=0A= =0A= INSTALL_BINOP (op_eq, octave_bool, octave_bool, eq);=0A= INSTALL_BINOP (op_ne, octave_bool, octave_bool, ne);=0A= + INSTALL_BINOP (op_el_and, octave_bool, octave_bool, el_and);=0A= + INSTALL_BINOP (op_el_or, octave_bool, octave_bool, el_or);=0A= }=0A= =0A= /*=0A= =00 ------=_NextPart_000_0012_01C06D43.8325C1A0-- __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------