treelite
Classes | Enumerations | Functions
semantic.h File Reference

Building blocks for semantic model of tree prediction code. More...

#include <treelite/tree.h>
#include <algorithm>
Include dependency graph for semantic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CodeBlock
 fundamental block in semantic model. All code blocks should inherit from this class. More...
 
class  TranslationUnit
 translation unit is abstraction of a source file More...
 
struct  SemanticModel
 semantic model consists of a header, function registry, and a list of translation units More...
 
struct  SemanticModel::FunctionEntry
 
class  PlainBlock
 plain code block containing one or more lines of code More...
 
class  FunctionBlock
 function block with a prototype and code body. Its prototype can optionally be registered with a function registry. More...
 
class  SequenceBlock
 sequence of one or more code blocks More...
 
class  Condition
 a conditional expression More...
 
class  IfElseBlock
 if-else statement with condition may store a branch hint (>50% or <50% likely) More...
 

Enumerations

enum  BranchHint : uint8_t { kNone = 0, kLikely = 1, kUnlikely = 2 }
 enum class to store branch annotation
 

Functions

std::string OpName (Operator op)
 get string representation of comparsion operator More...
 
bool CompareWithOp (tl_float lhs, Operator op, tl_float rhs)
 perform comparison between two float's using a comparsion operator The comparison will be in the form [lhs] [op] [rhs]. More...
 
std::ostream & operator<< (std::ostream &os, const SemanticModel::FunctionEntry &entry)
 

Detailed Description

Building blocks for semantic model of tree prediction code.

Copyright 2017 by Contributors

Author
Philip Cho

Definition in file semantic.h.

Function Documentation

bool treelite::semantic::CompareWithOp ( tl_float  lhs,
Operator  op,
tl_float  rhs 
)
inline

perform comparison between two float's using a comparsion operator The comparison will be in the form [lhs] [op] [rhs].

Parameters
lhsfloat on the left hand side
opcomparison operator
rhsfloat on the right hand side
Returns
whether [lhs] [op] [rhs] is true or not

Definition at line 47 of file semantic.h.

std::string treelite::semantic::OpName ( Operator  op)
inline

get string representation of comparsion operator

Parameters
opcomparison operator
Returns
string representation

Definition at line 28 of file semantic.h.