本文整理汇总了C++中AzObjPtrArray类的典型用法代码示例。如果您正苦于以下问题:C++ AzObjPtrArray类的具体用法?C++ AzObjPtrArray怎么用?C++ AzObjPtrArray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AzObjPtrArray类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reset
void reset() {
a_dense.free(&arrd);
a_sparse.free(&arrs);
f_num = 0;
ia_isActive.reset();
active_num = 0;
}
示例2: _release
inline void _release() {
a_tree.free(&t); t_num = 0;
s_config.reset();
s_sign.reset();
const_val = 0;
org_dim = -1;
}
示例3: reset
inline void reset() {
a_tree.free(&t); t_num = 0;
const_val = 0;
org_dim = -1;
s_param.reset();
dt_param = "";
temp_files.reset();
}
示例4: warm_start
void warm_start(const AzTreeEnsemble *inp_ens,
const AzDataForTrTree *data,
AzParam ¶m,
const AzBytArr *s_temp_prefix,
const AzOut &out,
int max_t_num,
int search_t_num,
AzDvect *v_p, /* inout */
const AzIntArr *inp_ia_tr_dx=NULL)
{
const char *eyec = "AzTrTreeEnsemble::warmup";
if (max_t_num < inp_ens->size()) {
throw new AzException(eyec, "maximum #tree is less than the #tree we already have");
}
reset();
a_tree.alloc(&t, max_t_num, "AzTrTreeEnsemble::warmup");
t_num = inp_ens->size();
const_val = inp_ens->constant();
org_dim = inp_ens->orgdim();
if (org_dim > 0 && org_dim != data->featNum()) {
throw new AzException(AzInputError, eyec, "feature dimensionality mismatch");
}
const AzIntArr *ia_tr_dx = inp_ia_tr_dx;
AzIntArr ia_temp;
if (ia_tr_dx == NULL) {
ia_temp.range(0, data->dataNum());
ia_tr_dx = &ia_temp;
}
v_p->reform(data->dataNum());
v_p->add(const_val, ia_tr_dx);
T dummy_tree(param);
if (dummy_tree.usingInternalNodes()) {
throw new AzException(AzInputError, eyec,
"warm start is not allowed with use of internal nodes");
}
dummy_tree.printParam(out);
temp_files.reset(&dummy_tree, data->dataNum(), s_temp_prefix);
s_param.reset(param.c_str());
dt_param = s_param.c_str();
AzParam p(dt_param, false);
int tx;
for (tx = 0; tx < t_num; ++tx) {
t[tx] = new T(p);
t[tx]->forStoringDataIndexes(temp_files.point_file());
if (search_t_num > 0 && tx < t_num-search_t_num) {
t[tx]->quick_warmup(inp_ens->tree(tx), data, v_p, ia_tr_dx);
}
else {
t[tx]->warmup(inp_ens->tree(tx), data, v_p, ia_tr_dx);
}
}
}
示例5: copy_nodes_from
//! copy nodes only; not split
void copy_nodes_from(const AzTrTreeEnsemble_ReadOnly *inp) {
reset();
const_val = inp->constant();
org_dim = inp->orgdim();
t_num = inp->size();
s_param.reset(inp->param_c_str());
dt_param = s_param.c_str();
AzParam p(dt_param, false);
a_tree.alloc(&t, t_num, "AzTrTreeEnsemble::copy_nodes_from");
for (int tx = 0; tx < t_num; ++tx) {
t[tx] = new T(p);
t[tx]->copy_nodes_from(inp->tree(tx));
}
}
示例6: AzException
virtual
T *new_tree(int *out_tx=NULL) {
if (t_num >= a_tree.size()) {
throw new AzException("AzTrTreeEnsemble::new_tree", "no more empty slot");
}
int tx = t_num;
if (t[tx] != NULL) {
throw new AzException("AzTrTreeEnsemble::new_tree", "something is wrong");
}
AzParam p(dt_param, false);
t[tx] = new T(p);
t[tx]->forStoringDataIndexes(temp_files.point_file());
++t_num;
if (out_tx != NULL) {
*out_tx = tx;
}
return t[tx];
}
示例7: alloc
/** @ alloc the Tree pointer array*/
inline void alloc(int num, const char *msg="") {
a_tree.alloc(&t, num, "AzTrTreeEnsemble::alloc", msg);
}
示例8: isFull
inline bool isFull() const {
if (t_num >= a_tree.size()) {
return true;
}
return false;
}
示例9: max_size
inline int max_size() const { return a_tree.size(); }
示例10: _release
void _release() {
a.free(&column); col_num = 0;
row_num = 0;
}
示例11: _release
void _release() {
checkLock("_release");
a.free(&column); col_num = 0;
row_num = 0;
dummy_zero.reform(0);
}