本文整理汇总了C++中AzBytArr类的典型用法代码示例。如果您正苦于以下问题:C++ AzBytArr类的具体用法?C++ AzBytArr怎么用?C++ AzBytArr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AzBytArr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reset
void reset(T *tree,
int data_num,
const AzBytArr *inp_s_temp_prefix) {
reset();
if (inp_s_temp_prefix == NULL || inp_s_temp_prefix->length() <= 0) {
return;
}
s_temp_prefix.reset(inp_s_temp_prefix);
unit_size = tree->estimateSizeofDataIndexes(data_num);
if (unit_size <= 0) {
return;
}
if (unit_size > max_size) {
throw new AzException(AzInputError, "AzTemp_forTrTreeEns::reset",
"Data size is too large.");
}
open_new_file();
}
示例2: show_stat
virtual void show_stat(AzBytArr &s) const {
if (p.typ == AzpActivDflt_None) return;
if (!p.do_stat) return;
AzDvect my_v_pop(&v_pop_last);
my_v_pop.normalize1();
s.nl();
double accum = 0;
int ix;
for (ix = 0; ix < my_v_pop.rowNum(); ++ix) {
accum += my_v_pop.get(ix);
s.c("b"); s.cn(v_border.get(ix)); s.c("="); s.cn(my_v_pop.get(ix),3); s.c("("); s.cn(accum,3); s.c("),");
}
}
示例3: if
/*--------------------------------------------------------*/
void AzTreeEnsemble::show_weights(const AzOut &out, AzSvFeatInfo *fi) const
{
AzIIFarr iifa_tx_nx_posiw, iifa_tx_nx_negaw;
int tx;
for (tx = 0; tx < t_num; ++tx) {
int nx;
for (nx = 0; nx < t[tx]->nodeNum(); ++nx) {
const AzTreeNode *np = t[tx]->node(nx);
if (np->weight > 0) {
iifa_tx_nx_posiw.put(tx, nx, np->weight);
}
else if (np->weight < 0) {
iifa_tx_nx_negaw.put(tx, nx, np->weight);
}
}
}
iifa_tx_nx_posiw.sort_Float(false); /* descending order */
iifa_tx_nx_negaw.sort_Float(true); /* ascending order */
AzPrint::writeln(out, "Positive weights -------------------");
int ix;
for (ix = 0; ix < iifa_tx_nx_posiw.size(); ++ix) {
int tx, nx;
double w = iifa_tx_nx_posiw.get(ix, &tx, &nx);
AzBytArr s_desc;
t[tx]->genDesc(fi, nx, &s_desc);
AzBytArr s; s.cn(w, 6, false); s.c(' '); s.c(&s_desc);
AzPrint::writeln(out, s);
}
AzPrint::writeln(out, "Negative weights -------------------");
for (ix = 0; ix < iifa_tx_nx_negaw.size(); ++ix) {
int tx, nx;
double w = iifa_tx_nx_negaw.get(ix, &tx, &nx);
AzBytArr s_desc;
t[tx]->genDesc(fi, nx, &s_desc);
AzBytArr s; s.cn(w, 6, false); s.c(' '); s.c(&s_desc);
AzPrint::writeln(out, s);
}
}
示例4: print_space
inline void print_space(int len) {
AzBytArr s; s.fill(' ', len);
print(s);
}
示例5: writeln
static inline void writeln(const AzOut &out, const AzBytArr &s) {
writeln(out, s.c_str());
}
示例6: inParen
inline void inParen(const AzBytArr &s) {
if (o == NULL) return;
inParen(s.c_str());
}
示例7: inBrackets
inline void inBrackets(int val, int width=-1, bool doFillZero=false) {
if (o == NULL) return;
itemBegin();
AzBytArr s; inBrackets(&s, val, width, doFillZero);
*o<<s.c_str();
}
示例8: printV_if_not_empty
inline void printV_if_not_empty(const char *kw, const AzBytArr &s) {
if (o == NULL) return;
if (s.length() <= 0) return;
itemBegin();
*o<<kw<<s.c_str();
}
示例9: throw_if_empty
void throw_if_empty(const char *kw, const AzBytArr &s) const {
if (s.length() <= 0) throw new AzException(AzInputError, "AzsLinear::resetParam", kw, "must be specified.");
}
示例10: print
inline static void print(int number, const char *msg, const AzOut &out) {
AzBytArr s; s.cn(number);
print(s.c_str(), msg, out);
}
示例11: printV
inline void printV(const char *kw, const AzBytArr &s) {
if (o == NULL) return;
itemBegin();
*o<<kw<<s.c_str();
}
示例12: print
/*-------------------*/
inline void print(const AzBytArr &s) {
if (o == NULL) return;
print(s.c_str());
}
示例13: reset
inline void reset(const AzTreeRule *inp) {
ba.reset();
if (inp == NULL) return;
ba.reset(&inp->ba);
}
示例14: reset
void reset() {
unit_size = -1;
s_temp_prefix.reset();
pool_file.reset();
}
示例15:
inline const char *param_c_str() const {
return s_param.c_str();
}