Mercurial > octave
comparison src/data.cc @ 6518:952c8b00525e
[project @ 2007-04-11 20:50:22 by jwe]
author | jwe |
---|---|
date | Wed, 11 Apr 2007 20:50:23 +0000 |
parents | 184ab67c3bc1 |
children | 8810bbf321ce |
comparison
equal
deleted
inserted
replaced
6517:a1ec359aef37 | 6518:952c8b00525e |
---|---|
2654 print_usage (); | 2654 print_usage (); |
2655 | 2655 |
2656 return retval; | 2656 return retval; |
2657 } | 2657 } |
2658 | 2658 |
2659 #define UNARY_OP_DEFUN_BODY(F) \ | |
2660 \ | |
2661 octave_value retval; \ | |
2662 \ | |
2663 if (args.length () == 1) \ | |
2664 retval = F (args(0)); \ | |
2665 else \ | |
2666 print_usage (); \ | |
2667 \ | |
2668 return retval | |
2669 | |
2670 DEFUN (not, args, , | |
2671 "-*- texinfo -*-\n\ | |
2672 @deftypefn {Built-in Function} {} not (@var{x})\n\ | |
2673 This function is equivalent to @code{! x}.\n\ | |
2674 @end deftypefn") | |
2675 { | |
2676 UNARY_OP_DEFUN_BODY (op_not); | |
2677 } | |
2678 | |
2679 DEFUN (uplus, args, , | |
2680 "-*- texinfo -*-\n\ | |
2681 @deftypefn {Built-in Function} {} uplus (@var{x})\n\ | |
2682 This function is equivalent to @code{+ x}.\n\ | |
2683 @end deftypefn") | |
2684 { | |
2685 UNARY_OP_DEFUN_BODY (op_uplus); | |
2686 } | |
2687 | |
2688 DEFUN (uminus, args, , | |
2689 "-*- texinfo -*-\n\ | |
2690 @deftypefn {Built-in Function} {} uminus (@var{x})\n\ | |
2691 This function is equivalent to @code{- x}.\n\ | |
2692 @end deftypefn") | |
2693 { | |
2694 UNARY_OP_DEFUN_BODY (op_uminus); | |
2695 } | |
2696 | |
2697 DEFUN (transpose, args, , | |
2698 "-*- texinfo -*-\n\ | |
2699 @deftypefn {Built-in Function} {} transpose (@var{x})\n\ | |
2700 This function is equivalent to @code{x.'}.\n\ | |
2701 @end deftypefn") | |
2702 { | |
2703 UNARY_OP_DEFUN_BODY (op_transpose); | |
2704 } | |
2705 | |
2706 DEFUN (ctranspose, args, , | |
2707 "-*- texinfo -*-\n\ | |
2708 @deftypefn {Built-in Function} {} ctranspose (@var{x})\n\ | |
2709 This function is equivalent to @code{x'}.\n\ | |
2710 @end deftypefn") | |
2711 { | |
2712 UNARY_OP_DEFUN_BODY (op_hermitian); | |
2713 } | |
2714 | |
2715 #define BINARY_OP_DEFUN_BODY(F) \ | |
2716 \ | |
2717 octave_value retval; \ | |
2718 \ | |
2719 if (args.length () == 2) \ | |
2720 retval = F (args(0), args(1)); \ | |
2721 else \ | |
2722 print_usage (); \ | |
2723 \ | |
2724 return retval | |
2725 | |
2726 DEFUN (plus, args, , | |
2727 "-*- texinfo -*-\n\ | |
2728 @deftypefn {Built-in Function} {} plus (@var{x}, @var{y})\n\ | |
2729 This function is equivalent to @code{x + y}.\n\ | |
2730 @end deftypefn") | |
2731 { | |
2732 BINARY_OP_DEFUN_BODY (op_add); | |
2733 } | |
2734 | |
2735 DEFUN (minus, args, , | |
2736 "-*- texinfo -*-\n\ | |
2737 @deftypefn {Built-in Function} {} minus (@var{x}, @var{y})\n\ | |
2738 This function is equivalent to @code{x - y}.\n\ | |
2739 @end deftypefn") | |
2740 { | |
2741 BINARY_OP_DEFUN_BODY (op_sub); | |
2742 } | |
2743 | |
2744 DEFUN (mtimes, args, , | |
2745 "-*- texinfo -*-\n\ | |
2746 @deftypefn {Built-in Function} {} mtimes (@var{x}, @var{y})\n\ | |
2747 This function is equivalent to @code{x * y}.\n\ | |
2748 @end deftypefn") | |
2749 { | |
2750 BINARY_OP_DEFUN_BODY (op_mul); | |
2751 } | |
2752 | |
2753 DEFUN (mrdivide, args, , | |
2754 "-*- texinfo -*-\n\ | |
2755 @deftypefn {Built-in Function} {} mrdivide (@var{x}, @var{y})\n\ | |
2756 This function is equivalent to @code{x / y}.\n\ | |
2757 @end deftypefn") | |
2758 { | |
2759 BINARY_OP_DEFUN_BODY (op_div); | |
2760 } | |
2761 | |
2762 DEFUN (mpower, args, , | |
2763 "-*- texinfo -*-\n\ | |
2764 @deftypefn {Built-in Function} {} mpower (@var{x}, @var{y})\n\ | |
2765 This function is equivalent to @code{x ^ y}.\n\ | |
2766 @end deftypefn") | |
2767 { | |
2768 BINARY_OP_DEFUN_BODY (op_pow); | |
2769 } | |
2770 | |
2771 DEFUN (mldivide, args, , | |
2772 "-*- texinfo -*-\n\ | |
2773 @deftypefn {Built-in Function} {} mldivide (@var{x}, @var{y})\n\ | |
2774 This function is equivalent to @code{x \\ y}.\n\ | |
2775 @end deftypefn") | |
2776 { | |
2777 BINARY_OP_DEFUN_BODY (op_ldiv); | |
2778 } | |
2779 | |
2780 DEFUN (lt, args, , | |
2781 "-*- texinfo -*-\n\ | |
2782 @deftypefn {Built-in Function} {} lt (@var{x}, @var{y})\n\ | |
2783 This function is equivalent to @code{x < y}.\n\ | |
2784 @end deftypefn") | |
2785 { | |
2786 BINARY_OP_DEFUN_BODY (op_lt); | |
2787 } | |
2788 | |
2789 DEFUN (le, args, , | |
2790 "-*- texinfo -*-\n\ | |
2791 @deftypefn {Built-in Function} {} le (@var{x}, @var{y})\n\ | |
2792 This function is equivalent to @code{x <= y}.\n\ | |
2793 @end deftypefn") | |
2794 { | |
2795 BINARY_OP_DEFUN_BODY (op_le); | |
2796 } | |
2797 | |
2798 DEFUN (eq, args, , | |
2799 "-*- texinfo -*-\n\ | |
2800 @deftypefn {Built-in Function} {} eq (@var{x}, @var{y})\n\ | |
2801 This function is equivalent to @code{x == y}.\n\ | |
2802 @end deftypefn") | |
2803 { | |
2804 BINARY_OP_DEFUN_BODY (op_eq); | |
2805 } | |
2806 | |
2807 DEFUN (ge, args, , | |
2808 "-*- texinfo -*-\n\ | |
2809 @deftypefn {Built-in Function} {} ge (@var{x}, @var{y})\n\ | |
2810 This function is equivalent to @code{x >= y}.\n\ | |
2811 @end deftypefn") | |
2812 { | |
2813 BINARY_OP_DEFUN_BODY (op_ge); | |
2814 } | |
2815 | |
2816 DEFUN (gt, args, , | |
2817 "-*- texinfo -*-\n\ | |
2818 @deftypefn {Built-in Function} {} gt (@var{x}, @var{y})\n\ | |
2819 This function is equivalent to @code{x > y}.\n\ | |
2820 @end deftypefn") | |
2821 { | |
2822 BINARY_OP_DEFUN_BODY (op_gt); | |
2823 } | |
2824 | |
2825 DEFUN (ne, args, , | |
2826 "-*- texinfo -*-\n\ | |
2827 @deftypefn {Built-in Function} {} ne (@var{x}, @var{y})\n\ | |
2828 This function is equivalent to @code{x != y}.\n\ | |
2829 @end deftypefn") | |
2830 { | |
2831 BINARY_OP_DEFUN_BODY (op_ne); | |
2832 } | |
2833 | |
2834 DEFUN (times, args, , | |
2835 "-*- texinfo -*-\n\ | |
2836 @deftypefn {Built-in Function} {} times (@var{x}, @var{y})\n\ | |
2837 This function is equivalent to @code{x .* y}.\n\ | |
2838 @end deftypefn") | |
2839 { | |
2840 BINARY_OP_DEFUN_BODY (op_el_mul); | |
2841 } | |
2842 | |
2843 DEFUN (rdivide, args, , | |
2844 "-*- texinfo -*-\n\ | |
2845 @deftypefn {Built-in Function} {} rdivide (@var{x}, @var{y})\n\ | |
2846 This function is equivalent to @code{x ./ y}.\n\ | |
2847 @end deftypefn") | |
2848 { | |
2849 BINARY_OP_DEFUN_BODY (op_el_div); | |
2850 } | |
2851 | |
2852 DEFUN (power, args, , | |
2853 "-*- texinfo -*-\n\ | |
2854 @deftypefn {Built-in Function} {} power (@var{x}, @var{y})\n\ | |
2855 This function is equivalent to @code{x .\\ y}.\n\ | |
2856 @end deftypefn") | |
2857 { | |
2858 BINARY_OP_DEFUN_BODY (op_el_pow); | |
2859 } | |
2860 | |
2861 DEFUN (ldivide, args, , | |
2862 "-*- texinfo -*-\n\ | |
2863 @deftypefn {Built-in Function} {} ldivide (@var{x}, @var{y})\n\ | |
2864 @end deftypefn") | |
2865 { | |
2866 BINARY_OP_DEFUN_BODY (op_el_ldiv); | |
2867 } | |
2868 | |
2869 DEFUN (and, args, , | |
2870 "-*- texinfo -*-\n\ | |
2871 @deftypefn {Built-in Function} {} and (@var{x}, @var{y})\n\ | |
2872 This function is equivalent to @code{x & y}.\n\ | |
2873 @end deftypefn") | |
2874 { | |
2875 BINARY_OP_DEFUN_BODY (op_el_and); | |
2876 } | |
2877 | |
2878 DEFUN (or, args, , | |
2879 "-*- texinfo -*-\n\ | |
2880 @deftypefn {Built-in Function} {} or (@var{x}, @var{y})\n\ | |
2881 This function is equivalent to @code{x | y}.\n\ | |
2882 @end deftypefn") | |
2883 { | |
2884 BINARY_OP_DEFUN_BODY (op_el_or); | |
2885 } | |
2886 | |
2659 /* | 2887 /* |
2660 ;;; Local Variables: *** | 2888 ;;; Local Variables: *** |
2661 ;;; mode: C++ *** | 2889 ;;; mode: C++ *** |
2662 ;;; End: *** | 2890 ;;; End: *** |
2663 */ | 2891 */ |