本文整理汇总了C++中pruneTable函数的典型用法代码示例。如果您正苦于以下问题:C++ pruneTable函数的具体用法?C++ pruneTable怎么用?C++ pruneTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pruneTable函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pruneTable
CSSSegmentedFontFace::~CSSSegmentedFontFace()
{
pruneTable();
unsigned size = m_fontFaces.size();
for (unsigned i = 0; i < size; i++)
m_fontFaces[i]->removedFromSegmentedFontFace(this);
}
示例2: pruneTable
CSSSegmentedFontFace::~CSSSegmentedFontFace()
{
pruneTable();
unsigned size = m_fontFaces.size();
for (unsigned i = 0; i < size; i++)
m_fontFaces[i]->clearSegmentedFontFace();
}
示例3: buildDecisionTree
/*
* Recursively builds the decision tree based on
* the data that it is passed and tha table info.
*/
node* buildDecisionTree(vvs &table, node* nodePtr, vvs &tableInfo)
{
if (tableIsEmpty(table)) {
return NULL;
}
if (isHomogeneous(table)) {
nodePtr->isLeaf = true;
nodePtr->label = table[1][table[1].size()-1];
return nodePtr;
} else {
string splittingCol = decideSplittingColumn(table);
nodePtr->splitOn = splittingCol;
int colIndex = returnColumnIndex(splittingCol, tableInfo);
int iii;
for (iii = 1; iii < tableInfo[colIndex].size(); iii++) {
node* newNode = (node*) new node;
newNode->label = tableInfo[colIndex][iii];
nodePtr->childrenValues.push_back(tableInfo[colIndex][iii]);
newNode->isLeaf = false;
newNode->splitOn = splittingCol;
vvs auxTable = pruneTable(table, splittingCol, tableInfo[colIndex][iii]);
nodePtr->children.push_back(buildDecisionTree(auxTable, newNode, tableInfo));
}
}
return nodePtr;
}
示例4: pruneTable
void RemoteFontFaceSource::fontLoaded(FontResource*)
{
m_histograms.recordRemoteFont(m_font.get());
pruneTable();
if (m_face)
m_face->fontLoaded(this);
}
示例5: pruneTable
CSSSegmentedFontFace::~CSSSegmentedFontFace()
{
pruneTable();
#if !ENABLE(OILPAN)
for (const auto& fontFace : m_fontFaces)
fontFace->cssFontFace()->clearSegmentedFontFace();
#endif
}
示例6: pruneTable
CSSSegmentedFontFace::~CSSSegmentedFontFace()
{
pruneTable();
#if !ENABLE(OILPAN)
for (FontFaceList::iterator it = m_fontFaces.begin(); it != m_fontFaces.end(); ++it)
(*it)->cssFontFace()->clearSegmentedFontFace();
#endif
}
示例7: pruneTable
void CSSFontFaceSource::fontLoaded(FontResource*)
{
if (!m_fontDataTable.isEmpty())
m_histograms.recordRemoteFont(m_font.get());
pruneTable();
if (m_face)
m_face->fontLoaded(this);
}
示例8: decideSplittingColumn
/*
* Decides which column to split on
* based on entropy. Returns the column
* with the least entropy.
*/
string decideSplittingColumn(vvs &table)
{
int column, iii;
double minEntropy = DBL_MAX;
int splittingColumn = 0;
vi entropies;
#pragma omp parallel
{
#pragma omp for
for (column = 0; column < table[0].size() - 1; column++) {
string colName = table[0][column];
msi tempMap;
vi counts = countDistinct(table, column);
vd attributeEntropy;
double columnEntropy = 0.0;
for (iii = 1; iii < table.size() - 1; iii++) {
double entropy = 0.0;
if (tempMap.find(table[iii][column]) != tempMap.end()) { // IF ATTRIBUTE IS ALREADY FOUND IN A COLUMN, UPDATE IT'S FREQUENCY
tempMap[table[iii][column]]++;
}
else { // IF ATTRIBUTE IS FOUND FOR THE FIRST TIME IN A COLUMN, THEN PROCESS IT AND CALCULATE IT'S ENTROPY
tempMap[table[iii][column]] = 1;
vvs tempTable = pruneTable(table, colName, table[iii][column]);
vi classCounts = countDistinct(tempTable, tempTable[0].size() - 1);
int jjj, kkk;
for (jjj = 0; jjj < classCounts.size(); jjj++) {
double temp = (double)classCounts[jjj];
entropy -= (temp / classCounts[classCounts.size() - 1])*(log(temp / classCounts[classCounts.size() - 1]) / log(2));
}
attributeEntropy.push_back(entropy);
entropy = 0.0;
}
}
//for (iii = 0; iii < counts.size() - 1 && ((attributeEntropy.size() - 1) == (counts.size() - 1)); iii++) {
for (iii = 0; iii < counts.size() - 1; iii++) {
columnEntropy += ((double)counts[iii] * (double)attributeEntropy[iii]);
}
columnEntropy = columnEntropy / ((double)counts[counts.size() - 1]);
if (columnEntropy <= minEntropy) {
minEntropy = columnEntropy;
splittingColumn = column;
}
}
}
return table[0][splittingColumn];
}
示例9: pruneTable
void CSSSegmentedFontFace::fontLoaded(CSSFontFace*)
{
pruneTable();
#if ENABLE(FONT_LOAD_EVENTS)
if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && !isLoading()) {
Vector<RefPtr<LoadFontCallback>> callbacks;
m_callbacks.swap(callbacks);
for (size_t index = 0; index < callbacks.size(); ++index) {
if (checkFont())
callbacks[index]->notifyLoaded();
else
callbacks[index]->notifyError();
}
}
#endif
}
示例10: request
void RemoteFontFaceSource::corsFailed(FontResource*)
{
if (m_face) {
m_histograms.corsFailed();
Document* document = m_face->fontSelector() ? m_face->fontSelector()->document() : 0;
if (document) {
FetchRequest request(ResourceRequest(m_font->url()), FetchInitiatorTypeNames::css);
ResourcePtr<FontResource> newFontResource = document->fetcher()->fetchFont(request);
if (newFontResource) {
m_font->removeClient(this);
m_font = newFontResource;
m_font->addClient(this);
m_face->fontSelector()->beginLoadingFontSoon(m_font.get());
return;
} else {
pruneTable();
}
}
m_face->fontLoaded(this);
}
}
示例11: pruneTable
CSSSegmentedFontFace::~CSSSegmentedFontFace()
{
pruneTable();
for (FontFaceList::iterator it = m_fontFaces.begin(); it != m_fontFaces.end(); ++it)
(*it)->cssFontFace()->clearSegmentedFontFace();
}
示例12: pruneTable
void CSSFontFaceSource::fontLoaded(CachedFont*)
{
pruneTable();
if (m_face)
m_face->fontLoaded(this);
}
示例13: pruneTable
void CSSSegmentedFontFace::fontLoadWaitLimitExceeded(CSSFontFace*)
{
pruneTable();
}