GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Macros | Functions
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.h"
#include "error.h"
#include "ovl.h"
Include dependency graph for gcd.cc:

Go to the source code of this file.

Macros

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

Functions

template<typename FP >
static void divide (const std::complex< FP > &a, const std::complex< FP > &b, std::complex< FP > &q, std::complex< FP > &r)
 
template<typename NDA >
static octave_value do_extended_gcd (const octave_value &a, const octave_value &b, octave_value &x, octave_value &y)
 
template<typename NDA >
static octave_value do_simple_gcd (const octave_value &a, const octave_value &b)
 
static double extended_gcd (double a, double b, double &x, double &y)
 
template<typename FP >
static std::complex< FP > extended_gcd (const std::complex< FP > &a, const std::complex< FP > &b, std::complex< FP > &x, std::complex< FP > &y)
 
template<typename T >
static octave_int< T > extended_gcd (const octave_int< T > &a, const octave_int< T > &b, octave_int< T > &x, octave_int< T > &y)
 
OCTAVE_EXPORT octave_value_list Fgcd (const octave_value_list &args, int nargout) ar
 
static double simple_gcd (double a, double b)
 
template<typename FP >
static std::complex< FP > simple_gcd (const std::complex< FP > &a, const std::complex< FP > &b)
 
template<typename T >
static octave_int< T > simple_gcd (const octave_int< T > &a, const octave_int< T > &b)
 

Macro Definition Documentation

#define MAKE_INT_BRANCH (   X)
Value:
case btyp_ ## X: \
retval = do_simple_gcd<X ## NDArray> (a, b); \
break
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
octave_value retval
Definition: data.cc:6294
b
Definition: cellfun.cc:398
#define MAKE_INT_BRANCH (   X)
Value:
case btyp_ ## X: \
retval = do_extended_gcd<X ## NDArray> (a, b, x, y); \
break
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
octave_value retval
Definition: data.cc:6294
the element is set to zero In other the statement xample y
Definition: data.cc:5342
b
Definition: cellfun.cc:398
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x

Function Documentation

template<typename FP >
static void divide ( const std::complex< FP > &  a,
const std::complex< FP > &  b,
std::complex< FP > &  q,
std::complex< FP > &  r 
)
static

Definition at line 63 of file gcd.cc.

References b, octave::math::floor(), imag(), and real().

Referenced by extended_gcd(), and simple_gcd().

template<typename NDA >
static octave_value do_extended_gcd ( const octave_value a,
const octave_value b,
octave_value x,
octave_value y 
)
static

Definition at line 318 of file gcd.cc.

References a, b, octave_value::dims(), dv, octave::err_nonconformant(), extended_gcd(), octave_value::is_scalar_type(), and retval.

Referenced by Fgcd().

template<typename NDA >
static octave_value do_simple_gcd ( const octave_value a,
const octave_value b 
)
static

Definition at line 238 of file gcd.cc.

References a, b, octave_value::is_scalar_type(), retval, and simple_gcd().

Referenced by Fgcd().

static double extended_gcd ( double  a,
double  b,
double x,
double y 
)
static

Definition at line 119 of file gcd.cc.

References error(), octave::math::floor(), and octave::math::isinteger().

Referenced by do_extended_gcd().

template<typename FP >
static std::complex<FP> extended_gcd ( const std::complex< FP > &  a,
const std::complex< FP > &  b,
std::complex< FP > &  x,
std::complex< FP > &  y 
)
static

Definition at line 156 of file gcd.cc.

References a, abs(), b, divide(), error(), octave::math::isinteger(), and swap.

template<typename T >
static octave_int<T> extended_gcd ( const octave_int< T > &  a,
const octave_int< T > &  b,
octave_int< T > &  x,
octave_int< T > &  y 
)
static

Definition at line 205 of file gcd.cc.

References octave_int< T >::abs(), and octave_int< T >::signum().

OCTAVE_EXPORT octave_value_list Fgcd ( const octave_value_list args,
int  nargout 
)
static double simple_gcd ( double  a,
double  b 
)
static

Definition at line 40 of file gcd.cc.

References error(), and octave::math::isinteger().

Referenced by do_simple_gcd().

template<typename FP >
static std::complex<FP> simple_gcd ( const std::complex< FP > &  a,
const std::complex< FP > &  b 
)
static

Definition at line 76 of file gcd.cc.

References a, abs(), b, divide(), error(), octave::math::isinteger(), and swap.

template<typename T >
static octave_int<T> simple_gcd ( const octave_int< T > &  a,
const octave_int< T > &  b 
)
static

Definition at line 103 of file gcd.cc.

References octave_int< T >::abs().