I would like to extract the integer part of a real variable. To be more specific, given a vector alpha
I would like to extract the integer part of (||alpha||+Pi)/(2*Pi)
:
Get["AceGen`"];
SMSInitialize["GetFloor", "Language" -> "C"];
SMSModule["GetFloor", Real[alpha$$[3], floor$$]];
α ⊨ Table[SMSReal[alpha$$[i]], {i, 1, 3}];
GetFloor[α_] := Module[
{normα},
normα ⊨ SMSSqrt[α . α];
SMSInteger[IntegerPart[N[normα + Pi/(2*Pi)]]]
];
SMSExport[GetFloor[α], floor$$];
SMSWrite[];
FilePrint["GetFloor.c"];
I checked in the C code produced and the instruction IntegerPart seems skipped by Acegen.
Is what I am trying to do possible at all in AceGen ? If so, what would be the syntax ?
AceGen
could help? $\endgroup$ – Somos Jan 5 '19 at 21:52