• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Series类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: builder

// Builds a network with a network_spec in the network description
// language, to recognize a character set of num_outputs size.
// If append_index is non-negative, then *network must be non-null and the
// given network_spec will be appended to *network AFTER append_index, with
// the top of the input *network discarded.
// Note that network_spec is call by value to allow a non-const char* pointer
// into the string for BuildFromString.
// net_flags control network behavior according to the NetworkFlags enum.
// The resulting network is returned via **network.
// Returns false if something failed.
bool NetworkBuilder::InitNetwork(int num_outputs, STRING network_spec,
                                 int append_index, int net_flags,
                                 float weight_range, TRand* randomizer,
                                 Network** network) {
  NetworkBuilder builder(num_outputs);
  Series* bottom_series = NULL;
  StaticShape input_shape;
  if (append_index >= 0) {
    // Split the current network after the given append_index.
    ASSERT_HOST(*network != NULL && (*network)->type() == NT_SERIES);
    Series* series = reinterpret_cast<Series*>(*network);
    Series* top_series = NULL;
    series->SplitAt(append_index, &bottom_series, &top_series);
    if (bottom_series == NULL || top_series == NULL) {
      tprintf("Yikes! Splitting current network failed!!\n");
      return false;
    }
    input_shape = bottom_series->OutputShape(input_shape);
    delete top_series;
  }
  char* str_ptr = &network_spec[0];
  *network = builder.BuildFromString(input_shape, &str_ptr);
  if (*network == NULL) return false;
  (*network)->SetNetworkFlags(net_flags);
  (*network)->InitWeights(weight_range, randomizer);
  (*network)->SetupNeedsBackprop(false);
  if (bottom_series != NULL) {
    bottom_series->AppendSeries(*network);
    *network = bottom_series;
  }
  (*network)->CacheXScaleFactor((*network)->XScaleFactor());
  return true;
}
开发者ID:bhanu475,项目名称:tesseract,代码行数:43,代码来源:networkbuilder.cpp


示例2: Plot

bool TestPlotWithArea::DoTest()
{
    Plot *plot;
    plot = new Plot();

    Area *area = new Area2D();

    Box *box1, *box2;
    box1 = new Box(plot);

    box2 = new Box(plot);

    Series *series;
    series = new Series2D("Series");

    DataTyped<int> *xdata;
    xdata = new DataTyped<int>();

    series->SetData(xdata, AXIS_X);

    area->AddSeries(series);
    plot->AddArea(area);

    delete box1;


    delete plot;

    return true;
}
开发者ID:ainur-giniyatov,项目名称:wxPlot,代码行数:30,代码来源:Test.cpp


示例3: NonLinearity

// Parses a network that begins with 'C'.
Network* NetworkBuilder::ParseC(const StaticShape& input_shape, char** str) {
  NetworkType type = NonLinearity((*str)[1]);
  if (type == NT_NONE) {
    tprintf("Invalid nonlinearity on C-spec!: %s\n", *str);
    return nullptr;
  }
  int y = 0, x = 0, d = 0;
  if ((y = strtol(*str + 2, str, 10)) <= 0 || **str != ',' ||
      (x = strtol(*str + 1, str, 10)) <= 0 || **str != ',' ||
      (d = strtol(*str + 1, str, 10)) <= 0) {
    tprintf("Invalid C spec!:%s\n", *str);
    return nullptr;
  }
  if (x == 1 && y == 1) {
    // No actual convolution. Just a FullyConnected on the current depth, to
    // be slid over all batch,y,x.
    return new FullyConnected("Conv1x1", input_shape.depth(), d, type);
  }
  Series* series = new Series("ConvSeries");
  Convolve* convolve =
      new Convolve("Convolve", input_shape.depth(), x / 2, y / 2);
  series->AddToStack(convolve);
  StaticShape fc_input = convolve->OutputShape(input_shape);
  series->AddToStack(new FullyConnected("ConvNL", fc_input.depth(), d, type));
  return series;
}
开发者ID:bhanu475,项目名称:tesseract,代码行数:27,代码来源:networkbuilder.cpp


示例4: readData

