void TransfersContentsWidget::addTransfer(Transfer *transfer)
{
	QList<QStandardItem*> items;
	QStandardItem *item = new QStandardItem();
	item->setData(qVariantFromValue(static_cast<void*>(transfer)), Qt::UserRole);
	item->setFlags(item->flags() | Qt::ItemNeverHasChildren);

	items.append(item);

	item = new QStandardItem(QFileInfo(transfer->getTarget()).fileName());
	item->setFlags(item->flags() | Qt::ItemNeverHasChildren);

	items.append(item);

	for (int i = 2; i < m_model->columnCount(); ++i)
	{
		item = new QStandardItem();
		item->setFlags(item->flags() | Qt::ItemNeverHasChildren);

		items.append(item);
	}

	m_model->appendRow(items);

	if (transfer->getState() == Transfer::RunningState)
	{
		m_speeds[transfer] = QQueue<qint64>();
	}

	updateTransfer(transfer);
}
bool HMMSoftAutomaton::iterateTrain() {
    int idx, idy;
    initIterate();

    // 对所有的template做迭代
    for(idx = 0; idx < templates->size(); idx++) {
        calcAlphaBeta((*templates)[idx]);

        // 1. 根据alpha 和 beta的缓存更新template的feature在各个状态的分布
        updateTemplateNode(idx);

        // 2. 更新计算s->sNxt , 累加而已
        updateTemplateTransfer(idx);
    }

    bool bigChange = updateTransfer();

    /*  
    for(int i = 1;i <= stateNum; i++) {
        for(int j = 1;j <= stateNum; j++) {
            printf("%lf ", transferCost[i][j]);
        }
        puts("");
    }
*/
    for(idx = 1; idx <= stateNum; idx++) {
        getState(idx)->gaussianTrain(gaussNum);
    }
    return bigChange;
}
void TransfersContentsWidget::addTransfer(TransferInformation *transfer)
{
	if (!transfer || transfer->isHidden)
	{
		return;
	}

	QList<QStandardItem*> items;
	QStandardItem *item = new QStandardItem();
	item->setData(qVariantFromValue((void*) transfer), Qt::UserRole);

	items.append(item);

	item = new QStandardItem(QFileInfo(transfer->target).fileName());

	items.append(item);

	for (int i = 2; i < m_model->columnCount(); ++i)
	{
		items.append(new QStandardItem());
	}

	m_model->appendRow(items);

	if (transfer->state == RunningTransfer)
	{
		m_speeds[transfer] = QQueue<qint64>();
	}

	updateTransfer(transfer);
}
void KisBrightnessContrastFilterConfiguration::setCurve(const KisCubicCurve &curve)
{
    m_curve = curve;
    updateTransfer();
}