File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ void parse_expression(const std::string& fn, std::vector<T>& vec)
4747{
4848 ModuleBase::TITLE (" Input_Conv" , " parse_expression" );
4949 int count = 0 ;
50- std::string pattern (" ([0-9]+\\ *[0-9.]+|[0-9,.]+)" );
50+ std::string pattern (" ([-+]?[ 0-9]+\\ *[-+]?[ 0-9.]+|[-+]? [0-9,.]+)" );
5151 std::vector<std::string> str;
5252 std::stringstream ss (fn);
5353 std::string section;
@@ -103,6 +103,7 @@ void parse_expression(const std::string& fn, std::vector<T>& vec)
103103 {
104104 size_t pos = sub_str.find (" *" );
105105 int num = stoi (sub_str.substr (0 , pos));
106+ assert (num>=0 );
106107 T occ = stof (sub_str.substr (pos + 1 , sub_str.size ()));
107108 // std::vector<double> ocp_temp(num, occ);
108109 // const std::vector<double>::iterator dest = vec.begin() + count;
You can’t perform that action at this time.
0 commit comments