void readData()
{

    //percorrendo

    list<double>::iterator it;

    for(int i = 0; i < mySeries.size(); i++)
    {
        cout <<"serie " << i<<endl;
        for(it = mySeries[i].begin(); it != mySeries[i].end(); it++)
        {

            cout << *it << " ";
        }

        cout << endl;
    }

    for(int i = 0; i < templateSeries.size(); i++)
    {
        cout <<"serie " << i<<endl;
        for(it = templateSeries[i].begin(); it != templateSeries[i].end(); it++)
        {

            cout << *it << " ";
        }

        cout << endl;
    }

}
开发者ID:lbull,项目名称:AA-T2-DTW,代码行数:32,代码来源:dtw.cpp


示例5: SoundFileSource

void
Talk::cmd_load(mrs_string fname, mrs_natural lineSize)
{
  cout << "cmd_load called" << endl;

  src_ = new SoundFileSource("src");
  src_->updControl("mrs_string/filename", fname);
  fname_ = fname;
  src_->updControl("mrs_natural/inSamples", lineSize);
  AbsMax* absmax = new AbsMax("absmax");

  Series *series = new Series("plot");
  series->addMarSystem(src_);
  series->addMarSystem(absmax);


  mrs_natural hops = src_->getctrl("mrs_natural/size")->to<mrs_natural>() * src_->getctrl("mrs_natural/nChannels")->to<mrs_natural>() / src_->getctrl("mrs_natural/inSamples")->to<mrs_natural>() + 1;


  Accumulator* acc = new Accumulator("acc");
  acc->updControl("mrs_natural/nTimes", hops);
  acc->addMarSystem(series);



  realvec in(acc->getctrl("mrs_natural/inObservations")->to<mrs_natural>(),
             acc->getctrl("mrs_natural/inSamples")->to<mrs_natural>());

  realvec out(acc->getctrl("mrs_natural/onObservations")->to<mrs_natural>(),
              acc->getctrl("mrs_natural/onSamples")->to<mrs_natural>());



  acc->process(in,out);

  out.send(communicator_);



//   Util util;
//   fname_ = fname;
//   src_ = util.sfopen(fname, MRS_SF_READ);
//   if (src_ == NULL)
//     cout << "src_ = NULL" << endl;

//   if (src_ != NULL)			// File exists
//     {
//       src_->initWindow(lineSize, lineSize, 0, 0);
//       PlotExtractor pextractor(src_, src_->winSize());
//       fvec res(src_->iterations());
//       pextractor.extract(0, src_->iterations(), res);
//       res.send(communicator_);
//     }
//   else
//     {
//       fvec res(0);
//       res.send(communicator_);
//     }
}
开发者ID:Amos-zq,项目名称:marsyas,代码行数:59,代码来源:Talk.cpp


示例6: GetTableRowFromDataSet

void
LocalService::CheckDataSet(
    DcmDataset *dataSet,
    SerieInfo &sInfo,
    TableRow &row,
    std::string path)
{
  // load data from dataSet
  GetTableRowFromDataSet( dataSet, &row);
  GetSeriesInfo( dataSet, &sInfo);

  // now check what is in database
  Patients::iterator patIt = m_patients.find( row.patientID);
  if( patIt == m_patients.end() )
  {
    // insert new patient
    // insert new study
    Serie serie(sInfo.id, sInfo.description, path);
    Series s;
    s.insert( Series::value_type( serie.id, serie) );
    Study stud(row.studyID, row.date, s);
    Studies buddStudies;
    buddStudies.insert( Studies::value_type( stud.id, stud));

    Patient buddPat( row.patientID, row.name, row.birthDate, row.sex, buddStudies);
    m_patients.insert( Patients::value_type( row.patientID, buddPat) );
  }
  else
  {
    // perform lookup level down
    Studies &studies = patIt->second.studies;
    Studies::iterator studItr = studies.find( row.studyID);
    if( studItr == studies.end() )
    {
      // insert new study
      Serie serie(sInfo.id, sInfo.description, path);
      Series s;
      s.insert( Series::value_type( serie.id, serie) );
      Study stud(row.studyID, row.date, s);
      patIt->second.studies.insert( Studies::value_type(
        stud.id, stud) );
    }
    else
    {
      // perform lookup level down
      Series &series = studItr->second.series;
      Series::iterator serItr = series.find( sInfo.id);
      if( serItr == series.end() )
      {
        // insert new serie
        Serie buddy(sInfo.id, sInfo.description, path);
        series.insert( Series::value_type( sInfo.id, buddy) );
      }
      // else do nothing
    }
  }
}
开发者ID:JanKolomaznik,项目名称:MedV4D,代码行数:57,代码来源:LocalService.cpp


示例7: _loadedFieldDictionary

