Import Geant4 10.7.0 source tree

This commit is contained in:
Gabriele Cosmo
2020-12-04 12:30:43 +01:00
parent 67ba86d073
commit dab42d2018
3770 changed files with 226369 additions and 286486 deletions
+30 -30
View File
@@ -10,28 +10,28 @@ inline bool value::assign(value& aThis,const value& aV,std::string& aError){
aThis.u.m_string = new std::string(*aV.u.m_string);
//} else if(aV.m_type==value::ARRAY_UNSIGNED_CHAR) {
// aThis.u.m_array_unsigned_char =
// aThis.u.m_array_unsigned_char =
// new array<unsigned char>(*aV.u.m_array_unsigned_char);
//} else if(aV.m_type==value::ARRAY_CHAR) {
// aThis.u.m_array_char = new array<char>(*aV.u.m_array_char);
} else if(aV.m_type==value::ARRAY_UNSIGNED_SHORT) {
aThis.u.m_array_unsigned_short =
aThis.u.m_array_unsigned_short =
new array<unsigned short>(*aV.u.m_array_unsigned_short);
} else if(aV.m_type==value::ARRAY_SHORT) {
aThis.u.m_array_short = new array<short>(*aV.u.m_array_short);
} else if(aV.m_type==value::ARRAY_UNSIGNED_INT) {
aThis.u.m_array_unsigned_int =
aThis.u.m_array_unsigned_int =
new array<unsigned int>(*aV.u.m_array_unsigned_int);
} else if(aV.m_type==value::ARRAY_INT) {
aThis.u.m_array_int = new array<int>(*aV.u.m_array_int);
} else if(aV.m_type==value::ARRAY_UNSIGNED_INT64) {
aThis.u.m_array_unsigned_int64 =
aThis.u.m_array_unsigned_int64 =
new array<uint64>(*aV.u.m_array_unsigned_int64);
} else if(aV.m_type==value::ARRAY_INT64) {
aThis.u.m_array_int64 =
aThis.u.m_array_int64 =
new array<int64>(*aV.u.m_array_int64);
} else if(aV.m_type==value::ARRAY_FLOAT) {
@@ -42,7 +42,7 @@ inline bool value::assign(value& aThis,const value& aV,std::string& aError){
aThis.u.m_array_bool = new array<bool>(*aV.u.m_array_bool);
} else if(aV.m_type==value::ARRAY_STRING) {
aThis.u.m_array_string =
aThis.u.m_array_string =
new array<std::string>(*aV.u.m_array_string);
} else {
@@ -313,7 +313,7 @@ inline bool value::assign(value& aThis,const value& aV,std::string& aError){
break;
}
aError = std::string("value::assign :")
+ " unable to assign " + aV.stype()
+ " unable to assign " + aV.stype()
+ " to " + aThis.stype();
aThis.set_none();
return false;
@@ -1012,7 +1012,7 @@ inline bool value::subtract(value& aThis,const value& aV,std::string& aError){
std::vector<double>& stdv = aThis.u.m_array_double->vector();
const std::vector<double>& stdv2 = aV.u.m_array_double->vector();
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
for(size_t index=0;index<number;index++) {
stdv[index] -= stdv2[index];
}
return true;}
@@ -1314,7 +1314,7 @@ inline bool value::multiply(value& aThis,const value& aV,std::string& aError){
std::vector<double>& stdv = aThis.u.m_array_double->vector();
const std::vector<double>& stdv2 = aV.u.m_array_double->vector();
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
for(size_t index=0;index<number;index++) {
stdv[index] *= stdv2[index];
}
return true;}
@@ -1797,7 +1797,7 @@ inline bool value::divide(value& aThis,const value& aV,std::string& aError){
const std::vector<double>& stdv2 = aV.u.m_array_double->vector();
bool has_div_zero = false;
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
for(size_t index=0;index<number;index++) {
if(stdv2[index]==0) {
//FIXME : stdv[index] = nan;
stdv[index] = 0; //PAW convention.
@@ -2252,7 +2252,7 @@ inline bool value::if_gt(value& aThis,const value& aV,std::string& aError){
break;
}
aError = std::string("Value::if_gt() :")
+ " can't compare type " + value::stype(oType)
+ " can't compare type " + value::stype(oType)
+ " with type " + aV.stype();
aThis.set_none();
return false;
@@ -2734,7 +2734,7 @@ inline bool value::if_eq(value& aThis,const value& aV,std::string& aError){
break;
}
aError = std::string("Value::if_eq() :")
+ " can't compare type " + value::stype(oType)
+ " can't compare type " + value::stype(oType)
+ " with type " + aV.stype();
aThis.set_none();
return false;
@@ -2810,7 +2810,7 @@ inline bool value::if_and(value& aThis,const value& aV,std::string& aError){
break;
}
aError = std::string("Value::if_and :")
+ " can't apply on type " + value::stype(oType)
+ " can't apply on type " + value::stype(oType)
+ " and type " + aV.stype();
aThis.set_none();
return false;
@@ -2886,7 +2886,7 @@ inline bool value::if_or(value& aThis,const value& aV,std::string& aError){
break;
}
aError = std::string("Value::if_or :")
+ " can't apply on type " + value::stype(oType)
+ " can't apply on type " + value::stype(oType)
+ " and type " + aV.stype();
aThis.set_none();
return false;
@@ -2953,46 +2953,46 @@ inline bool value::to_double(const value& aThis,double& aValue){
inline bool value::cxx_type(const value& aThis,std::string& aValue){
switch(aThis.m_type) {
case value::INT:
case value::INT:
aValue = "int";
return true;
case value::DOUBLE:
case value::DOUBLE:
aValue = "double";
return true;
case value::STRING:
case value::STRING:
aValue = "std::string";
return true;
case value::BOOL:
case value::BOOL:
aValue = "bool";
return true;
case value::SHORT:
case value::SHORT:
aValue = "short";
return true;
case value::FLOAT:
case value::FLOAT:
aValue = "float";
return true;
//case value::CHAR:
//case value::CHAR:
// aValue = "char";
// return true;
//case value::UNSIGNED_CHAR:
//case value::UNSIGNED_CHAR:
// aValue = "unsigned char";
// return true;
case value::UNSIGNED_SHORT:
case value::UNSIGNED_SHORT:
aValue = "unsigned short";
return true;
case value::UNSIGNED_INT:
case value::UNSIGNED_INT:
aValue = "unsigned int";
return true;
case value::VOID_STAR:
case value::VOID_STAR:
aValue = "void*";
return true;
case value::DOUBLE_STAR:
case value::DOUBLE_STAR:
aValue = "double*";
return true;
case value::FLOAT_STAR:
case value::FLOAT_STAR:
aValue = "float*";
return true;
case value::INT_STAR:
case value::INT_STAR:
aValue = "int*";
return true;
case value::NONE:
@@ -3096,7 +3096,7 @@ inline bool value::i_set(value& aThis,const Slash::Core::IValue& aValue){
return true;}
case value::ARRAY_UNSIGNED_SHORT:
{std::vector<unsigned int> is;
const std::vector<unsigned short>& vd =
const std::vector<unsigned short>& vd =
aValue.get_array_unsigned_short(is);
aThis.u.m_array_unsigned_short = new array<unsigned short>();
if(!aThis.u.m_array_unsigned_short->configure(is)){
@@ -3286,7 +3286,7 @@ inline std::string value::to_string(const value& aThis){
if(!nums2s<std::string>(aThis.u.m_array_string->vector(),s)) {}
return s;
default:
return "unknow"; //it should not happen.
return "unknown"; //it should not happen.
}
}