本文整理汇总了C++中realvec::write方法的典型用法代码示例。如果您正苦于以下问题:C++ realvec::write方法的具体用法?C++ realvec::write怎么用?C++ realvec::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类realvec
的用法示例。
在下文中一共展示了realvec::write方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setfill
void
PlotSink::myProcess(realvec& in, realvec& out)
{
out = in;
mrs_natural t,o;
//if using MATLABengine, plot the input data in MATLAB
#ifdef MARSYAS_MATLAB
if(ctrl_matlab_->isTrue())
{
MATLAB_PUT(in, type_+"_"+name_+"_indata")
MATLAB_EVAL(ctrl_matlabCommand_->to<mrs_string>());
}
#endif
counter_++;
if (ctrl_sequence_->isTrue())
{
//save current input to a sequence of numbered output files
ostringstream oss;
oss << ctrl_filename_->to<mrs_string>() <<
setfill('0') << setw(4) << counter_ << ".plot";
cout << "name = " << name_ << " " << oss.str() << endl;
MRSMSG("Writing " << oss.str() << endl);
in.write(oss.str());
}
if (ctrl_single_file_->isTrue()) {
for (o=0; o < inObservations_; o++) {
for (t = 0; t < inSamples_; t++) {
//(*single_file_) << counter_ << " " << t << " ";
(*single_file_) << std::setprecision(20) << in(o,t);
(*single_file_) << std::endl;
//cout << in(o,t);
}
}
if (ctrl_no_ticks_->isTrue()) {
} else {
(*single_file_) << std::endl;
}
}
if(ctrl_messages_->isTrue())
{
mrs_string sep =ctrl_separator_->to<mrs_string>();
//ostringstream oss;
//output input content as a Marsyas Message (stdout by default)
// for (t = 0; t < inSamples_; t++)
// {
// for (o=0; o < inObservations_; o++)
// {
// if (o < inObservations_ - 1)
// {
// oss << out(o,t) << sep;
// }
// else
// {
// oss << out(o,t);
// }
// }
// mrs_string s = oss.str();
// MRSMSG(s << endl);
// }//FIXME: confirm that code below is correct and remove commented code above
for (o=0; o < inObservations_; o++)
{
ostringstream oss;
for (t = 0; t < inSamples_; t++)
{
if (t < inSamples_ - 1)
{
oss << out(o,t) << sep;
}
else
{
oss << out(o,t);
}
}
mrs_string s = oss.str();
MRSMSG(s << endl);
}
}
}