Skip to content
Snippets Groups Projects
Commit dbfa7fa3 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add constructor from Eigen::Vector2

parent 61269614
No related branches found
No related tags found
No related merge requests found
#pragma once
#include <Eigen/Core>
#include <random>
......@@ -30,6 +32,12 @@ namespace VirtualRobot
ClampedNormalDistribution(RealType min, RealType max, RealType t = 3) :
_distrib(.5 * (min + max), .5 / t * (max - min)), _min(min), _max(max)
{}
/// Construct a clamped normal distribution centered between bounds(0) and bounds(1)
/// with t * stddev being equal to the distance from center to bound.
ClampedNormalDistribution(const Eigen::Matrix<RealType, 2, 1>& bounds, RealType t = 3) :
ClampedNormalDistribution(bounds(0), bounds(1), t)
{}
/// Construct a clamped normal distribution with given parameters.
ClampedNormalDistribution(RealType mean, RealType stddev, RealType min, RealType max) :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment