当前位置: 首页>>代码示例>>C++>>正文


C++ CurveData类代码示例

本文整理汇总了C++中CurveData的典型用法代码示例。如果您正苦于以下问题:C++ CurveData类的具体用法?C++ CurveData怎么用?C++ CurveData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CurveData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateCurve

void OscilloscopePlot::updateCurve()
{
    CurveData *data = static_cast<CurveData *>( d_curve->data() );
    data->values().lock();

    const int numPoints = data->size();
    if ( numPoints > d_paintedPoints )
    {
        const bool doClip = !canvas()->testAttribute( Qt::WA_PaintOnScreen );
        if ( doClip )
        {
            /*
                Depending on the platform setting a clip might be an important
                performance issue. F.e. for Qt Embedded this reduces the
                part of the backing store that has to be copied out - maybe
                to an unaccelerated frame buffer device.
            */

            const QwtScaleMap xMap = canvasMap( d_curve->xAxis() );
            const QwtScaleMap yMap = canvasMap( d_curve->yAxis() );

            QRectF br = qwtBoundingRect( *data,
                d_paintedPoints - 1, numPoints - 1 );

            const QRect clipRect = QwtScaleMap::transform( xMap, yMap, br ).toRect();
            d_directPainter->setClipRegion( clipRect );
        }

        d_directPainter->drawSeries( d_curve,
            d_paintedPoints - 1, numPoints - 1 );
        d_paintedPoints = numPoints;
    }

    data->values().unlock();
}
开发者ID:Feng-Yin,项目名称:widgetcontaineroverview,代码行数:35,代码来源:oscilloscopeplot.cpp

示例2:

boost::shared_ptr<BlackCapFloorEngine> MustCapFloor::setEngineQuantLibBalckFT(){

	CurveData cData;
	// Fill out with some sample market data
	cData.sampleMktData(cData);

	// Build a curve linked to this market data
	boost::shared_ptr<YieldTermStructure> ocurve = (cData.buildCurve(cData));

	// Link the curve to the term structure
	this->forwardingTermStructure.linkTo(ocurve);
	//Date today(6, October, 2014);
	Settings::instance().evaluationDate() = today;

	//Date todaysDate = Date(8, Apr, 2015);
	//capletsVolatilies = buildCurveOptionletAtmVol(cVol);
	//capletsVolatilies = buildOptionletSurfaceVol(cVol);
	//capletsVolatilies = buildOptionletCurveVol(cVol);

	cVol.termStructure.linkTo(ocurve);
	capletsVolatilies = (cVol.buildFlatCurveVol(cVol));

	//capVol->enableExtrapolation();
	return boost::shared_ptr<BlackCapFloorEngine>(new
		BlackCapFloorEngine(forwardingTermStructure, capletsVolatilies));
}
开发者ID:Bkebe,项目名称:Efficiency.PricerLib,代码行数:26,代码来源:MustCapFloor.cpp

示例3: appendPoint

void IncrementalPlot::appendPoint( const QPointF &point )
{
    CurveData *data = static_cast<CurveData *>( d_curve->data() );
    data->append( point );

    const bool doClip = !canvas()->testAttribute( Qt::WA_PaintOnScreen );
//    if ( doClip )
//    {
//        /*
//           Depending on the platform setting a clip might be an important
//           performance issue. F.e. for Qt Embedded this reduces the
//           part of the backing store that has to be copied out - maybe
//           to an unaccelerated frame buffer device.
//         */
//        const QwtScaleMap xMap = canvasMap( d_curve->xAxis() );
//        const QwtScaleMap yMap = canvasMap( d_curve->yAxis() );

//        QRegion clipRegion;

//        const QSize symbolSize = d_curve->symbol()->size();
//        QRect r( 0, 0, symbolSize.width() + 2, symbolSize.height() + 2 );

//        const QPointF center =
//            QwtScaleMap::transform( xMap, yMap, point );
//        r.moveCenter( center.toPoint() );
//        clipRegion += r;

//        d_directPainter->setClipRegion( clipRegion );
//    }

    d_directPainter->drawSeries( d_curve,
        data->size() - 1, data->size() - 1 );
}
开发者ID:pasteur90,项目名称:GaitAnalysis,代码行数:33,代码来源:incrementalplot.cpp

示例4: clearPoints

void BrainPlot::clearPoints(int Channel)
{
    CurveData *data = static_cast<CurveData *>( d_curves[Channel]->data() );
    data->clear();

    replot();
}
开发者ID:cogitoergobum,项目名称:eeg,代码行数:7,代码来源:brainplot.cpp

示例5: clearPoints

