46 lines
902 B
C
46 lines
902 B
C
#pragma once
|
|
#include <armadillo>
|
|
#include "lasp_types.h"
|
|
#include <cmath>
|
|
|
|
#if LASP_DOUBLE_PRECISION == 1
|
|
#define c_real creal
|
|
#define c_imag cimag
|
|
#define d_abs fabs
|
|
#define c_abs cabs
|
|
#define c_conj conj
|
|
#define d_atan2 atan2
|
|
#define d_acos acos
|
|
#define d_sqrt sqrt
|
|
#define c_exp cexp
|
|
#define d_sin sin
|
|
#define d_cos cos
|
|
#define d_pow pow
|
|
#define d_log10 log10
|
|
#define d_ln log
|
|
#define d_epsilon (DBL_EPSILON)
|
|
|
|
#else // LASP_DOUBLE_PRECISION not defined
|
|
#define c_conj conjf
|
|
#define c_real crealf
|
|
#define c_imag cimagf
|
|
#define d_abs fabsf
|
|
#define c_abs cabsf
|
|
#define d_atan2 atan2f
|
|
#define d_acos acosf
|
|
#define d_sqrt sqrtf
|
|
#define c_exp cexpf
|
|
#define d_sin sinf
|
|
#define d_cos cosf
|
|
#define d_pow powf
|
|
#define d_log10 log10f
|
|
#define d_ln logf
|
|
#define d_epsilon (FLT_EPSILON)
|
|
|
|
#endif // LASP_DOUBLE_PRECISION
|
|
|
|
using vd = arma::Col<d>;
|
|
using dmat = arma::Mat<d>;
|
|
|
|
const d number_pi = arma::datum::pi;
|