Guest User

Untitled

a guest
Jan 16th, 2018
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.01 KB | None | 0 0
  1. ~/D/o/o/.build $ hg export -r 24611:cf397451e132 -r 24610:af8f75ba2752 -r 24609:ee7b411e3ce3 -r 24609:ee7b411e3ce3
  2. # HG changeset patch
  3. # User Sahil Yadav <yadavsahil5198@gmail.com>
  4. # Date 1516104789 -19800
  5. #      Tue Jan 16 17:43:09 2018 +0530
  6. # Branch local
  7. # Node ID cf397451e13279c1dd0358f4db525444c4b17875
  8. # Parent  af8f75ba2752be76543595aa0aa6aa4b0406c1a3
  9. extra space removal
  10.  
  11. diff -r af8f75ba2752 -r cf397451e132 libinterp/corefcn/data.cc
  12. --- a/libinterp/corefcn/data.cc Tue Jan 16 17:41:21 2018 +0530
  13. +++ b/libinterp/corefcn/data.cc Tue Jan 16 17:43:09 2018 +0530
  14. @@ -6137,8 +6137,6 @@
  15.                                       octave_value::op_el_and_eq, args);
  16.  }
  17.  
  18. -
  19. -
  20.  DEFUN (or, args, ,
  21.         doc: /* -*- texinfo -*-
  22.  @deftypefn  {} {@var{z} =} or (@var{x}, @var{y})
  23. # HG changeset patch
  24. # User Sahil Yadav <yadavsahil5198@gmail.com>
  25. # Date 1516104681 -19800
  26. #      Tue Jan 16 17:41:21 2018 +0530
  27. # Branch local
  28. # Node ID af8f75ba2752be76543595aa0aa6aa4b0406c1a3
  29. # Parent  ee7b411e3ce3d8764564d4bdfe519ccbc87537da
  30. completed xor function
  31.  
  32. diff -r ee7b411e3ce3 -r af8f75ba2752 libinterp/corefcn/data.cc
  33. --- a/libinterp/corefcn/data.cc Tue Jan 16 12:35:22 2018 +0530
  34. +++ b/libinterp/corefcn/data.cc Tue Jan 16 17:41:21 2018 +0530
  35. @@ -6137,8 +6137,32 @@
  36.                                       octave_value::op_el_and_eq, args);
  37.  }
  38.  
  39. +
  40. +
  41. +DEFUN (or, args, ,
  42. +       doc: /* -*- texinfo -*-
  43. +@deftypefn  {} {@var{z} =} or (@var{x}, @var{y})
  44. +@deftypefnx {} {@var{z} =} or (@var{x1}, @var{x2}, @dots{})
  45. +Return the logical OR of @var{x} and @var{y}.
  46. +
  47. +This function is equivalent to the operator syntax @w{@code{x | y}}.  If
  48. +more than two arguments are given, the logical OR is applied cumulatively
  49. +from left to right:
  50. +
  51. +@example
  52. +(@dots{}((x1 | x2) | x3) | @dots{})
  53. +@end example
  54. +
  55. +At least one argument is required.
  56. +@seealso{and, not, xor}
  57. +@end deftypefn */)
  58. +{
  59. +  return binary_assoc_op_defun_body (octave_value::op_el_or,
  60. +                                     octave_value::op_el_or_eq, args);
  61. +}
  62. +
  63.  DEFUN (xor, args, ,
  64. -       doc: /*-*- texinfo -*-
  65. +       doc: /* -*- texinfo -*-
  66.  @deftypefn  {} {@var{z} =} xor (@var{x}, @var{y})
  67.  @deftypefnx {} {@var{z} =} xor (@var{x1}, @var{x2}, @dots{})
  68.  Return the @dfn{exclusive or} of @var{x} and @var{y}.
  69. @@ -6167,34 +6191,37 @@
  70.  @end example
  71.  
  72.  @seealso{and, or, not}
  73. -@end deftypefn*/)
  74. -{
  75. -  return binary_assoc_op_defun_body (octave_value::op_ne,
  76. -                                     octave_value::op_asn_eq, args);
  77. -}
  78. -
  79. -
  80. -DEFUN (or, args, ,
  81. -       doc: /* -*- texinfo -*-
  82. -@deftypefn  {} {@var{z} =} or (@var{x}, @var{y})
  83. -@deftypefnx {} {@var{z} =} or (@var{x1}, @var{x2}, @dots{})
  84. -Return the logical OR of @var{x} and @var{y}.
  85. -
  86. -This function is equivalent to the operator syntax @w{@code{x | y}}.  If
  87. -more than two arguments are given, the logical OR is applied cumulatively
  88. -from left to right:
  89. -
  90. -@example
  91. -(@dots{}((x1 | x2) | x3) | @dots{})
  92. -@end example
  93. -
  94. -At least one argument is required.
  95. -@seealso{and, not, xor}
  96.  @end deftypefn */)
  97.  {
  98. -  return binary_assoc_op_defun_body (octave_value::op_el_or,
  99. -                                     octave_value::op_el_or_eq, args);
  100. -}
  101. +  int nargin = args.length ();
  102. +  octave_value retval,arg1,arg2;
  103. +  
  104. +  if (nargin < 2)
  105. +    print_usage ();
  106. +  else
  107. +  {
  108. +    arg1 = do_unary_op (octave_value::op_not, args(0));
  109. +    arg2 = do_unary_op (octave_value::op_not, args(1));
  110. +
  111. +    if (nargin == 2)
  112. +      retval = do_binary_op (octave_value::op_ne, arg1, arg2);
  113. +    else
  114. +      {
  115. +        retval = do_binary_op (octave_value::op_ne, arg1, arg2);
  116. +        
  117. +        for (int i = 2; i < nargin; i++)
  118. +        {
  119. +          arg1 = do_unary_op (octave_value::op_not, retval);
  120. +          arg2 = do_unary_op (octave_value::op_not, args(i));
  121. +
  122. +          retval = do_binary_op (octave_value::op_ne, arg1, arg2);        
  123. +        }
  124. +      }      
  125. +  }
  126. +  
  127. +  return retval;
  128. +}
  129. +
  130.  
  131.  DEFUN (colon, args, ,
  132.         doc: /* -*- texinfo -*-
  133. diff -r ee7b411e3ce3 -r af8f75ba2752 libinterp/octave-value/ov.h
  134. --- a/libinterp/octave-value/ov.h   Tue Jan 16 12:35:22 2018 +0530
  135. +++ b/libinterp/octave-value/ov.h   Tue Jan 16 17:41:21 2018 +0530
  136. @@ -110,7 +110,6 @@
  137.      op_el_ldiv,        // ldivide
  138.      op_el_and,         // and
  139.      op_el_or,          // or
  140. -    op_el_xor,         // xor
  141.      op_struct_ref,
  142.      num_binary_ops,
  143.      unknown_binary_op
  144. # HG changeset patch
  145. # User Sahil Yadav <yadavsahil5198@gmail.com>
  146. # Date 1516086322 -19800
  147. #      Tue Jan 16 12:35:22 2018 +0530
  148. # Branch local
  149. # Node ID ee7b411e3ce3d8764564d4bdfe519ccbc87537da
  150. # Parent  a67d5deddb64ef9d6b141bbc3e730250a8147619
  151. data.cc ov.h module.mk changed
  152.  
  153. diff -r a67d5deddb64 -r ee7b411e3ce3 libinterp/corefcn/data.cc
  154. --- a/libinterp/corefcn/data.cc Tue Jan 16 11:45:50 2018 +0530
  155. +++ b/libinterp/corefcn/data.cc Tue Jan 16 12:35:22 2018 +0530
  156. @@ -6169,8 +6169,8 @@
  157.  @seealso{and, or, not}
  158.  @end deftypefn*/)
  159.  {
  160. -  return binary_assoc_op_defun_body (octave_value::op_el_xor,
  161. -                                     octave_value::op_el_xor_eq, args);
  162. +  return binary_assoc_op_defun_body (octave_value::op_ne,
  163. +                                     octave_value::op_asn_eq, args);
  164.  }
  165.  
  166.  
  167. diff -r a67d5deddb64 -r ee7b411e3ce3 libinterp/octave-value/ov.h
  168. --- a/libinterp/octave-value/ov.h   Tue Jan 16 11:45:50 2018 +0530
  169. +++ b/libinterp/octave-value/ov.h   Tue Jan 16 12:35:22 2018 +0530
  170. @@ -110,6 +110,7 @@
  171.      op_el_ldiv,        // ldivide
  172.      op_el_and,         // and
  173.      op_el_or,          // or
  174. +    op_el_xor,         // xor
  175.      op_struct_ref,
  176.      num_binary_ops,
  177.      unknown_binary_op
  178. diff -r a67d5deddb64 -r ee7b411e3ce3 scripts/general/module.mk
  179. --- a/scripts/general/module.mk Tue Jan 16 11:45:50 2018 +0530
  180. +++ b/scripts/general/module.mk Tue Jan 16 12:35:22 2018 +0530
  181. @@ -69,8 +69,7 @@
  182.    %reldir%/structfun.m \
  183.    %reldir%/subsindex.m \
  184.    %reldir%/trapz.m \
  185. -  %reldir%/triplequad.m \
  186. -  %reldir%/xor.m
  187. +  %reldir%/triplequad.m
  188.  
  189.  %canon_reldir%dir = $(fcnfiledir)/general
Add Comment
Please, Sign In to add comment