DataDictionaryImpl::DataDictionaryImpl(const DataDictionaryImpl& other) :
	_loadedFieldDictionary(false),
	_loadedEnumTypeDef(false),
	_pDictionaryEntryList(0),
	_pEnumTypeTableList(0),
	_ownRsslDataDictionary(true),
	_pfieldNameToIdHash(0)
{
	_errorText.length = MAX_ERROR_TEXT_SIZE;
	_errorText.data = (char*)malloc(sizeof(char) * _errorText.length);

	if ( !_errorText.data )
	{
		throwMeeException("Failed to allocate memory in DataDictionaryImpl::DataDictionaryImpl()");
	}

	if ( _ownRsslDataDictionary )
	{
		try
		{
			_pRsslDataDictionary = new RsslDataDictionary();
		}
		catch (std::bad_alloc)
		{
			throwMeeException("Failed to allocate memory in DataDictionaryImpl::DataDictionaryImpl()");
		}

		rsslClearDataDictionary(_pRsslDataDictionary);
	}

	if (!other._loadedEnumTypeDef && !other._loadedFieldDictionary)
	{
		return;
	}

	Series series;

	if ( other._loadedFieldDictionary )
	{
		const_cast<DataDictionaryImpl&>(other).encodeFieldDictionary(series, DICTIONARY_VERBOSE);

		StaticDecoder::setData(&series, 0);

		decodeFieldDictionary(series, DICTIONARY_VERBOSE);

		series.clear();
	}

	if ( other._loadedEnumTypeDef )
	{
		const_cast<DataDictionaryImpl&>(other).encodeEnumTypeDictionary(series, DICTIONARY_VERBOSE);

		StaticDecoder::setData(&series, 0);

		decodeEnumTypeDictionary(series, DICTIONARY_VERBOSE);
	}
}
开发者ID:thomsonreuters,项目名称:Elektron-SDK,代码行数:57,代码来源:DataDictionaryImpl.cpp


示例8: SetOffset

void LineChartPane::SetOffset(ViewChannels &channels, int offset){
	for (size_t i = 0; i < channels.Count(); i++){
		ViewChannel &channel = channels[i];
		Series *series = m_lineChart->GetSeries(channel.ToString());
		if (NULL != series){
			series->SetOffset(offset);
		}
	}
	m_lineChart->Refresh();
}
开发者ID:BMWPower,项目名称:RaceAnalyzer,代码行数:10,代码来源:lineChartPane.cpp


示例9: perform_test_trivial

 void perform_test_trivial() {
   Series s;
   typedef ParserResultElement<Series> Parser;
   Parser p(s);
   {
     const std::string test = "09/y-i/A/xXyY1";
     OKLIB_TESTTRIVIAL_RETHROW(::OKlib::Parser::Test_ParsingString<Parser>(p, test, ::OKlib::Parser::match_full));
     if(s.name() != test)
       OKLIB_THROW("Resulting name is " + s.name() + ", and not " + test);
   }
 }
开发者ID:MLewsey,项目名称:oklibrary,代码行数:11,代码来源:ParsingSingleResult_Tests.hpp


示例10: coarse_grain

    coarse_grain(Series const &series, Discretization discretization, ordered_inserter<Out> out)
    {
        typedef typename concepts::TimeSeries<Series const>::offset_type offset_type;

        BOOST_ASSERT(discretization > series.discretization());
        BOOST_ASSERT(discretization % series.discretization() == 0);

        offset_type factor = discretization / series.discretization();

        detail::coarse_grain_inserter<ordered_inserter<Out>, offset_type> o(out, factor);
        return range_run_storage::copy(series, o).out();
    }
开发者ID:dailypips,项目名称:time_series,代码行数:12,代码来源:coarse_grain.hpp


示例11: UpdateValueRange

void LineChartPane::UpdateValueRange(ViewDataHistoryArray &historyArray, size_t fromIndex, size_t toIndex){

	for (size_t i = 0; i < historyArray.size(); i++){
		ViewDataHistory &history = historyArray[i];
		Series *series = m_lineChart->GetSeries(history.channel.ToString());
		if (NULL != series){
			for (size_t i = fromIndex; i < toIndex; i++){
				series->SetValueAt(i, history.values[i]);
			}
			m_lineChart->Refresh();
		}
	}
}
开发者ID:BMWPower,项目名称:RaceAnalyzer,代码行数:13,代码来源:lineChartPane.cpp


