本文整理汇总了C#中G25.generateOmInitCode方法的典型用法代码示例。如果您正苦于以下问题:C# G25.generateOmInitCode方法的具体用法?C# G25.generateOmInitCode怎么用?C# G25.generateOmInitCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G25
的用法示例。
在下文中一共展示了G25.generateOmInitCode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteSetVectorImages
//.........这里部分代码省略.........
List<G25.CG.Shared.Instruction>[] bladeI = new List<G25.CG.Shared.Instruction>[1 << S.m_dimension];
{
bool mustCast = false;
int nbTabs = 1;
string dstName = (S.OutputC()) ? G25.fgs.RETURN_ARG_NAME : SmvUtil.THIS;
bool dstPtr = S.OutputCppOrC();
bool declareDst = false;
for (int g = 1; g < gom.Domain.Length; g++)
{
for (int d = 0; d < gom.DomainForGrade(g).Length; d++)
{
G25.SMVOM smvOM = gom.DomainSmvForGrade(g)[d];
RefGA.BasisBlade domainBlade = gom.DomainForGrade(g)[d];
if (g > 1)
{
bladeI[domainBlade.bitmap] = new List<G25.CG.Shared.Instruction>();
string funcCallCode = funcNames[g] + "_" + d + "(";
if (S.OutputC()) funcCallCode += G25.fgs.RETURN_ARG_NAME;
funcCallCode += ");";
mainI.Add(new G25.CG.Shared.VerbatimCodeInstruction(nbTabs, funcCallCode));
}
// follow the plan
RefGA.Multivector value = new RefGA.Multivector(signs[g][d]);
uint[] P = plan[g][d];
for (int p = 0; p < P.Length; p++)
value = RefGA.Multivector.op(value, symbolicBBvalues[P[p]]);
// add instructions
List<G25.CG.Shared.Instruction> I = (g == 1) ? mainI : bladeI[domainBlade.bitmap];
I.Add(new G25.CG.Shared.CommentInstruction(nbTabs, "Set image of " + domainBlade.ToString(S.m_basisVectorNames)));
I.Add(new G25.CG.Shared.AssignInstruction(nbTabs, smvOM, FT, mustCast, value, dstName, dstPtr, declareDst));
// store symbolic value
symbolicBBvalues[domainBlade.bitmap] = G25.CG.Shared.Symbolic.SMVtoSymbolicMultivector(S, smvOM, dstName, dstPtr);
}
}
}
// output grade > 1 functions
if (cgd.generateOmInitCode(FT.type))
{
for (int g = 2; g < gom.Domain.Length; g++)
{
for (int d = 0; d < gom.DomainForGrade(g).Length; d++)
{
RefGA.BasisBlade domainBlade = gom.DomainForGrade(g)[d];
string funcName = funcNames[g] + "_" + d;
G25.fgs F = new G25.fgs(funcName, funcName, "", new string[0], new string[0], new string[] { FT.type }, null, null, null); // null, null = metricName, comment, options
//F.InitArgumentPtrFromTypeNames(S);
bool computeMultivectorValue = false;
G25.CG.Shared.FuncArgInfo returnArgument = null;
if (S.OutputC())
returnArgument = new G25.CG.Shared.FuncArgInfo(S, F, -1, FT, gom.Name, computeMultivectorValue);
int nbArgs = 0;
G25.CG.Shared.FuncArgInfo[] FAI = G25.CG.Shared.FuncArgInfo.GetAllFuncArgInfo(S, F, nbArgs, FT, S.m_GMV.Name, computeMultivectorValue);
Comment comment;
comment = new Comment("Sets grade " + g + " part of outermorphism matrix based on lower grade parts.");
bool inline = false; // do not inline this potentially huge function
bool staticFunc = false;
bool writeDecl = S.OutputC();
G25.CG.Shared.Functions.WriteFunction(S, cgd, F, inline, staticFunc, "void", funcName, returnArgument, FAI, bladeI[domainBlade.bitmap], comment, writeDecl);
}
}
}
{ // output grade 1 function
G25.fgs F = new G25.fgs(funcNames[1], funcNames[1], "", argTypes, argNames, new string[] { FT.type }, null, null, null); // null, null = metricName, comment, options
F.InitArgumentPtrFromTypeNames(S);
if (matrixMode)
{
F.m_argumentPtr[0] = S.OutputCppOrC();
F.m_argumentArr[0] = S.OutputCSharpOrJava();
}
bool computeMultivectorValue = false;
G25.CG.Shared.FuncArgInfo returnArgument = null;
if (S.OutputC())
returnArgument = new G25.CG.Shared.FuncArgInfo(S, F, -1, FT, gom.Name, computeMultivectorValue);
G25.CG.Shared.FuncArgInfo[] FAI = G25.CG.Shared.FuncArgInfo.GetAllFuncArgInfo(S, F, NB_ARGS, FT, S.m_GMV.Name, computeMultivectorValue);
Comment comment;
if (!matrixMode) comment = new Comment("Sets " + typeName + " from images of the domain vectors.");
else comment = new Comment("Sets " + typeName + " from a " + (transpose ? "transposed " : "") + "matrix");
bool inline = false; // do not inline this potentially huge function
bool staticFunc = false;
bool writeDecl = S.OutputC();
G25.CG.Shared.Functions.WriteFunction(S, cgd, F, inline, staticFunc, "void", funcNames[1], returnArgument, FAI, mainI, comment, writeDecl);
}
}