[081fbe]: src / modules / bugs / functions / InProd.cc  Maximize  Restore  History

Download this file

48 lines (38 with data), 954 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <config.h>
#include <util/logical.h>
#include "InProd.h"
#include "lapack.h"
using std::vector;
namespace bugs {
InProd::InProd () : VectorFunction ("inprod", 2)
{
}
void InProd::evaluate(double *x, vector<double const *> const &args,
vector<unsigned int> const &lengths) const
{
int one = 1, N = lengths[0];
*x = F77_DDOT(&N, args[0], &one, args[1], &one);
}
bool
InProd::checkParameterLength (vector<unsigned int> const &lengths) const
{
return (lengths[0] == lengths[1]);
}
bool InProd::isDiscreteValued(vector<bool> const &mask) const
{
return allTrue(mask);
}
bool
InProd::isScale(vector<bool> const &mask, vector<bool> const &fix) const
{
//Test for quadratic term
if (mask[0] && mask[1])
return false;
if (fix.empty()) {
return true;
}
else {
return (mask[0] || fix[0]) && (mask[1] || fix[1]);
}
}
}

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

Sign up for the SourceForge newsletter:





No, thanks