示例12: tprintf

// Parses an Output spec.
Network* NetworkBuilder::ParseOutput(const StaticShape& input_shape,
                                     char** str) {
  char dims_ch = (*str)[1];
  if (dims_ch != '0' && dims_ch != '1' && dims_ch != '2') {
    tprintf("Invalid dims (2|1|0) in output spec!:%s\n", *str);
    return nullptr;
  }
  char type_ch = (*str)[2];
  if (type_ch != 'l' && type_ch != 's' && type_ch != 'c') {
    tprintf("Invalid output type (l|s|c) in output spec!:%s\n", *str);
    return nullptr;
  }
  int depth = strtol(*str + 3, str, 10);
  if (depth != num_softmax_outputs_) {
    tprintf("Warning: given outputs %d not equal to unicharset of %d.\n", depth,
            num_softmax_outputs_);
    depth = num_softmax_outputs_;
  }
  NetworkType type = NT_SOFTMAX;
  if (type_ch == 'l')
    type = NT_LOGISTIC;
  else if (type_ch == 's')
    type = NT_SOFTMAX_NO_CTC;
  if (dims_ch == '0') {
    // Same as standard fully connected.
    return BuildFullyConnected(input_shape, type, "Output", depth);
  } else if (dims_ch == '2') {
    // We don't care if x and/or y are variable.
    return new FullyConnected("Output2d", input_shape.depth(), depth, type);
  }
  // For 1-d y has to be fixed, and if not 1, moved to depth.
  if (input_shape.height() == 0) {
    tprintf("Fully connected requires fixed height!\n");
    return nullptr;
  }
  int input_size = input_shape.height();
  int input_depth = input_size * input_shape.depth();
  Network* fc = new FullyConnected("Output", input_depth, depth, type);
  if (input_size > 1) {
    Series* series = new Series("FCSeries");
    series->AddToStack(new Reconfig("FCReconfig", input_shape.depth(), 1,
                                    input_shape.height()));
    series->AddToStack(fc);
    fc = series;
  }
  return fc;
}
开发者ID:bhanu475,项目名称:tesseract,代码行数:48,代码来源:networkbuilder.cpp


示例13: GetSeries

void
LocalService::FindStudyInfo( 
      SerieInfoVector &result,
      const std::string &patientID,
			const std::string &studyID)
{
  // just take informatoin from tree
  Series series = GetSeries( patientID, studyID);
  SerieInfo s;
  for( Series::iterator serie=series.begin(); 
    serie != series.end(); serie++)
  {
    s.id = serie->second.id;
    s.description = serie->second.desc;
    result.push_back( s);
  }
}
开发者ID:JanKolomaznik,项目名称:MedV4D,代码行数:17,代码来源:LocalService.cpp


示例14: Series2D

bool TestSeries2DwithData::DoTest()
{
    Series *serie;
    serie = new Series2D("new series");

    DataNoType *xdata, *ydata;
    xdata = new DataTyped<double>(100, "x-data");
    ydata = new DataTyped<double>(100, "y-data");

    serie->SetData(xdata, AXIS_X);
    serie->SetData(ydata, AXIS_Y);

    //delete ydata;
    delete xdata;
    delete serie;
    return true;
}
开发者ID:ainur-giniyatov,项目名称:wxPlot,代码行数:17,代码来源:Test.cpp


示例15: main

int main()
{
	//threaded	 

	try
	{
		Series test ("/title/tt0436992/");
		test.getEpisodes();
		std::cout << test.getXML();
	}

	catch (const char* msg)
	{
    		 std::cerr << msg << std::endl;
   	}


}
开发者ID:sergerold,项目名称:imdb-tv,代码行数:18,代码来源:main.cpp


示例16: SetBufferSize

void LineChartPane::SetBufferSize(ViewChannels &channels, size_t size, int offset){

	ViewChannels enabledChannels;
	for (size_t i = 0; i < channels.Count(); i++){
		ViewChannel &channel = channels[i];
		Series *series = m_lineChart->GetSeries(channel.ToString());
		if (NULL != series){
			enabledChannels.Add(channel);
			series->SetBufferSize(size);
			series->SetOffset(offset);
		}
	}

	wxCommandEvent addEvent(REQUEST_DATALOG_DATA_EVENT, ID_REQUEST_DATALOG_DATA);
	RequestDatalogRangeParams *params = new RequestDatalogRangeParams(this, enabledChannels, 0, size - 1);
	addEvent.SetClientData(params);
	GetParent()->GetEventHandler()->AddPendingEvent(addEvent);
}
开发者ID:BMWPower,项目名称:RaceAnalyzer,代码行数:18,代码来源:lineChartPane.cpp


