blob: 9cb91ab37b6739f674e8221a3082b44ec9195e6f (
plain)
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
34
35
36
37
38
|
//static const char* sccsid = "@(#)math_FunctionSample.cxx 3.2 95/01/10"; // Do not delete this line. Used by sccs.
//#ifndef DEB
#define No_Standard_RangeError
#define No_Standard_OutOfRange
#define No_Standard_DimensionError
//#endif
#include <math_FunctionSample.ixx>
#include <Standard_OutOfRange.hxx>
math_FunctionSample::math_FunctionSample (const Standard_Real A,
const Standard_Real B,
const Standard_Integer N):
a(A),b(B),n(N)
{
}
void math_FunctionSample::Bounds (Standard_Real& A, Standard_Real& B) const {
A=a;
B=b;
}
Standard_Integer math_FunctionSample::NbPoints () const {
return n;
}
Standard_Real math_FunctionSample::GetParameter (const Standard_Integer Index) const {
Standard_OutOfRange_Raise_if((Index <= 0)||(Index > n), " ");
return ((n-Index)*a+(Index-1)*b)/(n-1);
}
|