mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
24 lines
455 B
C++
24 lines
455 B
C++
#include "two_parameter_distribution.h"
|
|
#include <assert.h>
|
|
|
|
namespace Probability {
|
|
|
|
float TwoParameterDistribution::parameterValueAtIndex(int index) {
|
|
assert(index >= 0 && index < 2);
|
|
if (index == 0) {
|
|
return m_parameter1;
|
|
}
|
|
return m_parameter2;
|
|
}
|
|
|
|
void TwoParameterDistribution::setParameterAtIndex(float f, int index) {
|
|
assert(index >= 0 && index < 2);
|
|
if (index == 0) {
|
|
m_parameter1 = f;
|
|
} else {
|
|
m_parameter2 = f;
|
|
}
|
|
}
|
|
|
|
}
|