本文整理汇总了C++中KstMatrixPtr::minValueNoSpike方法的典型用法代码示例。如果您正苦于以下问题:C++ KstMatrixPtr::minValueNoSpike方法的具体用法?C++ KstMatrixPtr::minValueNoSpike怎么用?C++ KstMatrixPtr::minValueNoSpike使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KstMatrixPtr
的用法示例。
在下文中一共展示了KstMatrixPtr::minValueNoSpike方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calcSmartThreshold
// This should use a smart (percentile based) algorithm to
// calculate the thresholds. It will be expensive.
void KstImageDialogI::calcSmartThreshold() {
//make sure an matrix is selected
if (!_w->_matrix->selectedMatrix().isEmpty()){
KST::matrixList.lock().readLock();
KstMatrixPtr matrix = *KST::matrixList.findTag(_w->_matrix->selectedMatrix());
KST::matrixList.lock().unlock();
if (matrix) {
matrix->readLock();
double per = _w->_smartThresholdValue->value()/100.0;
matrix->calcNoSpikeRange(per);
_w->_lowerZ->setText(QString::number(matrix->minValueNoSpike()));
_w->_upperZ->setText(QString::number(matrix->maxValueNoSpike()));
matrix->unlock();
}
}
}
示例2: doTests
//.........这里部分代码省略.........
doTest(!m2->setValue(1, 1, 5.0));
doTest(m2->value(1, 1) != 5.0);
doTest(m2->setValueRaw(2, 2, 6.0)); //fails
KstMatrixPtr um1 = new KstMatrix(KstObjectTag("Unity"), 0L, 3, 3, 0, 0, 1, 1);
um1->setEditable(true);
um1->zero();
doTest(!um1->setValue(0, 0, 1.0));
doTest(!um1->setValue(1, 1, 1.0));
doTest(!um1->setValue(2, 2, 1.0));
doTest(um1->resize(3, 3, false));
um1->zero();
doTest(um1->setValue(0, 0, 1.0));
doTest(um1->setValue(1, 1, 1.0));
doTest(um1->setValue(2, 2, 1.0));
// calling resize on a matrix does not retain the correct values
// for matrix entries. i.e. taking a 3x3 matrix and resizing
// to a 2x2 matrix does not mean matrix[0][0], matrix[0][1],
// matrix[1][0], matrix[1][1] are the same before and after the resize.
// The resulting values should properly be undefined...
doTest(um1->resize(2, 2, true));
doTest(um1->sampleCount() == 4);
doTest(um1->value(0, 0, &ok) == 1.0);
doTest(ok);
doTest(um1->value(0, 1, &ok) == 0);
doTest(ok);
doTest(um1->value(0, 2, &ok) == 0);
doTest(!ok);
doTest(um1->value(1, 0, &ok) == 0);
doTest(ok);
doTest(um1->value(1, 1, &ok) == 0);
doTest(ok);
doTest(um1->value(1, 2, &ok) == 0);
doTest(!ok);
doTest(um1->resize(4, 4, false));
doTest(um1->value(0, 0, &ok) == 1.0);
doTest(ok);
doTest(um1->value(0, 1, &ok) == 0);
doTest(ok);
doTest(um1->value(0, 2, &ok) == 0);
doTest(ok);
doTest(um1->value(1, 0, &ok) == 0);
doTest(ok);
doTest(um1->value(1, 1, &ok) == 0);
doTest(ok);
doTest(um1->value(1, 2, &ok) == 0);
doTest(ok);
doTest(um1->resize(3, 3, true));
doTest(um1->setValue(0, 0, 1.716299));
doTest(um1->setValue(0, 1, -0.485527));
doTest(um1->setValue(0, 2, -0.288690));
doTest(um1->setValue(1, 0, 1.716299));
doTest(um1->setValue(1, 1, NAN));
doTest(um1->setValue(1, 2, -0.274957));
doTest(um1->setValue(2, 0, 1.711721));
doTest(um1->setValue(2, 1, -0.485527));
doTest(um1->setValue(2, 2, -0.293267));
doTest(um1->value(0, 0) == 1.716299);
doTest(um1->value(0, 1) == -0.485527);
doTest(um1->value(0, 2) == -0.288690);
doTest(um1->value(1, 0) == 1.716299);
doTest(um1->value(1, 1) == 0);
doTest(um1->value(1, 2) == -0.274957);
doTest(um1->value(2, 0) == 1.711721);
doTest(um1->value(2, 1) == -0.485527);
doTest(um1->value(2, 2) == -0.293267);
doTest(um1->minValue() == 0);
doTest(um1->maxValue() == 0);
KstMatrixPtr sm = new KstMatrix(KstObjectTag("Spike"), 0L, 2, 2, 0, 0, 1, 1);
sm->setEditable(true);
doTest(sm->resize(2, 2, false));
doTest(sm->xNumSteps() == 2);
doTest(sm->yNumSteps() == 2);
doTest(sm->setValueRaw(0, 0, 0.0));
doTest(sm->setValueRaw(0, 1, 0.1));
doTest(sm->setValueRaw(1, 0, 1.0));
doTest(sm->setValueRaw(1, 1, 1.1));
sm->calcNoSpikeRange(0);
doTest(sm->minValueNoSpike() == 0.0);
doTest(sm->maxValueNoSpike() == 0.0);
sm->calcNoSpikeRange(-100);
doTest(sm->minValueNoSpike() == 0.0);
doTest(sm->maxValueNoSpike() == 0.0);
sm->calcNoSpikeRange(0.9);
doTest(sm->minValueNoSpike() >= 1E+300 );
doTest(sm->maxValueNoSpike() <= -1E+300);
}