本文整理汇总了C++中vector_double::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ vector_double::clear方法的具体用法?C++ vector_double::clear怎么用?C++ vector_double::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vector_double
的用法示例。
在下文中一共展示了vector_double::clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: skyflux
void harp::spec_desisim::values ( vector_double & data ) const {
data.resize ( nglobal_ );
data.clear();
fitsfile * fp;
fits::open_read ( fp, path_ );
// read the object flux
fits::img_seek ( fp, objhdu_ );
fits::img_read ( fp, data, false );
// read the sky flux and sum
vector_double skyflux ( data.size() );
fits::img_seek ( fp, skyhdu_ );
fits::img_read ( fp, skyflux, false );
fits::close ( fp );
for ( size_t i = 0; i < data.size(); ++i ) {
data[i] += skyflux[i];
}
return;
}
示例2:
void harp::spec_sim::inv_variance ( vector_double & data ) const {
data.resize ( size_ );
data.clear();
return;
}
示例3: column_norm
void harp::column_norm ( matrix_double const & mat, vector_double & S ) {
S.resize( mat.size1() );
S.clear();
for ( size_t i = 0; i < mat.size2(); ++i ) {
for ( size_t j = 0; j < mat.size1(); ++j ) {
S[ j ] += mat( j, i );
}
}
// Invert
for ( size_t i = 0; i < S.size(); ++i ) {
S[i] = 1.0 / S[i];
}
return;
}
示例4:
void harp::spec_desisim::sky ( vector_double & data ) const {
data.resize ( nglobal_ );
data.clear();
fitsfile * fp;
fits::open_read ( fp, path_ );
// read the sky flux
fits::img_seek ( fp, skyhdu_ );
fits::img_read ( fp, data, false );
fits::close ( fp );
return;
}