Import Geant4 11.4.0 source tree
This commit is contained in:
-67
@@ -10,7 +10,6 @@
|
||||
#include "cids"
|
||||
#include "touplow"
|
||||
#include "forit"
|
||||
#include "mnmx"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -70,14 +69,6 @@ public:
|
||||
public:
|
||||
virtual void stop() {}
|
||||
public:
|
||||
size_t number_of_columns() const {return columns().size();}
|
||||
|
||||
void column_names(std::vector<std::string>& a_names) const {
|
||||
a_names.clear();
|
||||
const std::vector<icol*>& _cols = columns();
|
||||
tools_vforcit(icol*,_cols,it) a_names.push_back((*it)->name());
|
||||
}
|
||||
|
||||
icol* find_icol_case_insensitive(const std::string& a_name) { //for gopaw and exlib::evaluator.
|
||||
std::string low_a_name = a_name;
|
||||
tolowercase(low_a_name);
|
||||
@@ -106,64 +97,6 @@ public:
|
||||
return a_col?true:false;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool column_is_of_type(const std::string& a_name,bool& a_is,bool a_case_sensitive = true) {
|
||||
icol* col = a_case_sensitive ? find_icol(a_name) : find_icol_case_insensitive(a_name);
|
||||
if(!col) {a_is = false;return false;}
|
||||
a_is = id_cast<icol, icolumn<T> >(*col)?true:false;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool column_min(unsigned int a_col,T& a_value) {
|
||||
a_value = T();
|
||||
const std::vector<icol*>& cols = columns();
|
||||
if(cols.empty()) return false;
|
||||
if(a_col>=cols.size()) return false;
|
||||
icol* _base_col = cols[a_col];
|
||||
icolumn<T>* _col = id_cast<icol, icolumn<T> >(*_base_col);
|
||||
if(!_col) return false;
|
||||
uint64 _rows;
|
||||
if(!number_of_entries(_rows)) return false;
|
||||
start();
|
||||
T v;
|
||||
{for(uint64 row=0;row<_rows;row++) {
|
||||
if(!next()) {a_value = T();return false;}
|
||||
if(!_col->get_entry(v)) {}
|
||||
if(!row) {
|
||||
a_value = v;
|
||||
} else {
|
||||
a_value = mn<T>(a_value,v);
|
||||
}
|
||||
}}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool column_max(unsigned int a_col,T& a_value) {
|
||||
a_value = T();
|
||||
const std::vector<icol*>& cols = columns();
|
||||
if(cols.empty()) return false;
|
||||
if(a_col>=cols.size()) return false;
|
||||
icol* _base_col = cols[a_col];
|
||||
icolumn<T>* _col = id_cast<icol, icolumn<T> >(*_base_col);
|
||||
if(!_col) return false;
|
||||
uint64 _rows;
|
||||
if(!number_of_entries(_rows)) return false;
|
||||
start();
|
||||
T v;
|
||||
{for(uint64 row=0;row<_rows;row++) {
|
||||
if(!next()) {a_value = T();return false;}
|
||||
if(!_col->get_entry(v)) {}
|
||||
if(!row) {
|
||||
a_value = v;
|
||||
} else {
|
||||
a_value = mx<T>(a_value,v);
|
||||
}
|
||||
}}
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user