本文整理汇总了C++中row::size方法的典型用法代码示例。如果您正苦于以下问题:C++ row::size方法的具体用法?C++ row::size怎么用?C++ row::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类row
的用法示例。
在下文中一共展示了row::size方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check_solution
row check_solution(const matrix &A , const row &X, const row &B) {
row diff;
diff.resize(B.size());
int size = B.size();
for(int i = 0; i < size; i++) {
double temp = 0;
for(int j = 0; j < size; j++) {
temp += A[i][j] * X[j];
}
diff[i] = temp - B[i];
}
return diff;
}
示例2:
bool ck_sorted_sorsets(row<sorset*>& rr_srss, cmp_srs_func_t cmp_fn){
std::ostream& os = std::cout;
long the_sz = rr_srss.size();
if(the_sz == 0){ return true; }
sorset* lst = rr_srss[0];
for(row_index ii = 1; ii < the_sz; ii++){
sorset* srs = rr_srss[ii];
if((*cmp_fn)(lst, srs) > 0){
os << "ck_sorted_sorsets_FAILED_with" << std::endl;
os << "srs_1=" << lst << std::endl; // prt_sorset
os << "srs_2=" << srs << std::endl; // prt_sorset
return false;
}
lst = srs;
}
return true;
}
示例3: solve_progon
row solve_progon(const matrix &A,const row &B) {
row P, Q, ans;
int N = B.size();
P.resize(N);
Q.resize(N);
ans.resize(N);
P[0] = - A[0][1] / A[0][0];
Q[0] = B[0]/A[0][0];
//Pr9moy xod
for(int i = 1; i < N; i++) {
P[i] = A[i][i + 1]/(-A[i][i] - A[i][i - 1]*P[i-1]);
Q[i] = (A[i][i - 1] * Q[i - 1] - B[i]) / (-A[i][i] - A[i][i-1] * P[i - 1]);
}
//Obratniy xod
ans[N - 1] = (A[N-1][N-2] * Q[N-2] - B[N-1]) / (-A[N-1][N-1] - A[N-1][N-2] * P[N-2]);
for(int i = N - 2; i >= 0; --i) {
ans[i] = P[i] * ans[i+1] + Q[i];
}
return ans;
}
示例4: debugEcho
void debugEcho(const row& row_)
{
std::ostringstream doc;
doc << "<row>" << std::endl;
for(std::size_t i = 0; i != row_.size(); ++i)
{
const column_properties & props = row_.get_properties(i);
doc << " " << props.get_name();
switch(props.get_data_type())
{
case dt_string:
doc << "-string:" << row_.get<std::string>(i);
break;
case dt_double:
doc << "-double:" << row_.get<double>(i);
break;
case dt_integer:
doc << "-integer:" << row_.get<int>(i);
break;
case dt_unsigned_long:
doc << "-ulong:" << row_.get<unsigned long>(i);
break;
case dt_long_long:
doc << "-long long:" << row_.get<long long>(i);
break;
case dt_date:
std::tm when = row_.get<std::tm>(i);
doc << "-date:" << asctime(&when);
break;
}
doc << std::endl;
}
doc << "</row>" << std::endl;
std::cout << doc.str();
}
示例5: solve
row solve(const row &left,const row &mid,const row &right, int j) {
int size = left.size();
double pt, bt;
row B(size);
matrix A(size, row(size));
for(int i = 0; i < A.size(); i++) {
if(i - 1 >=0)
A[i][i-1] = 1;
A[i][i] = -2;
if(i + 1 < A.size())
A[i][i+1] = 1;
if(i == 0)
pt = 0;
else
pt = mid[i-1];
if (i == A.size() - 1)
bt = 0;
else
bt = mid[i+1];
B[i] = (-left[i] + 2 * mid[i] - right[i]) * dt /(R * C) + (pt - 2 * mid[i] + bt) + I[j][i] * dt/C;//(left[i] - 2 * mid[i] + right[i]) * (dt / (R * C) - 1) + I[j][i] * dt / C ;
}
row s = solve_progon(A, B);
return s;
}
示例6: print_matrix
void print_matrix(const row &v) {
for(int i = 0; i < v.size(); i++){
std::cout << v[i] << std::endl;
}
}