GNU Octave  3.8.0
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
oct-convn.cc File Reference
#include <iostream>
#include <algorithm>
#include "f77-fcn.h"
#include "oct-convn.h"
#include "oct-locbuf.h"
Include dependency graph for oct-convn.cc:

Go to the source code of this file.

Macros

#define CONV_DEFS(TPREF, RPREF)
#define FORWARD_IMPL(T, R, f, F)

Functions

NDArray convn (const NDArray &a, const NDArray &b, convn_type ct)
Matrix convn (const Matrix &a, const Matrix &b, convn_type ct)
Matrix convn (const Matrix &a, const ColumnVector &c, const RowVector &r, convn_type ct)
ComplexNDArray convn (const ComplexNDArray &a, const NDArray &b, convn_type ct)
ComplexMatrix convn (const ComplexMatrix &a, const Matrix &b, convn_type ct)
ComplexMatrix convn (const ComplexMatrix &a, const ColumnVector &c, const RowVector &r, convn_type ct)
ComplexNDArray convn (const ComplexNDArray &a, const ComplexNDArray &b, convn_type ct)
ComplexMatrix convn (const ComplexMatrix &a, const ComplexMatrix &b, convn_type ct)
ComplexMatrix convn (const ComplexMatrix &a, const ComplexColumnVector &c, const ComplexRowVector &r, convn_type ct)
FloatMatrix convn (const FloatMatrix &a, const FloatMatrix &b, convn_type ct)
FloatMatrix convn (const FloatMatrix &a, const FloatColumnVector &c, const FloatRowVector &r, convn_type ct)
FloatNDArray convn (const FloatNDArray &a, const FloatNDArray &b, convn_type ct)
FloatComplexNDArray convn (const FloatComplexNDArray &a, const FloatNDArray &b, convn_type ct)
FloatComplexMatrix convn (const FloatComplexMatrix &a, const FloatMatrix &b, convn_type ct)
FloatComplexMatrix convn (const FloatComplexMatrix &a, const FloatColumnVector &c, const FloatRowVector &r, convn_type ct)
FloatComplexNDArray convn (const FloatComplexNDArray &a, const FloatComplexNDArray &b, convn_type ct)
FloatComplexMatrix convn (const FloatComplexMatrix &a, const FloatComplexMatrix &b, convn_type ct)
FloatComplexMatrix convn (const FloatComplexMatrix &a, const FloatComplexColumnVector &c, const FloatComplexRowVector &r, convn_type ct)
template<class T , class R >
static MArray< T > convolve (const MArray< T > &a, const MArray< R > &b, convn_type ct)
template<class T , class R >
static void convolve_2d (const T *a, octave_idx_type ma, octave_idx_type na, const R *b, octave_idx_type mb, octave_idx_type nb, T *c, bool inner)
template<>
F77_RET_T const
octave_idx_type const Complex
const octave_idx_type const
octave_idx_type const Complex
Complex *C F77_RET_T const
octave_idx_type const Complex
const octave_idx_type const
octave_idx_type const Complex
Complex *void 
convolve_2d< Complex, Complex > (const Complex *a, octave_idx_type ma, octave_idx_type na, const Complex *b, octave_idx_type mb, octave_idx_type nb, Complex *c, bool inner)
template<>
F77_RET_T const
octave_idx_type const Complex
const octave_idx_type const
octave_idx_type const double
Complex *C F77_RET_T const
octave_idx_type const Complex
const octave_idx_type const
octave_idx_type const double
Complex *void 
convolve_2d< Complex, double > (const Complex *a, octave_idx_type ma, octave_idx_type na, const double *b, octave_idx_type mb, octave_idx_type nb, Complex *c, bool inner)
template<>
F77_RET_T const
octave_idx_type const double
const octave_idx_type const
octave_idx_type const double
double *C F77_RET_T const
octave_idx_type const double
const octave_idx_type const
octave_idx_type const double
double *void 
convolve_2d< double, double > (const double *a, octave_idx_type ma, octave_idx_type na, const double *b, octave_idx_type mb, octave_idx_type nb, double *c, bool inner)
template<>
F77_RET_T const
octave_idx_type const float
const octave_idx_type const
octave_idx_type const float
float *C F77_RET_T const
octave_idx_type const float
const octave_idx_type const
octave_idx_type const float
float *void 
convolve_2d< float, float > (const float *a, octave_idx_type ma, octave_idx_type na, const float *b, octave_idx_type mb, octave_idx_type nb, float *c, bool inner)
template<>
F77_RET_T const
octave_idx_type const
FloatComplex const
octave_idx_type const
octave_idx_type const float
FloatComplex *C F77_RET_T
const octave_idx_type const
FloatComplex const
octave_idx_type const
octave_idx_type const float
FloatComplex *void 
convolve_2d< FloatComplex, float > (const FloatComplex *a, octave_idx_type ma, octave_idx_type na, const float *b, octave_idx_type mb, octave_idx_type nb, FloatComplex *c, bool inner)
template<>
F77_RET_T const
octave_idx_type const
FloatComplex const
octave_idx_type const
octave_idx_type const
FloatComplex FloatComplex *C
F77_RET_T const
octave_idx_type const
FloatComplex const
octave_idx_type const
octave_idx_type const
FloatComplex FloatComplex
*void 
convolve_2d< FloatComplex, FloatComplex > (const FloatComplex *a, octave_idx_type ma, octave_idx_type na, const FloatComplex *b, octave_idx_type mb, octave_idx_type nb, FloatComplex *c, bool inner)
template<class T , class R >
void convolve_nd (const T *a, const dim_vector &ad, const dim_vector &acd, const R *b, const dim_vector &bd, const dim_vector &bcd, T *c, const dim_vector &ccd, int nd, bool inner)
F77_RET_T F77_FUNC (dconv2o, DCONV2O)(const octave_idx_type &
F77_RET_T const
octave_idx_type const double
const octave_idx_type const
octave_idx_type const double
double *C F77_RET_T 
F77_FUNC (dconv2i, DCONV2I)(const octave_idx_type &
F77_RET_T F77_FUNC (sconv2o, SCONV2O)(const octave_idx_type &
F77_RET_T const
octave_idx_type const float
const octave_idx_type const
octave_idx_type const float
float *C F77_RET_T 
F77_FUNC (sconv2i, SCONV2I)(const octave_idx_type &
F77_RET_T F77_FUNC (zconv2o, ZCONV2O)(const octave_idx_type &
F77_RET_T const
octave_idx_type const Complex
const octave_idx_type const
octave_idx_type const Complex
Complex *C F77_RET_T 
F77_FUNC (zconv2i, ZCONV2I)(const octave_idx_type &
F77_RET_T F77_FUNC (cconv2o, CCONV2O)(const octave_idx_type &
F77_RET_T const
octave_idx_type const
FloatComplex const
octave_idx_type const
octave_idx_type const
FloatComplex FloatComplex *C
F77_RET_T 
F77_FUNC (cconv2i, CCONV2I)(const octave_idx_type &
F77_RET_T F77_FUNC (zdconv2o, ZDCONV2O)(const octave_idx_type &
F77_RET_T const
octave_idx_type const Complex
const octave_idx_type const
octave_idx_type const double
Complex *C F77_RET_T 
F77_FUNC (zdconv2i, ZDCONV2I)(const octave_idx_type &
F77_RET_T F77_FUNC (csconv2o, CSCONV2O)(const octave_idx_type &
F77_RET_T const
octave_idx_type const
FloatComplex const
octave_idx_type const
octave_idx_type const float
FloatComplex *C F77_RET_T 
F77_FUNC (csconv2i, CSCONV2I)(const octave_idx_type &

Macro Definition Documentation

#define CONV_DEFS (   TPREF,
  RPREF 
)
Value:
TPREF ## NDArray \
convn (const TPREF ## NDArray& a, const RPREF ## NDArray& b, convn_type ct) \
{ \
return convolve (a, b, ct); \
} \
TPREF ## Matrix \
convn (const TPREF ## Matrix& a, const RPREF ## Matrix& b, convn_type ct) \
{ \
return convolve (a, b, ct); \
} \
TPREF ## Matrix \
convn (const TPREF ## Matrix& a, const RPREF ## ColumnVector& c, \
const RPREF ## RowVector& r, convn_type ct) \
{ \
return convolve (a, c * r, ct); \
}

Definition at line 152 of file oct-convn.cc.

#define FORWARD_IMPL (   T,
  R,
  f,
  F 
)
Value:
extern "C" \
F77_FUNC (f##conv2o, F##CONV2O) (const octave_idx_type&, \
const octave_idx_type&, \
const T*, const octave_idx_type&, \
const octave_idx_type&, const R*, T *); \
\
extern "C" \
F77_FUNC (f##conv2i, F##CONV2I) (const octave_idx_type&, \
const octave_idx_type&, \
const T*, const octave_idx_type&, \
const octave_idx_type&, const R*, T *); \
\
template <> void \
convolve_2d<T, R> (const T *a, octave_idx_type ma, octave_idx_type na, \
const R *b, octave_idx_type mb, octave_idx_type nb, \
T *c, bool inner) \
{ \
if (inner) \
F77_XFCN (f##conv2i, F##CONV2I, (ma, na, a, mb, nb, b, c)); \
F77_XFCN (f##conv2o, F##CONV2O, (ma, na, a, mb, nb, b, c)); \
}

Definition at line 43 of file oct-convn.cc.

Function Documentation

NDArray convn ( const NDArray a,
const NDArray b,
convn_type  ct 
)

Definition at line 170 of file oct-convn.cc.

Referenced by Fconv2(), Fconvn(), and install_conv2_fcns().

Matrix convn ( const Matrix a,
const Matrix b,
convn_type  ct 
)

Definition at line 170 of file oct-convn.cc.

Matrix convn ( const Matrix a,
const ColumnVector c,
const RowVector r,
convn_type  ct 
)

Definition at line 170 of file oct-convn.cc.

ComplexNDArray convn ( const ComplexNDArray a,
const NDArray b,
convn_type  ct 
)

Definition at line 171 of file oct-convn.cc.

ComplexMatrix convn ( const ComplexMatrix a,
const Matrix b,
convn_type  ct 
)

Definition at line 171 of file oct-convn.cc.

ComplexMatrix convn ( const ComplexMatrix a,
const ColumnVector c,
const RowVector r,
convn_type  ct 
)

Definition at line 171 of file oct-convn.cc.

ComplexNDArray convn ( const ComplexNDArray a,
const ComplexNDArray b,
convn_type  ct 
)

Definition at line 172 of file oct-convn.cc.

ComplexMatrix convn ( const ComplexMatrix a,
const ComplexMatrix b,
convn_type  ct 
)

Definition at line 172 of file oct-convn.cc.

ComplexMatrix convn ( const ComplexMatrix a,
const ComplexColumnVector c,
const ComplexRowVector r,
convn_type  ct 
)

Definition at line 172 of file oct-convn.cc.

FloatMatrix convn ( const FloatMatrix a,
const FloatMatrix b,
convn_type  ct 
)

Definition at line 173 of file oct-convn.cc.

FloatMatrix convn ( const FloatMatrix a,
const FloatColumnVector c,
const FloatRowVector r,
convn_type  ct 
)

Definition at line 173 of file oct-convn.cc.

FloatNDArray convn ( const FloatNDArray a,
const FloatNDArray b,
convn_type  ct 
)

Definition at line 173 of file oct-convn.cc.

FloatComplexNDArray convn ( const FloatComplexNDArray a,
const FloatNDArray b,
convn_type  ct 
)

Definition at line 174 of file oct-convn.cc.

FloatComplexMatrix convn ( const FloatComplexMatrix a,
const FloatMatrix b,
convn_type  ct 
)

Definition at line 174 of file oct-convn.cc.

FloatComplexMatrix convn ( const FloatComplexMatrix a,
const FloatColumnVector c,
const FloatRowVector r,
convn_type  ct 
)

Definition at line 174 of file oct-convn.cc.

FloatComplexNDArray convn ( const FloatComplexNDArray a,
const FloatComplexNDArray b,
convn_type  ct 
)

Definition at line 175 of file oct-convn.cc.

FloatComplexMatrix convn ( const FloatComplexMatrix a,
const FloatComplexMatrix b,
convn_type  ct 
)

Definition at line 175 of file oct-convn.cc.

FloatComplexMatrix convn ( const FloatComplexMatrix a,
const FloatComplexColumnVector c,
const FloatComplexRowVector r,
convn_type  ct 
)

Definition at line 175 of file oct-convn.cc.

template<class T , class R >
static MArray<T> convolve ( const MArray< T > &  a,
const MArray< R > &  b,
convn_type  ct 
)
static
template<class T , class R >
static void convolve_2d ( const T *  a,
octave_idx_type  ma,
octave_idx_type  na,
const R *  b,
octave_idx_type  mb,
octave_idx_type  nb,
T *  c,
bool  inner 
)
static

Definition at line 71 of file oct-convn.cc.

template<>
F77_RET_T const octave_idx_type const Complex const octave_idx_type const octave_idx_type const double Complex* C F77_RET_T const octave_idx_type const Complex const octave_idx_type const octave_idx_type const double Complex* void convolve_2d< Complex, double > ( const Complex a,
octave_idx_type  ma,
octave_idx_type  na,
const double b,
octave_idx_type  mb,
octave_idx_type  nb,
Complex c,
bool  inner 
)

Definition at line 73 of file oct-convn.cc.

template<>
F77_RET_T const octave_idx_type const double const octave_idx_type const octave_idx_type const double double* C F77_RET_T const octave_idx_type const double const octave_idx_type const octave_idx_type const double double* void convolve_2d< double, double > ( const double a,
octave_idx_type  ma,
octave_idx_type  na,
const double b,
octave_idx_type  mb,
octave_idx_type  nb,
double c,
bool  inner 
)

Definition at line 69 of file oct-convn.cc.

template<>
F77_RET_T const octave_idx_type const float const octave_idx_type const octave_idx_type const float float* C F77_RET_T const octave_idx_type const float const octave_idx_type const octave_idx_type const float float* void convolve_2d< float, float > ( const float a,
octave_idx_type  ma,
octave_idx_type  na,
const float b,
octave_idx_type  mb,
octave_idx_type  nb,
float c,
bool  inner 
)

Definition at line 70 of file oct-convn.cc.

Definition at line 74 of file oct-convn.cc.

Definition at line 72 of file oct-convn.cc.

template<class T , class R >
void convolve_nd ( const T *  a,
const dim_vector ad,
const dim_vector acd,
const R *  b,
const dim_vector bd,
const dim_vector bcd,
T *  c,
const dim_vector ccd,
int  nd,
bool  inner 
)

Definition at line 77 of file oct-convn.cc.

F77_RET_T F77_FUNC ( dconv2o  ,
DCONV2O   
) const
F77_RET_T const octave_idx_type const double const octave_idx_type const octave_idx_type const double double* C F77_RET_T F77_FUNC ( dconv2i  ,
DCONV2I   
) const
F77_RET_T F77_FUNC ( sconv2o  ,
SCONV2O   
) const
F77_RET_T const octave_idx_type const float const octave_idx_type const octave_idx_type const float float* C F77_RET_T F77_FUNC ( sconv2i  ,
SCONV2I   
) const
F77_RET_T F77_FUNC ( zconv2o  ,
ZCONV2O   
) const
F77_RET_T const octave_idx_type const Complex const octave_idx_type const octave_idx_type const Complex Complex* C F77_RET_T F77_FUNC ( zconv2i  ,
ZCONV2I   
) const
F77_RET_T F77_FUNC ( cconv2o  ,
CCONV2O   
) const
F77_RET_T const octave_idx_type const FloatComplex const octave_idx_type const octave_idx_type const FloatComplex FloatComplex* C F77_RET_T F77_FUNC ( cconv2i  ,
CCONV2I   
) const
F77_RET_T F77_FUNC ( zdconv2o  ,
ZDCONV2O   
) const
F77_RET_T const octave_idx_type const Complex const octave_idx_type const octave_idx_type const double Complex* C F77_RET_T F77_FUNC ( zdconv2i  ,
ZDCONV2I   
) const
F77_RET_T F77_FUNC ( csconv2o  ,
CSCONV2O   
) const
F77_RET_T const octave_idx_type const FloatComplex const octave_idx_type const octave_idx_type const float FloatComplex* C F77_RET_T F77_FUNC ( csconv2i  ,
CSCONV2I   
) const