示例#1
0
        private static string GetFullCode()
        {
            PermutationGenerator result = new PermutationGenerator();

            AppendTTFunc(result, "abs", "fabs");
            AppendTTFunc(result, "neg", "-");
            AppendTTFunc(result, "sign", "sgn");

            AppendTTFunc(result, "sqrt", "sqrtf");
            AppendTTFunc(result, "rsqrt", "rsqrtf");

            AppendTTFunc(result, "exp", "expf");
            AppendTTFunc(result, "log", "logf");
            AppendTTFunc(result, "log1p", "log1p");
            AppendTTFunc(result, "floor", "floor");
            AppendTTFunc(result, "ceil", "ceil");
            AppendTTFunc(result, "round", "round");
            AppendTTFunc(result, "trunc", "trunc");
            AppendTTFunc(result, "frac", "Frac");

            AppendTTTTTFunc(result, "mulmuladd", "MulMulAdd");
            AppendTTTTFunc(result, "addmul", "AddMul");
            AppendTTTSFunc(result, "addmulv", "AddMul");

            AppendTTTTFunc(result, "adddiv", "AddDiv");

            AppendTTTSFunc(result, "maskfill", "MaskFill");

            result.AddApplyTS("t1_pow", "*a = powf(*a, b);");
            result.AddApplyTTS("t2_pow", "*a = powf(*b, c);");
            result.AddApplyTS("t1_tpow", "*a = powf(b, *a);");
            result.AddApplyTTS("t2_tpow", "*a = powf(c, *b);");

            result.AddApplyTTTS("lerp", "*a = Lerp(*b, *c, d);");

            result.AddApplyTSS("t1_clamp", "*a = Clamp(*a, b, c);");
            result.AddApplyTTSS("t2_clamp", "*a = Clamp(*b, c, d);");

            return(result.ToString());
        }