Min function accepting varying number of arguments in C++17

Come across this problem once again in the book The Modern C++ Challenge (problem 18). Wonder how simple and elegant the implementation could be using C++17. Following is my solution. Ideas? ^_^

#include <algorithm>  template <typename Less, typename T, typename... Ts> constexpr const T& min(Less less, const T& a, const T& b, const Ts&... rems) {   if constexpr (sizeof...(rems)) {     return min(less, std::min(a, b, less), rems...);   }   else {     return std::min(a, b, less);   } } 

Relation between time varying transfer function and autocorrleation function

Ma task: find E{Y(t)}, where Y(t) output of the system, in terms time varying transfer function H(f,t) Is not complicated to find expected value of the output in terms impulse response function.

But it is problem to find in terms H(f,t), becouse expected value if input, and auto correlation function of the input are given only. And i know that it is WSS random process.

maybe someone know, is there a relation between expected value and ACF?

yield new waitforsecond(1) counter time varying after ludo dice roll

in ludo 2d game I am using player turn timer 30 sec by using yield new waitforsecond(1) whenever timer goes to 0 and player don’t roll dice then dice will move to next player my problem is in starting timer work perfectly player chances skip if they don’t roll dice and timer work totally perfect for all 4 players until they roll dice but when dice roll I mean rolling animation start after timer start varying very fast whenever dice rolling and tits look like waitforsecond(1) depend on dice rolling and after some dice rolling time goes to 0 from 30 in few second and I want in 30 sec timer goes from 30 to 0.

here I have changed code two times

first with waitforsecond(1)

float currCountdownValue; public IEnumerator StartCountdown(float countdownValue = 30) { currCountdownValue = countdownValue; while (currCountdownValue > 0) { Debug.Log("Countdown: " + currCountdownValue); yield return new WaitForSeconds(1.0f); currCountdownValue--; }     if(!isdicerolled){     if(playerTurn == "RED"){ playerTurn = "BLUE";     InitializeDice();    }    else if(playerTurn == "BLUE"){     playerTurn = "GREEN";     InitializeDice();    }    else if(playerTurn == "GREEN"){     playerTurn = "YELLOW";     InitializeDice();    }   Ielse if(playerTurn == "YELLOW"){     playerTurn = "RED";     InitializeDice();    }    }   } 

and the second time I was using time.deltatime but it also giving me the same output

so what should I do now I want timer like teen Patti game, poker everything work but after rolling dice time is varying pls help me

3D Plot the result of local Minimize with varying parameter values

I’m faced with the following minimization problem: Find $ r\in[0,1]$ that minimizes $ \frac{d^2+k^2 (1-2r)r}{2(1-r)r}$ where each of $ d$ and $ k$ is bounded by zero and some positive real number, say, $ d\in[0,2]$ and $ k\in[0,0.5]$ .

I’m in need of help to 3D plot the value of $ r$ against $ d$ and $ k$ .

Here is what I tried:

Plot3D[NMinimize[{-((d^2 + k^2 (1 - 2 r) r)/(2 (-1 + r) r)), 0 <= d <= 2, 0 <= k <= 0.5, 0 <= r <= 1}, r], {d, 0, 2}, {k, 0, 0.5}]