Blame view

build4/epsilon-master/apps/probability/law/two_parameter_law.cpp 637 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  #include "two_parameter_law.h"
  #include <assert.h>
  
  namespace Probability {
  
  TwoParameterLaw::TwoParameterLaw(float parameterValue1, float parameterValue2) :
    m_parameter1(parameterValue1),
    m_parameter2(parameterValue2)
  {
  }
  
  int TwoParameterLaw::numberOfParameter() {
    return 2;
  }
  
  float TwoParameterLaw::parameterValueAtIndex(int index) {
    assert(index >= 0 && index < 2);
    if (index == 0) {
      return m_parameter1;
    }
    return m_parameter2;
  }
  
  void TwoParameterLaw::setParameterAtIndex(float f, int index) {
    assert(index >= 0 && index < 2);
    if (index == 0) {
      m_parameter1 = f;
    } else {
      m_parameter2 = f;
    }
  }
  
  }