Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[4c0f6f]: src / modules / bugs / functions / IfElse.h Maximize Restore History

Download this file

IfElse.h    30 lines (24 with data), 545 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
#ifndef IF_ELSE_H_
#define IF_ELSE_H_
#include <function/ScalarFunction.h>
namespace bugs {
/**
* The ifelse function returns either a or b depending on whether the
* value of x is zero or not
*
* @short Conditional selection
* <pre>
* y <- ifelse(x,a,b)
* y = a if x != 0
* y = b if x == 0
* </pre>
*/
class IfElse : public ScalarFunction
{
public:
IfElse ();
double evaluate(std::vector<double const *> const &args) const;
bool isDiscreteValued(std::vector<bool> const &mask) const;
};
}
#endif /* IF_ELSE_H_ */