GNU Octave  8.1.0
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 "CColVector.h"
#include "CMatrix.h"
#include "CNDArray.h"
#include "CRowVector.h"
#include "MArray.h"
#include "dColVector.h"
#include "dMatrix.h"
#include "dNDArray.h"
#include "dRowVector.h"
#include "f77-fcn.h"
#include "fCColVector.h"
#include "fCMatrix.h"
#include "fCNDArray.h"
#include "fCRowVector.h"
#include "fColVector.h"
#include "fMatrix.h"
#include "fNDArray.h"
#include "fRowVector.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

ComplexMatrix convn (const ComplexMatrix &a, const ColumnVector &c, const RowVector &r, convn_type ct)
 
ComplexMatrix convn (const ComplexMatrix &a, const ComplexColumnVector &c, const ComplexRowVector &r, convn_type ct)
 
ComplexMatrix convn (const ComplexMatrix &a, const ComplexMatrix &b, convn_type ct)
 
ComplexMatrix convn (const ComplexMatrix &a, const Matrix &b, convn_type ct)
 
ComplexNDArray convn (const ComplexNDArray &a, const ComplexNDArray &b, convn_type ct)
 
ComplexNDArray convn (const ComplexNDArray &a, const NDArray &b, convn_type ct)
 
FloatComplexMatrix convn (const FloatComplexMatrix &a, const FloatColumnVector &c, const FloatRowVector &r, convn_type ct)
 
FloatComplexMatrix convn (const FloatComplexMatrix &a, const FloatComplexColumnVector &c, const FloatComplexRowVector &r, convn_type ct)
 
FloatComplexMatrix convn (const FloatComplexMatrix &a, const FloatComplexMatrix &b, convn_type ct)
 
FloatComplexMatrix convn (const FloatComplexMatrix &a, const FloatMatrix &b, convn_type ct)
 
FloatComplexNDArray convn (const FloatComplexNDArray &a, const FloatComplexNDArray &b, convn_type ct)
 
FloatComplexNDArray convn (const FloatComplexNDArray &a, const FloatNDArray &b, convn_type ct)
 
FloatMatrix convn (const FloatMatrix &a, const FloatColumnVector &c, const FloatRowVector &r, convn_type ct)
 
FloatMatrix convn (const FloatMatrix &a, const FloatMatrix &b, convn_type ct)
 
FloatNDArray convn (const FloatNDArray &a, const FloatNDArray &b, convn_type ct)
 
Matrix convn (const Matrix &a, const ColumnVector &c, const RowVector &r, convn_type ct)
 
Matrix convn (const Matrix &a, const Matrix &b, convn_type ct)
 
NDArray convn (const NDArray &a, const NDArray &b, 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<>
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)
 
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 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 (dconv2o, DCONV2O)(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 F77_FUNC (sconv2o, SCONV2O)(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 &
 
C F77_RET_T F77_FUNC (zdconv2i, ZDCONV2I)(const F77_INT &
 
 FFFFFFFORWARD_IMPL (std::complex< float >, std::complex< float >, F77_CMPLX, F77_CMPLX, F77_CMPLX_ARG, F77_CONST_CMPLX_ARG, F77_CONST_CMPLX_ARG, c, C) extern "C" F77_RET_T F77_FUNC(zdconv2o
 
 FFFFFORWARD_IMPL (std::complex< float >, float, F77_CMPLX, F77_REAL, F77_CMPLX_ARG, F77_CONST_CMPLX_ARG,, cs, CS) template< typename T
 
 ZDCONV2O (const F77_INT &, const F77_INT &, const F77_DBLE_CMPLX *, const F77_INT &, const F77_INT &, const F77_DBLE *, F77_DBLE_CMPLX *)
 

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); \
}
Definition: dMatrix.h:42
T * r
Definition: mx-inlines.cc:773
static MArray< T > convolve(const MArray< T > &a, const MArray< R > &b, convn_type ct)
Definition: oct-convn.cc:151
NDArray convn(const NDArray &a, const NDArray &b, convn_type ct)
Definition: oct-convn.cc:217
convn_type
Definition: oct-convn.h:52

Definition at line 197 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,
 
)
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))); \
}
#define F77_XFCN(f, F, args)
Definition: f77-fcn.h:45
octave_f77_int_type F77_INT
Definition: f77-fcn.h:306
F77_RET_T const F77_DBLE const F77_DBLE * f
F77_RET_T F77_FUNC(dconv2o, DCONV2O)(const F77_INT &

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

Function Documentation

◆ convn() [1/18]

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

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

◆ convn() [2/18]

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

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

◆ convn() [3/18]

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

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

◆ convn() [4/18]

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

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

◆ convn() [5/18]

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

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

◆ convn() [6/18]

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

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

◆ convn() [7/18]

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

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

◆ convn() [8/18]

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

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

◆ convn() [9/18]

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

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

◆ convn() [10/18]

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

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

◆ convn() [11/18]

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

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

◆ convn() [12/18]

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

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

◆ convn() [13/18]

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

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

◆ convn() [14/18]

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

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

◆ convn() [15/18]

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

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

◆ convn() [16/18]

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

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

◆ convn() [17/18]

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

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

◆ convn() [18/18]

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

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

Referenced by Fconv2(), and Fconvn().

◆ convolve()

◆ 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 92 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 93 of file oct-convn.cc.

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

template<>
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 103 of file oct-convn.cc.

◆ convolve_nd()

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 107 of file oct-convn.cc.

◆ F77_FUNC() [1/7]

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() [2/7]

F77_RET_T F77_FUNC ( dconv2o  ,
DCONV2O   
) const &

◆ F77_FUNC() [3/7]

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() [4/7]

F77_RET_T F77_FUNC ( sconv2o  ,
SCONV2O   
) const &

◆ F77_FUNC() [5/7]

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/7]

F77_RET_T F77_FUNC ( zconv2o  ,
ZCONV2O   
) const &

◆ F77_FUNC() [7/7]

C F77_RET_T F77_FUNC ( zdconv2i  ,
ZDCONV2I   
) const &

◆ FFFFFFFORWARD_IMPL()

FFFFFFFORWARD_IMPL ( std::complex< float >  ,
std::complex< float >  ,
F77_CMPLX  ,
F77_CMPLX  ,
F77_CMPLX_ARG  ,
F77_CONST_CMPLX_ARG  ,
F77_CONST_CMPLX_ARG  ,
,
C   
)

◆ FFFFFORWARD_IMPL()

FFFFFORWARD_IMPL ( std::complex< float >  ,
float  ,
F77_CMPLX  ,
F77_REAL  ,
F77_CMPLX_ARG  ,
F77_CONST_CMPLX_ARG  ,
cs  ,
CS   
)

◆ ZDCONV2O()

ZDCONV2O ( const F77_INT ,
const F77_INT ,
const F77_DBLE_CMPLX ,
const F77_INT ,
const F77_INT ,
const F77_DBLE ,
F77_DBLE_CMPLX  
)