Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse_file.c')
-rw-r--r--src/parse_file.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/parse_file.c b/src/parse_file.c
index 6054372..19b91c6 100644
--- a/src/parse_file.c
+++ b/src/parse_file.c
@@ -44,16 +44,17 @@ limitations under the License.
#define PP_EXTERNAL_MODE 8
#define PP_INTERNAL_MODE 9
#define PP_FERMIONS_MODE 10
+#define PP_NONCOMMUTING_MODE 11
// indices
-#define PP_INDEX_MODE 11
+#define PP_INDEX_MODE 12
// factors or monomials
-#define PP_BRACKET_MODE 12
+#define PP_BRACKET_MODE 13
// labels
-#define PP_LABEL_MODE 13
+#define PP_LABEL_MODE 14
// polynomial
-#define PP_POLYNOMIAL_MODE 14
+#define PP_POLYNOMIAL_MODE 15
// group
-#define PP_GROUP_MODE 15
+#define PP_GROUP_MODE 16
// parse fields list
@@ -101,6 +102,11 @@ int parse_input_fields(Char_Array str_fields, Fields_Table* fields){
mode=PP_FERMIONS_MODE;
}
break;
+ case 'a':
+ if(mode==PP_NULL_MODE){
+ mode=PP_NONCOMMUTING_MODE;
+ }
+ break;
// reset buffer
case ':':
@@ -123,6 +129,9 @@ int parse_input_fields(Char_Array str_fields, Fields_Table* fields){
else if(mode==PP_FERMIONS_MODE){
int_array_append(i,&((*fields).fermions));
}
+ else if(mode==PP_NONCOMMUTING_MODE){
+ int_array_append(i,&((*fields).noncommuting));
+ }
buffer_ptr=buffer;
*buffer_ptr='\0';
break;
@@ -142,6 +151,9 @@ int parse_input_fields(Char_Array str_fields, Fields_Table* fields){
else if(mode==PP_FERMIONS_MODE){
int_array_append(i,&((*fields).fermions));
}
+ else if(mode==PP_NONCOMMUTING_MODE){
+ int_array_append(i,&((*fields).noncommuting));
+ }
mode=PP_NULL_MODE;
break;
@@ -417,7 +429,7 @@ int parse_input_identities(Char_Array str_identities, Fields_Table* fields){
(*fields).ids.length=0;
for(i=0;i<tmp;i++){
sign=1;
- monomial_sort((*fields).ids.lhs[i], 0, (*fields).ids.lhs[i].length-1, *fields, &sign);
+ monomial_sort((*fields).ids.lhs[i], *fields, &sign);
polynomial_simplify((*fields).ids.rhs+i, *fields);
polynomial_multiply_Qscalar((*fields).ids.rhs[i],quot(sign,1));
}