本文整理汇总了C++中DataVector::SetDim方法的典型用法代码示例。如果您正苦于以下问题:C++ DataVector::SetDim方法的具体用法?C++ DataVector::SetDim怎么用?C++ DataVector::SetDim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataVector
的用法示例。
在下文中一共展示了DataVector::SetDim方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OutputRes
void OutputRes() {
fstream out(GrphName.c_str(), ios::out);
if(U_P.SetDim() < 1)
throw info_except("There is no data to output\n");
out << " Pnt Us Ps Rs Ue Pe Re D\n";
for(int k1 = 0; k1 < U_P.SetDim(); k1++) {
out << " a ";
out << k1 << " " << U_P[k1].Pstart << " " << U_P[k1].Ustart << " "
<< U_P[k1].Rstart << " ";
out << U_P[k1].Pinter << " " << U_P[k1].Uinter << " " << U_P[k1].Rinter << " "
<< U_P[k1].D << "\n";
}
out << " U P_Mat1 P_Mat2 P_Pnts...\n";
DataVector<double, CopyStructFast<double>> U =
DataVector<double, CopyStructFast<double>>::MakeStepVector(
Result::Discr, Result::Ufr, Result::Uto, 1);
for(int k = 0; k < U_P[0].U_P.SetDim(); k++) {
out << U[k] << " " << Mat1Result.U_P[k] << " " << Mat2Result.U_P[k] << " ";
for(int k1 = 0; k1 < U_P.SetDim(); k1++)
out << U_P[k1].U_P[k] << " ";
out << "\n";
}
}
示例2: ReadParam
void ReadParam(const char *name) {
// fstream in(name,ios::in);
FilterTextIn inf(name);
char tmp[256];
MatterIO *M1, *M2;
inf >> tmp; //Matter1=U1=0
if(NULL == (M1 = dynamic_cast<MatterIO *>(SavableClass::Read(inf))))
throw info_except("Could not register matter 1");
inf >> tmp; //Matter2
if(NULL == (M2 = dynamic_cast<MatterIO *>(SavableClass::Read(inf))))
throw info_except("Could not register matter 2");
Mat1 = dynamic_cast<MatterABu *>(M1);
Mat2 = dynamic_cast<MatterABu *>(M2);
if(!Mat1 || !Mat2)
throw info_except("Matters are not ABu type");
inf >> tmp >> U2 >> tmp >> Ro >> tmp >> L >> tmp >> tmp;
GrphName = tmp;
inf >> tmp;
// FilterTextIn inf(name);
inf >> Times;
U_P.SetDim(Times.SetDim());
//fcout<<" Times "<<Times;
}