本文整理汇总了C++中AzDvect::rowNum方法的典型用法代码示例。如果您正苦于以下问题:C++ AzDvect::rowNum方法的具体用法?C++ AzDvect::rowNum怎么用?C++ AzDvect::rowNum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AzDvect
的用法示例。
在下文中一共展示了AzDvect::rowNum方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: count
void count(const AzPmat *m) {
if (v_border.rowNum() == 0) init_count();
AzDmat md; m->get(&md);
const double *border = v_border.point();
int row, col;
for (col = 0; col < md.colNum(); ++col) {
for (row = 0; row < md.rowNum(); ++row) {
double val = md.get(row, col);
int bx;
for (bx = 0; bx < v_border.rowNum(); ++bx) {
if (val <= border[bx]) {
v_pop.add(bx, 1);
break;
}
}
}
}
}
示例2: reset
void reset(const AzDvect *inp_v_y,
const AzDvect *inp_v_fixed_dw=NULL) {
v_dw.reform(inp_v_y->rowNum());
v_dw.set(1);
v_tar_dw.set(inp_v_y);
v_y.set(inp_v_y);
fixed_dw_sum = -1;
v_fixed_dw.reset();
if (!AzDvect::isNull(inp_v_fixed_dw)) {
v_fixed_dw.set(inp_v_fixed_dw);
if (v_fixed_dw.rowNum() != v_y.rowNum()) {
throw new AzException(AzInputError, "AzTrTtarget::reset",
"conlict in dimensionality: y and data point weights");
}
fixed_dw_sum = v_fixed_dw.sum();
}
}
示例3: resetDw
/*---*/
void resetDw(const AzDvect *inp_v_dw) {
if (!AzDvect::isNull(inp_v_dw)) {
if (inp_v_dw->rowNum() != v_y.rowNum()) {
throw new AzException("AzOptOnTree::resetDw", "dimensionality conflict");
}
v_fixed_dw.set(inp_v_dw);
}
else {
v_fixed_dw.destroy();
}
}
示例4: AzException
/*--- this never returns NULL ---*/
inline const AzDvect *col(int col) const {
if (col < 0 || col >= col_num) {
throw new AzException("AzDmat::col", "col# is out of range");
}
if (column[col] == NULL) {
if (dummy_zero.rowNum() != row_num) {
throw new AzException("AzDmat::col", "wrong dummy_zero");
}
return &dummy_zero;
}
return column[col];
}
示例5: mergeData
/*----------------------------------------------------------------------*/
void AzSvDataS::mergeData(const AzSmat *m_x,
const AzSvFeatInfo *feat,
const char *fn_template,
const char *str,
bool doSparse,
int digits,
const char *out_x_fn,
const char *out_n_fn,
int num,
const char *names[])
{
const char *eyec = "AzSvDataS::mergeData";
int data_num = m_x->colNum();
int f_num = m_x->rowNum();
if (feat->featNum() != f_num) {
throw new AzException(eyec, "Conflict btw m_x and featInfo");
}
AzFile n_file(out_n_fn);
n_file.open("wb");
int fx;
for (fx = 0; fx < feat->featNum(); ++fx) {
AzBytArr s; feat->desc(fx, &s); s.nl();
s.writeText(&n_file);
}
AzSmat m;
m_x->transpose(&m);
m.resize(data_num, f_num+num);
AzStrPool sp_names;
for (fx = 0; fx < num; ++fx) {
AzBytArr s_fn(fn_template);
s_fn.replace("*", names[fx]);
AzDvect v;
AzSvDataS::readVector(s_fn.c_str(), &v);
if (v.rowNum() != m.rowNum()) {
throw new AzException(AzInputError, eyec, "conflict in #data:", s_fn.c_str());
}
m.col_u(f_num+fx)->set(&v);
AzBytArr s_nm;
if (AzTools::isSpecified(str)) s_nm.c(str);
s_nm.c(names[fx]); s_nm.nl();
s_nm.writeText(&n_file);
}
n_file.close(true);
AzSmat m1;
m.transpose(&m1);
m1.writeText(out_x_fn, digits, doSparse);
}
示例6: dim
int dim() const {
return v_tar_dw.rowNum();
}
示例7: dataNum
inline int dataNum() const {
return v_tar_dw.rowNum();
}
示例8: copyPred_to
inline void copyPred_to(AzDvect *out_v_p) const {
out_v_p->reform(v_p.rowNum());
out_v_p->set(&v_p);
}