void IncrementalPlot::clearPoints()
{
    CurveData *data = static_cast<CurveData *>( d_curve->data() );
    data->clear();

    replot();
}
开发者ID:pasteur90,项目名称:GaitAnalysis,代码行数:7,代码来源:incrementalplot.cpp

示例6: QwtInterval

void OscilloscopePlot::incrementInterval()
{
    d_interval = QwtInterval( d_interval.maxValue(),
        d_interval.maxValue() + d_interval.width() );

    CurveData *data = static_cast<CurveData *>( d_curve->data() );
    data->values().clearStaleValues( d_interval.minValue() );

    // To avoid, that the grid is jumping, we disable
    // the autocalculation of the ticks and shift them
    // manually instead.

    QwtScaleDiv scaleDiv = axisScaleDiv( QwtPlot::xBottom );
    scaleDiv.setInterval( d_interval );

    for ( int i = 0; i < QwtScaleDiv::NTickTypes; i++ )
    {
        QList<double> ticks = scaleDiv.ticks( i );
        for ( int j = 0; j < ticks.size(); j++ )
            ticks[j] += d_interval.width();
        scaleDiv.setTicks( i, ticks );
    }
    setAxisScaleDiv( QwtPlot::xBottom, scaleDiv );

    d_origin->setValue( d_interval.minValue() + d_interval.width() / 2.0, 0.0 );

    d_paintedPoints = 0;
    replot();
}
开发者ID:Feng-Yin,项目名称:widgetcontaineroverview,代码行数:29,代码来源:oscilloscopeplot.cpp

示例7:

void Wykres2d::wyczysc()
{
    CurveData *data = static_cast<CurveData *> (plot2dCurve->data()); 
    data->clear();
    punkty.clear();
     plot2d->replot();
    
}
开发者ID:werty,项目名称:PSOEVO,代码行数:8,代码来源:Wykres2d.cpp

示例8:

// -------------------------------------------------------------------------- //
//
void Test_CurveData::testGetChi2New()
{
    CurveData cd;
    const double chi2_new = 1.1246722311651241;
    cd.chi2_new_ = chi2_new;

    CPPUNIT_ASSERT_DOUBLES_EQUAL( cd.get_chi2_new(), chi2_new, 1.0e-12 );
}
开发者ID:leetmaa,项目名称:SpecSwap-RMC,代码行数:10,代码来源:test_curvedata.cpp

示例9: replot

void Plot::replot()
{
    CurveData *data = (CurveData *)d_curve->data();
    data->values().lock();

    QwtPlot::replot();
    d_paintedPoints = data->size();

    data->values().unlock();
}
开发者ID:PrincetonPAVE,项目名称:old_igvc,代码行数:10,代码来源:plot.cpp

示例10: replot

void OscilloscopePlot::replot()
{
    CurveData *data = static_cast<CurveData *>( d_curve->data() );
    data->values().lock();

    QwtPlot::replot();
    d_paintedPoints = data->size();

    data->values().unlock();
}
开发者ID:Feng-Yin,项目名称:widgetcontaineroverview,代码行数:10,代码来源:oscilloscopeplot.cpp

示例11: appendPoint

void BrainPlot::appendPoint( QPointF point, int Channel )
{
    /*Adds new point - with proper index and offset - to the data series*/
    CurveData *data = static_cast<CurveData *>( d_curves[Channel]->data() );
    point.setY(minusExpectedAmplitude*(2*Channel+1)+point.y());
    data->replace(sample%plotLength, point);
    setClipRegion(d_curves[Channel], point);

    d_directPainter->drawSeries( d_curves[Channel],
                                 data->size() - 1, data->size() - 1 );
}
开发者ID:cogitoergobum,项目名称:eeg,代码行数:11,代码来源:brainplot.cpp

示例12: updateCurve

void Plot::updateCurve()
{
    CurveData *data = (CurveData *)d_curve->data();
    data->values().lock();

    const int numPoints = d_curve->data()->size();
    if ( numPoints > d_paintedPoints )
    {
        d_directPainter->drawSeries(d_curve, 
            d_paintedPoints - 1, numPoints - 1);
        d_paintedPoints = numPoints;
    }

    data->values().unlock();
}
开发者ID:PrincetonPAVE,项目名称:old_igvc,代码行数:15,代码来源:plot.cpp

示例13: LiborForwardModelProcess

