GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-convn.cc File Reference
#include <algorithm>
#include "Array.h"
#include "MArray.h"
#include "f77-fcn.h"
#include "oct-convn.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_CXX, R_CXX, T, R, T_CAST, T_CONST_CAST, R_CONST_CAST, 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 FloatColumnVector &c, const FloatRowVector &r, convn_type ct)
 
FloatNDArray convn (const FloatNDArray &a, const FloatNDArray &b, convn_type ct)
 
FloatMatrix convn (const FloatMatrix &a, const FloatMatrix &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<typename T , typename R >
static MArray< T > convolve (const MArray< T > &a, const MArray< R > &b, convn_type ct)
 
template<typename T , typename R >
static void convolve_2d (const T *a, F77_INT ma, F77_INT na, const R *b, F77_INT mb, F77_INT nb, T *c, bool inner)
 
template<>
F77_RET_T const F77_INT const F77_DBLE const F77_INT const F77_INT const F77_DBLE F77_DBLE *C F77_RET_T const F77_INT const F77_DBLE const F77_INT const F77_INT const F77_DBLE F77_DBLE *void convolve_2d< double, double > (const double *a, F77_INT ma, F77_INT na, const double *b, F77_INT mb, F77_INT nb, double *c, bool inner)
 
template<>
F77_RET_T const F77_INT const F77_REAL const F77_INT const F77_INT const F77_REAL F77_REAL *C F77_RET_T const F77_INT const F77_REAL const F77_INT const F77_INT const F77_REAL F77_REAL *void convolve_2d< float, float > (const float *a, F77_INT ma, F77_INT na, const float *b, F77_INT mb, F77_INT nb, float *c, bool inner)
 
template<>
F77_RET_T const F77_INT const F77_DBLE_CMPLX const F77_INT const F77_INT const F77_DBLE F77_DBLE_CMPLX *C F77_RET_T const F77_INT const F77_DBLE_CMPLX const F77_INT const F77_INT const F77_DBLE F77_DBLE_CMPLX *void convolve_2d< std::complex< double >, double > (const std::complex< double > *a, F77_INT ma, F77_INT na, const double *b, F77_INT mb, F77_INT nb, std::complex< double > *c, bool inner)
 
template<>
F77_RET_T const F77_INT const F77_CMPLX const F77_INT const F77_INT const F77_REAL F77_CMPLX *C F77_RET_T const F77_INT const F77_CMPLX const F77_INT const F77_INT const F77_REAL F77_CMPLX *void convolve_2d< std::complex< float >, float > (const std::complex< float > *a, F77_INT ma, F77_INT na, const float *b, F77_INT mb, F77_INT nb, std::complex< float > *c, bool inner)
 
template<typename T , typename 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 F77_INT &
 
F77_RET_T const F77_INT const F77_DBLE const F77_INT const F77_INT const F77_DBLE F77_DBLE *C F77_RET_T F77_FUNC (dconv2i, DCONV2I)(const F77_INT &
 
F77_RET_T F77_FUNC (sconv2o, SCONV2O)(const F77_INT &
 
F77_RET_T const F77_INT const F77_REAL const F77_INT const F77_INT const F77_REAL F77_REAL *C F77_RET_T F77_FUNC (sconv2i, SCONV2I)(const F77_INT &
 
F77_RET_T const F77_INT const F77_DBLE_CMPLX const F77_INT const F77_INT const F77_DBLE_CMPLX F77_DBLE_CMPLX *C F77_RET_T F77_FUNC (zconv2i, ZCONV2I)(const F77_INT &
 
F77_RET_T F77_FUNC (zconv2o, ZCONV2O)(const F77_INT &
 
F77_RET_T const F77_INT const F77_CMPLX const F77_INT const F77_INT const F77_CMPLX F77_CMPLX *C F77_RET_T F77_FUNC (cconv2i, CCONV2I)(const F77_INT &
 
F77_RET_T F77_FUNC (cconv2o, CCONV2O)(const F77_INT &
 
F77_RET_T const F77_INT const F77_DBLE_CMPLX const F77_INT const F77_INT const F77_DBLE F77_DBLE_CMPLX *C F77_RET_T F77_FUNC (zdconv2i, ZDCONV2I)(const F77_INT &
 
F77_RET_T F77_FUNC (zdconv2o, ZDCONV2O)(const F77_INT &
 
F77_RET_T const F77_INT const F77_CMPLX const F77_INT const F77_INT const F77_REAL F77_CMPLX *C F77_RET_T F77_FUNC (csconv2i, CSCONV2I)(const F77_INT &
 
F77_RET_T F77_FUNC (csconv2o, CSCONV2O)(const F77_INT &
 

Macro Definition Documentation

◆ CONV_DEFS

#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); \
}
static MArray< T > convolve(const MArray< T > &a, const MArray< R > &b, convn_type ct)
Definition: oct-convn.cc:126
convn_type
Definition: oct-convn.h:46
NDArray convn(const NDArray &a, const NDArray &b, convn_type ct)
Definition: oct-convn.cc:192
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
Definition: file-io.cc:587
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:400
Definition: dMatrix.h:36
b
Definition: cellfun.cc:400

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

◆ FORWARD_IMPL

#define FORWARD_IMPL (   T_CXX,
  R_CXX,
  T,
  R,
  T_CAST,
  T_CONST_CAST,
  R_CONST_CAST,
  f,
  F 
)
Value:
extern "C" \
F77_FUNC (f##conv2o, F##CONV2O) (const F77_INT&, const F77_INT&, \
const T*, const F77_INT&, \
const F77_INT&, const R*, T *); \
\
extern "C" \
F77_FUNC (f##conv2i, F##CONV2I) (const F77_INT&, const F77_INT&, \
const T*, const F77_INT&, \
const F77_INT&, const R*, T *); \
\
template <> void \
convolve_2d<T_CXX, R_CXX> (const T_CXX *a, F77_INT ma, F77_INT na, \
const R_CXX *b, F77_INT mb, F77_INT nb, \
T_CXX *c, bool inner) \
{ \
if (inner) \
F77_XFCN (f##conv2i, F##CONV2I, (ma, na, T_CONST_CAST (a), \
mb, nb, R_CONST_CAST (b), \
T_CAST (c))); \
F77_XFCN (f##conv2o, F##CONV2O, (ma, na, T_CONST_CAST (a), \
mb, nb, R_CONST_CAST (b), \
T_CAST (c))); \
}
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 const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE * f
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
Definition: file-io.cc:587
#define F77_XFCN(f, F, args)
Definition: f77-fcn.h:41
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:400
octave_f77_int_type F77_INT
Definition: f77-fcn.h:305
b
Definition: cellfun.cc:400
F77_RET_T F77_FUNC(dconv2o, DCONV2O)(const F77_INT &
void F(const TSRC *v, TRES *r, octave_idx_type m, octave_idx_type n)
Definition: mx-inlines.cc:756

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

Function Documentation

◆ convn() [1/18]

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

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

Referenced by Fconv2().

◆ convn() [2/18]

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

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

◆ convn() [3/18]

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

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

◆ convn() [4/18]

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

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

◆ convn() [5/18]

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

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

◆ convn() [6/18]

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

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

◆ convn() [7/18]

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

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

◆ convn() [8/18]

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

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

◆ convn() [9/18]

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

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

◆ convn() [10/18]

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

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

◆ convn() [11/18]

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

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

◆ convn() [12/18]

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

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

◆ convn() [13/18]

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

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

◆ convn() [14/18]

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

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

◆ convn() [15/18]

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

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

◆ convn() [16/18]

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

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

◆ convn() [17/18]

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

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

◆ convn() [18/18]

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

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

◆ convolve()

template<typename T , typename R >
static MArray<T> convolve ( const MArray< T > &  a,
const MArray< R > &  b,
convn_type  ct 
)
static

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

◆ convolve_2d()

template<typename T , typename R >
static void convolve_2d ( const T *  a,
F77_INT  ma,
F77_INT  na,
const R *  b,
F77_INT  mb,
F77_INT  nb,
T *  c,
bool  inner 
)
static

◆ convolve_2d< double, double >()

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

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

◆ convolve_2d< float, float >()

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

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

◆ convolve_2d< std::complex< double >, double >()

template<>
F77_RET_T const F77_INT const F77_DBLE_CMPLX const F77_INT const F77_INT const F77_DBLE F77_DBLE_CMPLX* C F77_RET_T const F77_INT const F77_DBLE_CMPLX const F77_INT const F77_INT const F77_DBLE F77_DBLE_CMPLX* void convolve_2d< std::complex< double >, double > ( const std::complex< double > *  a,
F77_INT  ma,
F77_INT  na,
const double b,
F77_INT  mb,
F77_INT  nb,
std::complex< double > *  c,
bool  inner 
)

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

◆ convolve_2d< std::complex< float >, float >()

template<>
F77_RET_T const F77_INT const F77_CMPLX const F77_INT const F77_INT const F77_REAL F77_CMPLX* C F77_RET_T const F77_INT const F77_CMPLX const F77_INT const F77_INT const F77_REAL F77_CMPLX* void convolve_2d< std::complex< float >, float > ( const std::complex< float > *  a,
F77_INT  ma,
F77_INT  na,
const float b,
F77_INT  mb,
F77_INT  nb,
std::complex< float > *  c,
bool  inner 
)

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

◆ convolve_nd()

template<typename T , typename 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 82 of file oct-convn.cc.

References a, b, and c.

◆ F77_FUNC() [1/12]

F77_RET_T F77_FUNC ( dconv2o  ,
DCONV2O   
) const &

◆ F77_FUNC() [2/12]

F77_RET_T const F77_INT const F77_DBLE const F77_INT const F77_INT const F77_DBLE F77_DBLE* C F77_RET_T F77_FUNC ( dconv2i  ,
DCONV2I   
) const &

◆ F77_FUNC() [3/12]

F77_RET_T F77_FUNC ( sconv2o  ,
SCONV2O   
) const &

◆ F77_FUNC() [4/12]

F77_RET_T const F77_INT const F77_REAL const F77_INT const F77_INT const F77_REAL F77_REAL* C F77_RET_T F77_FUNC ( sconv2i  ,
SCONV2I   
) const &

◆ F77_FUNC() [5/12]

F77_RET_T const F77_INT const F77_DBLE_CMPLX const F77_INT const F77_INT const F77_DBLE_CMPLX F77_DBLE_CMPLX* C F77_RET_T F77_FUNC ( zconv2i  ,
ZCONV2I   
) const &

◆ F77_FUNC() [6/12]

F77_RET_T F77_FUNC ( zconv2o  ,
ZCONV2O   
) const &

◆ F77_FUNC() [7/12]

F77_RET_T const F77_INT const F77_CMPLX const F77_INT const F77_INT const F77_CMPLX F77_CMPLX* C F77_RET_T F77_FUNC ( cconv2i  ,
CCONV2I   
) const &

◆ F77_FUNC() [8/12]

F77_RET_T F77_FUNC ( cconv2o  ,
CCONV2O   
) const &

◆ F77_FUNC() [9/12]

F77_RET_T const F77_INT const F77_DBLE_CMPLX const F77_INT const F77_INT const F77_DBLE F77_DBLE_CMPLX* C F77_RET_T F77_FUNC ( zdconv2i  ,
ZDCONV2I   
) const &

◆ F77_FUNC() [10/12]

F77_RET_T F77_FUNC ( zdconv2o  ,
ZDCONV2O   
) const &

◆ F77_FUNC() [11/12]

F77_RET_T const F77_INT const F77_CMPLX const F77_INT const F77_INT const F77_REAL F77_CMPLX* C F77_RET_T F77_FUNC ( csconv2i  ,
CSCONV2I   
) const &

◆ F77_FUNC() [12/12]

F77_RET_T F77_FUNC ( csconv2o  ,
CSCONV2O   
) const &