📄 transition.cpp
字号:
/***
*** See the file "mba/disclaimers-and-notices-L2.txt" for
*** information on usage and redistribution of this file,
*** and for a DISCLAIMER OF ALL WARRANTIES.
***/
/* $Id: transition.cpp,v 1.1.1.1 2006/10/09 06:58:18 shao Exp $ */
#include <readers/transition.h>
/**
* The rank is ignored for a nominal Transition
*/
// If copy, allocate new memory for the array of L2rClause objects
L2rTransition::L2rTransition(const L2rVariable *mode,
int fromStateIndex,
int toStateIndex,
size_t clauseCount,
const L2rClause * const *clauses,
bool copyClauses,
bool isNominal,
unsigned rank) :
nclauses_(clauseCount), mode_(mode), from_(fromStateIndex),
to_(toStateIndex), rank_(rank), isNominal_(isNominal)
{
if (copyClauses) {
const L2rClause **ccopy =
L2_alloc_array_no_ctor(const L2rClause*, clauseCount);
for (unsigned i = 0; i < clauseCount; i++) {
assert(i < clauseCount);
ccopy[i] = clauses[i];
}
clauses_ = ccopy;
} else {
clauses_ = clauses;
}
}
// Deletethe array of L2rClause objects
L2rTransition::~L2rTransition()
{
// cast away a const
L2_free_array_no_dtor(const_cast<const L2rClause**>(clauses_), nclauses());
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -