本文整理汇总了C++中Table函数的典型用法代码示例。如果您正苦于以下问题:C++ Table函数的具体用法?C++ Table怎么用?C++ Table使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Table函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FinishCell
void RichQtfParser::FinishTable()
{
FinishCell();
while(table.Top().cell % Table().GetColumns())
FinishCell();
tablepart = pick(Table());
istable = true;
table.Drop();
}
示例2: eval_Table
int eval_Table(long M, long N, int i, int j){
if ( _flag_Table(i,j) == 'N' ) {
_flag_Table(i,j) = 'I';
//Body for Table
Table(i,j) = (((j == 0 && i == 0))?__max_int(0,__max_int((c)+(similarity_function(seq_A(i),seq_B(j))),__max_int((A(i))+(eval_gap_penalty(M,N)),(B(j))+(eval_gap_penalty(M,N))))):(((i == 0 && j >= 1))?__max_int(0,__max_int((B(j-1))+(similarity_function(seq_A(i),seq_B(j))),__max_int((eval_Table(M,N,i,j-1))+(eval_gap_penalty(M,N)),(B(j))+(eval_gap_penalty(M,N))))):(((j == 0 && i >= 1))?__max_int(0,__max_int((A(i-1))+(similarity_function(seq_A(i),seq_B(j))),__max_int((A(i))+(eval_gap_penalty(M,N)),(eval_Table(M,N,i-1,j))+(eval_gap_penalty(M,N))))):(__max_int(0,__max_int((eval_Table(M,N,i-1,j-1))+(similarity_function(seq_A(i),seq_B(j))),__max_int((eval_Table(M,N,i,j-1))+(eval_gap_penalty(M,N)),(eval_Table(M,N,i-1,j))+(eval_gap_penalty(M,N)))))))));
_flag_Table(i,j) = 'F';
} else if ( _flag_Table(i,j) == 'I' ) {
printf("There is a self dependence on Table at (%d,%d) \n",i,j);
exit(-1);
}
return Table(i,j);
}
示例3: runtime_error
//everything in t1 that is not in t2
Table Database::set_difference(Table t1, Table t2){
if(!union_compatible(t1,t2)){
throw runtime_error("Error: Sets are incompatible\n");
return Table("NULL");
}
Table diff = Table(t1.get_name());
for (int i = 0; i < t1.get_records().size(); ++i)
{
if(!record_exists(t2,t1.get_records()[i]))
diff.add_record(t1.get_records()[i]);
}
diff.set_attributes(t1.get_attributes());
return diff;
}
示例4: HndResetAgeMap
/*
* HndResetAgeMap
*
* Service to forceably reset the age map for a set of handles.
*
* Provided for GC-time resetting the handle table's write barrier. This is not
* normally advisable, as it increases the amount of work that will be done in
* subsequent scans. Under some circumstances, however, this is precisely what is
* desired. Generally this entrypoint should only be used under some exceptional
* condition during garbage collection, like objects being demoted from a higher
* generation to a lower one.
*
*/
void HndResetAgeMap(HHANDLETABLE hTable, const UINT *types, UINT typeCount, UINT flags)
{
// fetch the table pointer
HandleTable *pTable = Table(hTable);
// set up parameters for scan callbacks
ScanCallbackInfo info;
info.uFlags = flags;
info.fEnumUserData = FALSE;
info.dwAgeMask = 0;
info.pCurrentSegment = NULL;
info.pfnScan = NULL;
info.param1 = 0;
info.param2 = 0;
// lock the table down
pTable->pLock->Enter();
// perform the scan
TableScanHandles(pTable, types, typeCount, QuickSegmentIterator, BlockResetAgeMapForBlocks, &info);
// unlock the table
pTable->pLock->Leave();
}
示例5: HndDestroyHandles
/*
* HndDestroyHandles
*
* Entrypoint for freeing handles in bulk.
*
*/
void HndDestroyHandles(HHANDLETABLE hTable, UINT uType, const OBJECTHANDLE *pHandles, UINT uCount)
{
// fetch the handle table pointer
HandleTable *pTable = Table(hTable);
// sanity check the type index
_ASSERTE(uType < pTable->uTypeCount);
// is this a small number of handles?
if (uCount <= SMALL_ALLOC_COUNT)
{
// yes - free them via the handle cache
TableFreeHandlesToCache(pTable, uType, pHandles, uCount);
return;
}
// acquire the handle manager lock
pTable->pLock->Enter();
// free the unsorted handles in bulk to the main handle table
TableFreeBulkUnpreparedHandles(pTable, uType, pHandles, uCount);
// update perf-counters: track number of handles
COUNTER_ONLY(GetGlobalPerfCounters().m_GC.cHandles -= uCount);
COUNTER_ONLY(GetPrivatePerfCounters().m_GC.cHandles -= uCount);
// release the handle manager lock
pTable->pLock->Leave();
}
示例6: HndGetHandleTableADIndex
/*
* HndGetHandleTableIndex
*
* Retrieves the AppDomain index associated with a handle table at creation
*/
UINT HndGetHandleTableADIndex(HHANDLETABLE hTable)
{
// fetch the handle table pointer
HandleTable *pTable = Table(hTable);
return pTable->uADIndex;
}
示例7: HndSetHandleTableIndex
/*
* HndGetHandleTableIndex
*
* Sets the index associated with a handle table at creation
*/
void HndSetHandleTableIndex(HHANDLETABLE hTable, UINT uTableIndex)
{
// fetch the handle table pointer
HandleTable *pTable = Table(hTable);
pTable->uTableIndex = uTableIndex;
}
示例8: HndDestroyHandleTable
/*
* HndDestroyHandleTable
*
* Cleans up and frees the specified handle table.
*
*/
void HndDestroyHandleTable(HHANDLETABLE hTable)
{
// fetch the handle table pointer
HandleTable *pTable = Table(hTable);
// We are going to free the memory for this HandleTable.
// Let us reset the copy in g_pHandleTableArray to NULL.
// Otherwise, GC will think this HandleTable is still available.
Ref_RemoveHandleTable (hTable);
// null out the lock pointer and release and free the lock
delete pTable->pLock;
pTable->pLock = NULL;
// fetch the segment list and null out the list pointer
TableSegment *pSegment = pTable->pSegmentList;
pTable->pSegmentList = NULL;
// walk the segment list, freeing the segments as we go
while (pSegment)
{
// fetch the next segment
TableSegment *pNextSegment = pSegment->pNextSegment;
// free the current one and advance to the next
SegmentFree(pSegment);
pSegment = pNextSegment;
}
// free the table's memory
HeapFree(g_hProcessHeap, 0, (HLOCAL)pTable);
}
示例9: Table
PyObject *lua_table(PyObject *self, PyObject *args) {
char *filename, *res, *table, *key;
if(!PyArg_ParseTuple(args, "sss", &filename, &table, &key)) return NULL;
res = Table(filename, table, key);
if(!res) res = "nil";
return Py_BuildValue("s", res);
}
示例10: Table
void backgroundEstimation::ImportMTTailCorrectionFromTemplateFitMethod()
{
Table SFR_table = Table("../MTtailCorrection/results/SF_MTtail.tab");
//Table SFR_table = Table("../MTtailCorrection/signalContamination/"+string(SIGNAL_CONTAMINATION_INPUT)+"/SF_MTtail.tab");
// Remove low/medium/highDM suffix in label for BDT's
string signalRegionLabel_ = signalRegionLabel;
if (findSubstring(signalRegionLabel_,"BDT"))
{
size_t pos;
pos = signalRegionLabel_.find("_low");
if (pos != string::npos) signalRegionLabel_ = signalRegionLabel_.substr(0,pos);
pos = signalRegionLabel_.find("_med");
if (pos != string::npos) signalRegionLabel_ = signalRegionLabel_.substr(0,pos);
pos = signalRegionLabel_.find("_high");
if (pos != string::npos) signalRegionLabel_ = signalRegionLabel_.substr(0,pos);
}
SF_MTtail_Wjets = SFR_table.Get("SFR_Wjets",signalRegionLabel_);
SF_MTtail_1ltop = SFR_table.Get("SFR_1ltop",signalRegionLabel_);
// Fix for signal contamination crazy values : we assume that SFR_1ltop is >= 1.
// We keep the same relative uncertainty
if (SF_MTtail_1ltop.value() < 1) { SF_MTtail_1ltop = Figure(1.0,SF_MTtail_1ltop.value() / SF_MTtail_1ltop.error()); }
if (SF_MTtail_Wjets_variation) SF_MTtail_Wjets.keepVariation(SF_MTtail_Wjets_variation,"noNegativeValue");
if (SF_MTtail_1ltop_variation) SF_MTtail_1ltop.keepVariation(SF_MTtail_1ltop_variation,"noNegativeValue");
}
示例11: Table
///
/// Property: entityName
/// Used for xmlGeneration
///
/// getter
QString RecordBase::EntityName()
{
if (_entityName.size() == 0)
_entityName = Table() + "RecordBase";
return _entityName;
}
示例12: main
int main()
{
int k;
input(&k);
int n = 1;
//n=2k(k>=1)个选手参加比赛
for (int i = 1; i <= k; i++)
n *= 2;
//根据n动态分配二维数组a
int **a = (int**)malloc((n + 1)*sizeof(int*));
for (int i = 0; i <= n; i++)
{
a[i] = (int*)malloc((n + 1)*sizeof(int));
}
Table(k, n, a);
printf("循环赛事日程表为:\n");
output(a, n);
//释放空间
for (int i = 0; i <= n; i++)
{
free(a[i]);
}
free(a);
return 0;
}
示例13: EndPart
void RichQtfParser::FinishCell()
{
EndPart();
RichTable& t = Table();
Tab& b = table.Top();
int i, j;
if(oldtab) {
i = b.rown.GetCount() - 1;
j = b.rown.Top();
b.rown.Top()++;
}
else {
i = b.cell / t.GetColumns();
j = b.cell % t.GetColumns();
}
t.SetPick(i, j, pick(b.text));
b.text.Clear();
t.SetFormat(i, j, b.format);
t.SetSpan(i, j, b.vspan, b.hspan);
if(oldtab && b.rown.GetCount() > 1 && j + 1 < b.rown[0])
b.format = t.GetFormat(0, j + 1);
else {
b.cell++;
b.vspan = 0;
b.hspan = oldtab;
}
b.format.keep = false;
b.format.round = false;
}
示例14: throw
Table Database::getTable(const std::string &tableName) throw (DbException)
{
uint32_t dbFlags = DB_CREATE | DB_AUTO_COMMIT;
Db *db = new Db(&m_env, 0);
db->open(NULL, tableName.c_str(), NULL, DB_BTREE, dbFlags, 0);
return Table(db);
}
示例15: Table
void Parser::parse_rating_final(Database& d)
{
vector<pair<string, Attribute>> TableDef;
pair<string, Attribute> p;
p.first = "userID";
p.second.setType("String");
TableDef.push_back(p);
p.first = "placeID";
p.second.setType("String");
TableDef.push_back(p);
p.first = "rating";
p.second.setType("Int");
TableDef.push_back(p);
p.first = "food_rating";
p.second.setType("Int");
TableDef.push_back(p);
p.first = "service_rating";
p.second.setType("Int");
TableDef.push_back(p);
Table t = Table(TableDef);
Table result = ReadFile("RCdata\\CorrectFormat\\rating_final.txt",t);
d.addTable(result,"ratings");
}