/* Copyright 2015-2022 Ian Jauslin Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "flow.h" #include #include #include "tools.h" #include "math.h" #include "definitions.cpp" #include "number.h" #include "array.h" #include "coefficient.h" #include "rcc.h" #include "grouped_polynomial.h" // compute flow numerically, no exponentials int numerical_flow(Grouped_Polynomial flow_equation, RCC init, Grouped_Polynomial postprocess_flow_equation, Labels labels, int niter, int display_mode){ // running coupling contants RCC rccs=init; // for printing RCC rcc_print; int i,j; // init printing rcc init_RCC(&rcc_print, rccs.length); if(display_mode==DISPLAY_NUMERICAL){ // print labels printf("%5s ","n"); for(j=0;j0){ // ignore constants for(j=0;j0){ RCC_cpy_noinit(rccs,&rcc_print); // ignore constants for(j=0;j0){ RCC_cpy_noinit(rccs,&rcc_print); // ignore constants for(j=0;j=0){ evalcoef(*rccs, flow_equation.coefs[i], new_rccs+i); } } // copy results to rccs for(i=0;i<(*rccs).length;i++){ (*rccs).values[i]=new_rccs[i]; } // free memory free(new_rccs); return(0); } // print the label of an rcc (takes constants and derivatives into account) int print_label(int index, Labels labels){ int i; int nderivs; int posin_labels; Char_Array label; // constant term if(index<0){ nderivs=-index/DOFFSET; for (i=0;i<12-nderivs;i++){ printf(" "); } for(i=0;i