Skip to content

Commit

Permalink
enable strings and be conformant to documentation. see also #1992 (#1995
Browse files Browse the repository at this point in the history
)

Co-authored-by: Giloo <gildas@localhost>
  • Loading branch information
GillesDuvert and Giloo authored Feb 16, 2025
1 parent 305a97f commit 25532a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/value_locate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ namespace lib {
BaseGDL* p0 = e->GetParDefined(0);
BaseGDL* p1 = e->GetParDefined(1);

if (!NumericType(p0->Type())) e->Throw(p0->TypeStr() + " expression not allowed in this context:" + e->GetParString(0));
if (!ConvertableType(p0->Type())) e->Throw(p0->TypeStr() + " expression not allowed in this context:" + e->GetParString(0));
if (ComplexType(p0->Type())) e->Throw(p0->TypeStr() + " expression not allowed in this context:" + e->GetParString(0));
SizeT nEl = p0->N_Elements();
SizeT nEl1 = p1->N_Elements();
Expand Down Expand Up @@ -125,7 +125,9 @@ namespace lib {
VALUE_LOCATE_HELPER64(DFloatGDL, DFloat)
case GDL_DOUBLE:
VALUE_LOCATE_HELPER64(DDoubleGDL, DDouble)
default:
case GDL_STRING:
VALUE_LOCATE_HELPER64(DStringGDL, DString)
default:
assert(false);
return NULL; //pacify
}
Expand All @@ -152,6 +154,8 @@ namespace lib {
VALUE_LOCATE_HELPER_MULTI64(DFloatGDL, DFloat)
case GDL_DOUBLE:
VALUE_LOCATE_HELPER_MULTI64(DDoubleGDL, DDouble)
case GDL_STRING:
VALUE_LOCATE_HELPER_MULTI64(DStringGDL, DString)
default:
assert(false);
return NULL; //pacify
Expand Down Expand Up @@ -179,6 +183,8 @@ namespace lib {
VALUE_LOCATE_HELPER(DFloatGDL, DFloat)
case GDL_DOUBLE:
VALUE_LOCATE_HELPER(DDoubleGDL, DDouble)
case GDL_STRING:
VALUE_LOCATE_HELPER(DStringGDL, DString)
default:
assert(false);
return NULL; //pacify
Expand Down Expand Up @@ -206,6 +212,8 @@ namespace lib {
VALUE_LOCATE_HELPER_MULTI(DFloatGDL, DFloat)
case GDL_DOUBLE:
VALUE_LOCATE_HELPER_MULTI(DDoubleGDL, DDouble)
case GDL_STRING:
VALUE_LOCATE_HELPER_MULTI(DStringGDL, DString)
default:
assert(false);
return NULL; //pacify
Expand Down
4 changes: 2 additions & 2 deletions testsuite/test_tic_toc.pro
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ print, 'Total Time elapsed : ', val_cumul, ' seconds.'
;
errors=0
;
; We accepte a tolerance of 0.001 on the variance of measurements.
tolerance=0.001
; We accepte a tolerance of 0.5 on the variance of measurements.
tolerance=0.5
;
m=moment(val_times)
precision=m[1]/m[0]
Expand Down

0 comments on commit 25532a7

Please sign in to comment.