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-locbuf.h"
#include "defun-dld.h"
#include "error.h"
#include "oct-obj.h"

Include dependency graph for gcd.cc:


Functions

 DEFUN_DLD (gcd, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{g} =} gcd (@var{a})\n\ @deftypefnx {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 the elements of @var{a}. 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 integers. For example,\n\ \n\ @example\n\ @group\n\ gcd ([15, 20])\n\ @result{} 5\n\ @end group\n\ @end 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\ @example\n\ @var{g} = @var{v1} .* @var{a1} + @var{v2} .* @var{a2} + @dots{}\n\ @end example\n\ @end ifnottex\n\ \n\ For backward compatibility with previous versions of this function, when\n\ all arguments are scalar, a single return argument @var{v1} containing\n\ all of the values of @var{v1}, @dots{} is acceptable.\n\ @seealso{lcm, factor}\n\ @end deftypefn")

Function Documentation

DEFUN_DLD ( gcd  ,
args  ,
nargout   
)