boost::shared_ptr<AnalyticCapFloorEngine> MustCapFloor::setEngineQuantLibLMM(){
	CurveData cData;
	// Fill out with some sample market data
	cData.sampleMktData(cData);
	//Date today(10, October, 2014);
	//Settings::instance().evaluationDate() = today;
	// Build a curve linked to this market data
	boost::shared_ptr<YieldTermStructure> ocurve = (cData.buildCurve(cData));

	// Link the curve to the term structure
	boost::shared_ptr<IborIndex> index = boost::shared_ptr<IborIndex>(new Euribor6M(forwardingTermStructure));
	Date todaysDate =
		myIndex->fixingCalendar().adjust(today);
	Settings::instance().evaluationDate() = todaysDate;

	this->forwardingTermStructure.linkTo(ocurve);

	

	const Size size = floatingLeg.size();
	boost::shared_ptr<LiborForwardModelProcess> process(
		new LiborForwardModelProcess(size, myIndex));

	//// set-up the model
	///*	const Real a = 0.02;
	//const Real b = 0.12;
	//const Real c = 0.1;
	//const Real d = 0.01;*/

	const Real a = 0.025;
	const Real b = 0.12;
	const Real c = 0.1;
	const Real d = 0.01;

	boost::shared_ptr<LmVolatilityModel> volaModel(
		new LmLinearExponentialVolatilityModel(process->fixingTimes(), a, b, c, d));

	boost::shared_ptr<LmCorrelationModel> corrModel(
		new LmLinearExponentialCorrelationModel(size, 0.1, 0.1));

	boost::shared_ptr<LiborForwardModel> liborModel(
		new LiborForwardModel(process, volaModel, corrModel));

return	boost::shared_ptr<AnalyticCapFloorEngine> (
		new AnalyticCapFloorEngine(liborModel, forwardingTermStructure));
}
开发者ID:Bkebe,项目名称:Efficiency.PricerLib,代码行数:46,代码来源:MustCapFloor.cpp

示例14: while

void StringToCurve::UpdateCurve()
{
  // Remove any existing curves
  while ( !m_OutCurveList->getCurveList().empty() ) {
    delete m_OutCurveList->getCurveList().back();
    m_OutCurveList->getCurveList().pop_back();
  }

  std::string dataString = f_CurveString->getStringValue();
  dataString.append( f_CurveSeparator->getStringValue() );

  std::string indexString = f_IndexString->getStringValue();
  std::vector< float > indexValues;
  if (indexString.length() != 0 ){
    StringToVector(indexString, indexValues );
  }

  if ( dataString.length() > 0 ){
    // Split string into curves
    std::vector<std::string> curves;
    boost::split(curves, dataString, boost::is_any_of(f_CurveSeparator->getStringValue() ));

    // Iterate over curves
    std::vector<std::string>::iterator stringIt = curves.begin();
    for (;stringIt < curves.end(); ++stringIt ){
      std::string curCurve = *stringIt;
      if (curCurve.length() == 0) {continue;}
      // Remove leading and trailing spaces
      boost::trim( curCurve );
      std::vector< MLfloat > curveValues;
      StringToVector( curCurve, curveValues );
      CurveData *outputCurve = new CurveData;
      outputCurve->setY( curveValues.size(),&curveValues[0], 1 );
      if ( f_IndexString->getStringValue().length() != 0 ){
        outputCurve->setX( indexValues.size(),&indexValues[0], 1 );
      }
      m_OutCurveList->getCurveList().push_back( outputCurve );
    }
  }
}
开发者ID:hjkuijf,项目名称:communitymodules,代码行数:40,代码来源:mlStringToCurve.cpp

示例15: qDebug

void Plot::appendPoint1(double u)
{
    double elapsed = d_clock.elapsed() / 1000.0;
    qDebug() << "d_clock1: " << elapsed;
    qDebug() << "udouble1: " << u;
    QPointF point(elapsed,(u*5/1024));
    CurveData *data = static_cast<CurveData *>( d_curve1->data() );
    data->append(point);
    RecToFile1(elapsed,u);

    const int numPoints = data->size();
    if ( numPoints > d_paintedPoints1 )
    {
        const bool doClip = !canvas()->testAttribute( Qt::WA_PaintOnScreen );
        if ( doClip )
        {
            /*
                Depending on the platform setting a clip might be an important
                performance issue. F.e. for Qt Embedded this reduces the
                part of the backing store that has to be copied out - maybe
                to an unaccelerated frame buffer device.
            */

            const QwtScaleMap xMap = canvasMap( d_curve1->xAxis() );
            const QwtScaleMap yMap = canvasMap( d_curve1->yAxis() );

            QRectF br = qwtBoundingRect( *data,
                d_paintedPoints1 - 1, numPoints - 1 );

            const QRect clipRect = QwtScaleMap::transform( xMap, yMap, br ).toRect();
            d_directPainter0->setClipRegion( clipRect );
        }

        d_directPainter0->drawSeries(d_curve1,
            d_paintedPoints1 - 1, numPoints - 1);
        d_paintedPoints1 = numPoints;
    }
}
开发者ID:d2mitry,项目名称:d2m_reno,代码行数:38,代码来源:plot.cpp


注:本文中的CurveData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。