示例17: GetFont

void LineChart::DrawCurrentValues(wxMemoryDC &dc, size_t dataIndex, int x, int y){
	int currentOffset = 0;
	wxFont labelFont = GetFont();
	int labelWidth,labelHeight,descent,externalLeading;

	for (SeriesMap::iterator it = m_seriesMap.begin(); it != m_seriesMap.end(); ++it){

		Series *series = it->second;
		double dataValue = series->GetValueAtOrNear(dataIndex);
		wxString numberFormat = "% 2." + wxString::Format("%df", series->GetPrecision());
		wxString valueString = (DatalogValue::NULL_VALUE == dataValue ? "---" : wxString::Format(numberFormat.ToAscii(), dataValue)) + " " + series->GetLabel();
		dc.SetTextForeground(series->GetColor());
		dc.GetTextExtent(valueString, &labelHeight, &labelWidth, &descent, &externalLeading, &labelFont);

		dc.DrawRotatedText(valueString, x + CURRENT_VALUES_RIGHT_OFFSET, y + currentOffset,0);
		currentOffset += labelWidth;
	}
}
开发者ID:BMWPower,项目名称:RaceAnalyzer,代码行数:18,代码来源:lineChart.cpp


示例18: returnSeries

const Series operator/(const double &dividend, const Series &series) {
  Series returnSeries(series);
  for (auto &datetime_series : returnSeries.datetime_map_) {
    for (auto &sample : datetime_series.second.series_) {
      sample.value = dividend / sample.value;
    }
  }
  returnSeries.SetName("(" + std::to_string(dividend) + " / " + series.GetName() + ")");
  return returnSeries;
}
开发者ID:volchnik,项目名称:stock_cpp,代码行数:10,代码来源:Series.cpp


示例19: DTW

void DTW()
{
    int myBestClass;
    double myMinDbl, myDbl;
    int totalHits, correctClass;
    list<double>::iterator it;


    totalHits = 0;

    //uncoment do get graph data
    //cout << " Error at: \n Serie number | Class Estimated | Correct Class " << endl;

    //series a serem testadas
    for(int k = 0; k < mySeries.size()-1; k++)
    {
        myMinDbl = INFINITY;

        //series templates
        for(int i = 0; i < templateSeries.size() -1; i++)
        {
            myDbl = calcDTW(k, i);
            if(myDbl < myMinDbl)
            {
                it = templateSeries[i].begin();
                myBestClass = *it;
                myMinDbl = myDbl;
            }

        }
        it = mySeries[k].begin();
        correctClass = *it;

        if(myBestClass == correctClass)totalHits++;
        //   else cout << k << " " << myBestClass << " " << correctClass  << endl;

    }

    cout <<"Total de Séries: "<< mySeries.size() -1 <<"\nacertos: " << totalHits <<" -> "
        << std::setprecision(5)<< (totalHits * 100.0)/(mySeries.size() -1) << "%" <<endl;

}
开发者ID:lbull,项目名称:AA-T2-DTW,代码行数:42,代码来源:dtw.cpp


示例20: BuildFullyConnected

// Helper builds a truly (0-d) fully connected layer of the given type.
static Network* BuildFullyConnected(const StaticShape& input_shape,
                                    NetworkType type, const STRING& name,
                                    int depth) {
  if (input_shape.height() == 0 || input_shape.width() == 0) {
    tprintf("Fully connected requires positive height and width, had %d,%d\n",
            input_shape.height(), input_shape.width());
    return nullptr;
  }
  int input_size = input_shape.height() * input_shape.width();
  int input_depth = input_size * input_shape.depth();
  Network* fc = new FullyConnected(name, input_depth, depth, type);
  if (input_size > 1) {
    Series* series = new Series("FCSeries");
    series->AddToStack(new Reconfig("FCReconfig", input_shape.depth(),
                                    input_shape.width(), input_shape.height()));
    series->AddToStack(fc);
    fc = series;
  }
  return fc;
}
开发者ID:bhanu475,项目名称:tesseract,代码行数:21,代码来源:networkbuilder.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AAsset_getLength函数代码示例发布时间:2022-05-30
下一篇:
C++ SerializerElement类代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap