BotSharp/BotSharp.Algorithm/HiddenMarkovModel/MathUtils/SpecialFunctions/ClampFunction.cs

16 lines
382 B
C#
Raw Normal View History

2018-09-17 12:31:54 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BotSharp.Algorithm.HiddenMarkovModel.MathUtils.SpecialFunctions
{
public class ClampFunction
{
public static double Clamp(double value, double lower, double upper)
{
return System.Math.Min(upper, System.Math.Max(value, lower));
}
}
}