[192840]: src / lib / function / QFunction.cc  Maximize  Restore  History

Download this file

31 lines (23 with data), 670 Bytes

 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
#include <config.h>
#include <function/QFunction.h>
#include <distribution/RScalarDist.h>
using std::vector;
using std::string;
namespace jags {
QFunction::QFunction(RScalarDist const *dist)
: DPQFunction(string("q") + dist->name().substr(1), dist)
{}
double QFunction::evaluate(vector<double const *> const &args) const
{
double x = *args[0];
vector<double const *> param(args.size() - 1);
for (unsigned int i = 1; i < args.size(); ++i) {
param[i-1] = args[i];
}
return dist()->q(x, param, true, false);
}
bool QFunction::checkParameterValue(vector<double const*> const &args) const
{
return checkArgs(args);
}
}

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks