From e2969161ff6561fdd1c8b9f8f50c7f02b89f2c0e Mon Sep 17 00:00:00 2001 From: Christian daheim Date: Sat, 28 Jun 2014 13:10:37 +0200 Subject: [PATCH] Add log10 subcommand --- generic/vectcl.c | 10 ++++++++++ generic/vectclInt.h | 1 + 2 files changed, 11 insertions(+) diff --git a/generic/vectcl.c b/generic/vectcl.c index de5417e..f831b0a 100644 --- a/generic/vectcl.c +++ b/generic/vectcl.c @@ -229,6 +229,7 @@ static const EnsembleMap implementationMap[] = { {"tan", NumArrayTanCmd, NULL}, {"exp", NumArrayExpCmd, NULL}, {"log", NumArrayLogCmd, NULL}, + {"log10", NumArrayLog10Cmd, NULL}, {"sqrt", NumArraySqrtCmd, NULL}, {"sinh", NumArraySinhCmd, NULL}, {"cosh", NumArrayCoshCmd, NULL}, @@ -2340,6 +2341,15 @@ static inline double fsign(double x) { #define CPLXOP *result = NumArray_ComplexLog(op); #include "uniop.h" +#define CMD NumArrayLog10Cmd +#define INTRES double +#define DBLRES double +#define INTOP DBLOP +#define DBLOP *result = log10(op); +#define CPLXRES NumArray_Complex +#define CPLXOP *result = NumArray_ComplexLog(op); +#include "uniop.h" + #define CMD NumArraySqrtCmd #define INTRES double #define DBLRES double diff --git a/generic/vectclInt.h b/generic/vectclInt.h index 96aece0..bbf5a97 100644 --- a/generic/vectclInt.h +++ b/generic/vectclInt.h @@ -131,6 +131,7 @@ SUBCOMMAND(NumArrayCosCmd); SUBCOMMAND(NumArrayTanCmd); SUBCOMMAND(NumArrayExpCmd); SUBCOMMAND(NumArrayLogCmd); +SUBCOMMAND(NumArrayLog10Cmd); SUBCOMMAND(NumArraySqrtCmd); SUBCOMMAND(NumArraySinhCmd); SUBCOMMAND(NumArrayCoshCmd);