Navigation

Operators and Keywords

Function List:

C++ API

gcd.cc File Reference

#include "dNDArray.h"
#include "CNDArray.h"
#include "fNDArray.h"
#include "fCNDArray.h"
#include "lo-mappers.h"
#include "oct-binmap.h"
#include "defun-dld.h"
#include "error.h"
#include "oct-obj.h"
Include dependency graph for gcd.cc:

Defines

#define MAKE_INT_BRANCH(X)
#define MAKE_INT_BRANCH(X)

Functions

 DEFUN_DLD (gcd, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{g} =} gcd (@var{a1}, @var{a2}, @dots{})\n\ @deftypefnx {Loadable Function} {[@var{g}, @var{v1}, @dots{}] =} gcd (@var{a1}, @var{a2}, @dots{})\n\ \n\ Compute the greatest common divisor of @var{a1}, @var{a2}, @dots{}. If more\n\ than one argument is given all arguments must be the same size or scalar.\n\ In this case the greatest common divisor is calculated for each element\n\ individually. All elements must be ordinary or Gaussian (complex)\n\ integers. Note that for Gaussian integers, the gcd is not unique up to\n\ units (multiplication by 1, -1, @var{i} or -@var{i}), so an arbitrary\n\ greatest common divisor amongst four possible is returned. For example,\n\ \n\ @noindent\n\ and\n\ \n\ @example\n\ @group\n\ gcd ([15, 9], [20, 18])\n\ @result{} 5 9\n\ @end group\n\ @end example\n\ \n\ Optional return arguments @var{v1}, etc., contain integer vectors such\n\ that,\n\ \n\ @tex\n\ $g = v_1 a_1 + v_2 a_2 + \\cdots$\n\ @end tex\n\ @ifnottex\n\ \n\ @example\n\ @var{g} = @var{v1} .* @var{a1} + @var{v2} .* @var{a2} + @dots{}\n\ @end example\n\ \n\ @end ifnottex\n\ \n\ @seealso{lcm, factor}\n\ @end deftypefn")

Define Documentation

#define MAKE_INT_BRANCH (   X  ) 
Value:
case btyp_ ## X: \
      retval = do_simple_gcd<X ## NDArray> (a, b); \
      break
#define MAKE_INT_BRANCH (   X  ) 
Value:
case btyp_ ## X: \
      retval = do_extended_gcd<X ## NDArray> (a, b, x, y); \
      break

Function Documentation

DEFUN_DLD ( gcd  ,
args  ,
nargout   
)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines