Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtschump committed Jan 24, 2025
2 parents 8d75645 + 1e63951 commit 726b606
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
21 changes: 17 additions & 4 deletions CImg.h
Original file line number Diff line number Diff line change
Expand Up @@ -21410,6 +21410,19 @@ namespace cimg_library {
return_comp = true;
_cimg_mp_return(pos);
}

if (!std::strncmp(ss,"isvar(",6)) { // Is existing variable?
_cimg_mp_op("Function 'isvar()'");
if (ss6==se1) _cimg_mp_return(0);
s1 = ss6; while (s1<se && (*s1!=')' || level[s1 - expr._data]!=clevel)) ++s1; // Closing parenthesis
if (*s1!=')') _cimg_mp_return(0);
variable_name.assign(s1 - ss6 + 1);
if (variable_name._width) std::memcpy(variable_name,ss6,variable_name.width() - 1);
variable_name.back() = 0;
get_variable_pos(variable_name,arg1,arg2);
if (arg1!=~0U || arg2!=~0U) _cimg_mp_return(1);
_cimg_mp_return(0);
}
}
break;

Expand Down Expand Up @@ -23278,7 +23291,7 @@ namespace cimg_library {
if (arg1==11) { _cimg_mp_scalar0(is_sth?mp_rand_int_m1_1:mp_rand_double_m1_1); }
} else if (!arg1) { _cimg_mp_scalar1(is_sth?mp_rand_int_0_N:mp_rand_double_0_N,arg2); }
_cimg_mp_scalar2(op,arg1,arg2);
} else { // Slower version (open set)
} else { // Slower version (potentially an open set)
op = is_sth?mp_rand_int_ext:mp_rand_double_ext;
if (is_vector(arg1) && is_vector(arg2))
_cimg_mp_vector4_vvss(op,arg1,arg2,arg3,arg4);
Expand Down Expand Up @@ -28938,8 +28951,8 @@ namespace cimg_library {
_M = _mp_arg(3);
if (_m>_M) cimg::swap(_m,_M);
const double
m = cimg::type<cimg_uint64>::cut(std::ceil(_m)),
M = cimg::type<cimg_uint64>::cut(std::floor(_M));
m = cimg::type<cimg_int64>::cut(std::ceil(_m)),
M = cimg::type<cimg_int64>::cut(std::floor(_M));
return (double)m + _mp_rand_int(mp,M - m);
}

Expand All @@ -28960,7 +28973,7 @@ namespace cimg_library {
return val<th?-1:val<2*th?0:1;
}

static double mp_rand_int_ext(_cimg_math_parser& mp) { // Integer version of mp_rand_u_ext
static double mp_rand_int_ext(_cimg_math_parser& mp) {
const bool
include_min = (bool)_mp_arg(4),
include_max = (bool)_mp_arg(5);
Expand Down
2 changes: 1 addition & 1 deletion html/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="header">
<a href="index.html"><img alt="Logo" src="img/logo_header.jpg" class="center_image" style="margin-top:1em;"/></a>
<h2 style="padding-bottom: 1em">
Latest stable version: <b><a href="http://cimg.eu/files/CImg_.zip">3.5.0</a></b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Current pre-release: <b><a href="http://cimg.eu/files/CImg_latest.zip">3.5.1</a></b> (2025/01/19)
Latest stable version: <b><a href="http://cimg.eu/files/CImg_.zip">3.5.0</a></b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Current pre-release: <b><a href="http://cimg.eu/files/CImg_latest.zip">3.5.1</a></b> (2025/01/22)
</h2>

<hr/>
Expand Down
2 changes: 1 addition & 1 deletion html/header_doxygen.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="header">
<a href="../index.html"><img alt="Logo" src="../img/logo_header.jpg" class="center_image" style="margin-top:1em;"/></a>
<h2 style="padding-bottom: 1em">
Latest stable version: <b><a href="http://cimg.eu/files/CImg_.zip">3.5.0</a></b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Current pre-release: <b><a href="http://cimg.eu/files/CImg_latest.zip">3.5.1</a></b> (2025/01/19)
Latest stable version: <b><a href="http://cimg.eu/files/CImg_.zip">3.5.0</a></b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Current pre-release: <b><a href="http://cimg.eu/files/CImg_latest.zip">3.5.1</a></b> (2025/01/22)
</h2>

<hr/>
Expand Down

0 comments on commit 726b606

Please sign in to comment.