Skip to content

Commit

Permalink
simplify prototype generation for self-energies
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Dec 16, 2016
1 parent 86cd948 commit 89adb9b
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions meta/SelfEnergies.m
Expand Up @@ -403,22 +403,14 @@
CreateFunctionName[tadpole_SelfEnergies`Tadpole] :=
CreateTadpoleFunctionName[GetField[tadpole]];

CreateFunctionPrototype[selfEnergy_SelfEnergies`FSSelfEnergy] :=
CreateFunctionName[selfEnergy] <>
"(" <> CreateCType[CConversion`ScalarType[CConversion`realScalarCType]] <> " p " <> DeclareFieldIndices[GetField[selfEnergy]] <> ") const";

CreateFunctionPrototype[selfEnergy_SelfEnergies`FSHeavySelfEnergy] :=
CreateFunctionName[selfEnergy] <>
"(" <> CreateCType[CConversion`ScalarType[CConversion`realScalarCType]] <> " p " <> DeclareFieldIndices[GetField[selfEnergy]] <> ") const";

CreateFunctionPrototype[selfEnergy_SelfEnergies`FSHeavyRotatedSelfEnergy] :=
CreateFunctionName[selfEnergy] <>
"(" <> CreateCType[CConversion`ScalarType[CConversion`realScalarCType]] <> " p " <> DeclareFieldIndices[GetField[selfEnergy]] <> ") const";

CreateFunctionPrototype[tadpole_SelfEnergies`Tadpole] :=
CreateFunctionName[tadpole] <>
"(" <> DeclareFieldIndices[GetField[tadpole]] <> ") const";

CreateFunctionPrototype[selfEnergy_] :=
CreateFunctionName[selfEnergy] <>
"(" <> CreateCType[CConversion`ScalarType[CConversion`realScalarCType]] <> " p " <> DeclareFieldIndices[GetField[selfEnergy]] <> ") const";

ExpressionToStringSequentially[expr_Plus, heads_, result_String] :=
StringJoin[(result <> " += " <> ExpressionToString[#,heads] <> ";\n")& /@ (List @@ expr)];

Expand Down

0 comments on commit 89adb9b

Please sign in to comment.