Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ~/D/o/o/.build $ hg export -r 24611:cf397451e132 -r 24610:af8f75ba2752 -r 24609:ee7b411e3ce3 -r 24609:ee7b411e3ce3
- # HG changeset patch
- # User Sahil Yadav <yadavsahil5198@gmail.com>
- # Date 1516104789 -19800
- # Tue Jan 16 17:43:09 2018 +0530
- # Branch local
- # Node ID cf397451e13279c1dd0358f4db525444c4b17875
- # Parent af8f75ba2752be76543595aa0aa6aa4b0406c1a3
- extra space removal
- diff -r af8f75ba2752 -r cf397451e132 libinterp/corefcn/data.cc
- --- a/libinterp/corefcn/data.cc Tue Jan 16 17:41:21 2018 +0530
- +++ b/libinterp/corefcn/data.cc Tue Jan 16 17:43:09 2018 +0530
- @@ -6137,8 +6137,6 @@
- octave_value::op_el_and_eq, args);
- }
- -
- -
- DEFUN (or, args, ,
- doc: /* -*- texinfo -*-
- @deftypefn {} {@var{z} =} or (@var{x}, @var{y})
- # HG changeset patch
- # User Sahil Yadav <yadavsahil5198@gmail.com>
- # Date 1516104681 -19800
- # Tue Jan 16 17:41:21 2018 +0530
- # Branch local
- # Node ID af8f75ba2752be76543595aa0aa6aa4b0406c1a3
- # Parent ee7b411e3ce3d8764564d4bdfe519ccbc87537da
- completed xor function
- diff -r ee7b411e3ce3 -r af8f75ba2752 libinterp/corefcn/data.cc
- --- a/libinterp/corefcn/data.cc Tue Jan 16 12:35:22 2018 +0530
- +++ b/libinterp/corefcn/data.cc Tue Jan 16 17:41:21 2018 +0530
- @@ -6137,8 +6137,32 @@
- octave_value::op_el_and_eq, args);
- }
- +
- +
- +DEFUN (or, args, ,
- + doc: /* -*- texinfo -*-
- +@deftypefn {} {@var{z} =} or (@var{x}, @var{y})
- +@deftypefnx {} {@var{z} =} or (@var{x1}, @var{x2}, @dots{})
- +Return the logical OR of @var{x} and @var{y}.
- +
- +This function is equivalent to the operator syntax @w{@code{x | y}}. If
- +more than two arguments are given, the logical OR is applied cumulatively
- +from left to right:
- +
- +@example
- +(@dots{}((x1 | x2) | x3) | @dots{})
- +@end example
- +
- +At least one argument is required.
- +@seealso{and, not, xor}
- +@end deftypefn */)
- +{
- + return binary_assoc_op_defun_body (octave_value::op_el_or,
- + octave_value::op_el_or_eq, args);
- +}
- +
- DEFUN (xor, args, ,
- - doc: /*-*- texinfo -*-
- + doc: /* -*- texinfo -*-
- @deftypefn {} {@var{z} =} xor (@var{x}, @var{y})
- @deftypefnx {} {@var{z} =} xor (@var{x1}, @var{x2}, @dots{})
- Return the @dfn{exclusive or} of @var{x} and @var{y}.
- @@ -6167,34 +6191,37 @@
- @end example
- @seealso{and, or, not}
- -@end deftypefn*/)
- -{
- - return binary_assoc_op_defun_body (octave_value::op_ne,
- - octave_value::op_asn_eq, args);
- -}
- -
- -
- -DEFUN (or, args, ,
- - doc: /* -*- texinfo -*-
- -@deftypefn {} {@var{z} =} or (@var{x}, @var{y})
- -@deftypefnx {} {@var{z} =} or (@var{x1}, @var{x2}, @dots{})
- -Return the logical OR of @var{x} and @var{y}.
- -
- -This function is equivalent to the operator syntax @w{@code{x | y}}. If
- -more than two arguments are given, the logical OR is applied cumulatively
- -from left to right:
- -
- -@example
- -(@dots{}((x1 | x2) | x3) | @dots{})
- -@end example
- -
- -At least one argument is required.
- -@seealso{and, not, xor}
- @end deftypefn */)
- {
- - return binary_assoc_op_defun_body (octave_value::op_el_or,
- - octave_value::op_el_or_eq, args);
- -}
- + int nargin = args.length ();
- + octave_value retval,arg1,arg2;
- +
- + if (nargin < 2)
- + print_usage ();
- + else
- + {
- + arg1 = do_unary_op (octave_value::op_not, args(0));
- + arg2 = do_unary_op (octave_value::op_not, args(1));
- +
- + if (nargin == 2)
- + retval = do_binary_op (octave_value::op_ne, arg1, arg2);
- + else
- + {
- + retval = do_binary_op (octave_value::op_ne, arg1, arg2);
- +
- + for (int i = 2; i < nargin; i++)
- + {
- + arg1 = do_unary_op (octave_value::op_not, retval);
- + arg2 = do_unary_op (octave_value::op_not, args(i));
- +
- + retval = do_binary_op (octave_value::op_ne, arg1, arg2);
- + }
- + }
- + }
- +
- + return retval;
- +}
- +
- DEFUN (colon, args, ,
- doc: /* -*- texinfo -*-
- diff -r ee7b411e3ce3 -r af8f75ba2752 libinterp/octave-value/ov.h
- --- a/libinterp/octave-value/ov.h Tue Jan 16 12:35:22 2018 +0530
- +++ b/libinterp/octave-value/ov.h Tue Jan 16 17:41:21 2018 +0530
- @@ -110,7 +110,6 @@
- op_el_ldiv, // ldivide
- op_el_and, // and
- op_el_or, // or
- - op_el_xor, // xor
- op_struct_ref,
- num_binary_ops,
- unknown_binary_op
- # HG changeset patch
- # User Sahil Yadav <yadavsahil5198@gmail.com>
- # Date 1516086322 -19800
- # Tue Jan 16 12:35:22 2018 +0530
- # Branch local
- # Node ID ee7b411e3ce3d8764564d4bdfe519ccbc87537da
- # Parent a67d5deddb64ef9d6b141bbc3e730250a8147619
- data.cc ov.h module.mk changed
- diff -r a67d5deddb64 -r ee7b411e3ce3 libinterp/corefcn/data.cc
- --- a/libinterp/corefcn/data.cc Tue Jan 16 11:45:50 2018 +0530
- +++ b/libinterp/corefcn/data.cc Tue Jan 16 12:35:22 2018 +0530
- @@ -6169,8 +6169,8 @@
- @seealso{and, or, not}
- @end deftypefn*/)
- {
- - return binary_assoc_op_defun_body (octave_value::op_el_xor,
- - octave_value::op_el_xor_eq, args);
- + return binary_assoc_op_defun_body (octave_value::op_ne,
- + octave_value::op_asn_eq, args);
- }
- diff -r a67d5deddb64 -r ee7b411e3ce3 libinterp/octave-value/ov.h
- --- a/libinterp/octave-value/ov.h Tue Jan 16 11:45:50 2018 +0530
- +++ b/libinterp/octave-value/ov.h Tue Jan 16 12:35:22 2018 +0530
- @@ -110,6 +110,7 @@
- op_el_ldiv, // ldivide
- op_el_and, // and
- op_el_or, // or
- + op_el_xor, // xor
- op_struct_ref,
- num_binary_ops,
- unknown_binary_op
- diff -r a67d5deddb64 -r ee7b411e3ce3 scripts/general/module.mk
- --- a/scripts/general/module.mk Tue Jan 16 11:45:50 2018 +0530
- +++ b/scripts/general/module.mk Tue Jan 16 12:35:22 2018 +0530
- @@ -69,8 +69,7 @@
- %reldir%/structfun.m \
- %reldir%/subsindex.m \
- %reldir%/trapz.m \
- - %reldir%/triplequad.m \
- - %reldir%/xor.m
- + %reldir%/triplequad.m
- %canon_reldir%dir = $(fcnfiledir)/general
Add Comment
Please, Sign In to add comment