#    pythonequations is a collection of equations expressed as Python classes
#    Copyright (C) 2008 James R. Phillips
#    2548 Vera Cruz Drive
#    Birmingham, AL 35235 USA
#    email: zunzun@zunzun.com
#
#    License: BSD-style (see LICENSE.txt in main source directory)
#    Version info: $Id: __init__.py 267 2010-09-25 13:25:43Z zunzun.com $

import pythonequations, pythonequations.EquationBaseClasses, pythonequations.ExtraCodeForEquationBaseClasses
import numpy
numpy.seterr(all = 'raise') # numpy raises warnings, convert to exceptions to trap them


class LinearExponential3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Linear Exponential"
    _HTML = "z = a + b*exp(x) + c*exp(y)"
    coefficientDesignatorTuple = ("a", "b", "c")
    LinearSSQSolverFlag = 1
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpY(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp += " + self.coefficientDesignatorTuple[0] + ";\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[1] + " * exp(x_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[2] + " * exp(y_in);\n"
        return s



class SimplifiedQuadraticExponential3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Simplified Quadratic Exponential"
    _HTML = "z = a + b*exp(x) + c*exp(y) + d*exp(x)<SUP>2</SUP> + f*exp(y)<SUP>2</SUP>"
    coefficientDesignatorTuple = ("a", "b", "c", "d", 'f')
    LinearSSQSolverFlag = 1
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpY(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpY(NameOrValueFlag=1, args=[2.0]), [2.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp += " + self.coefficientDesignatorTuple[0] + ";\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[1] + " * exp(x_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[2] + " * exp(y_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[3] + " * pow(exp(x_in), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[4] + " * pow(exp(y_in), 2.0);\n"
        return s



class FullQuadraticExponential3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Full Quadratic Exponential"
    _HTML = "z = a + b*exp(x) + c*exp(y) + d*exp(x)<SUP>2</SUP> + f*exp(y)<SUP>2</SUP> + g*exp(x)*exp(y)"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpY(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpX_ExpY(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp += " + self.coefficientDesignatorTuple[0] + ";\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[1] + " * exp(x_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[2] + " * exp(y_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[3] + " * pow(exp(x_in), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[4] + " * pow(exp(y_in), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[5] + " * exp(x_in) * exp(y_in);\n"
        return s



class SimplifiedCubicExponential3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Simplified Cubic Exponential"
    _HTML = "z = a + b*exp(x) + c*exp(y) + d*exp(x)<SUP>2</SUP> + e*exp(y)<SUP>2</SUP> + f*exp(x)<SUP>3</SUP> + g*exp(y)<SUP>3</SUP>"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g", "g")
    LinearSSQSolverFlag = 1
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i] + coeff[6] * _id[_cwo[6]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpY(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpX(NameOrValueFlag=1, args=[3.0]), [3.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpY(NameOrValueFlag=1, args=[3.0]), [3.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp += " + self.coefficientDesignatorTuple[0] + ";\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[1] + " * exp(x_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[2] + " * exp(y_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[3] + " * pow(exp(x_in), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[4] + " * pow(exp(y_in), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[3] + " * pow(exp(x_in), 3.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[4] + " * pow(exp(y_in), 3.0);\n"
        return s



class FullCubicExponential3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Full Cubic Exponential"
    _HTML = "z = a + b*exp(x) + c*exp(y) + d*exp(x)<SUP>2</SUP> + f*exp(y)<SUP>2</SUP> + g*exp(x)<SUP>3</SUP> + h*exp(y)<SUP>3</SUP> + i*exp(x)*exp(y) + j*exp(x)<SUP>2</SUP>*exp(y) + k*exp(x)*exp(y)<SUP>2</SUP>"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g", "h", "i", "j", 'k')
    LinearSSQSolverFlag = 1
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i] + coeff[6] * _id[_cwo[6]+i] + coeff[7] * _id[_cwo[7]+i] + coeff[8] * _id[_cwo[8]+i] + coeff[9] * _id[_cwo[9]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpY(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpX(NameOrValueFlag=1, args=[3.0]), [3.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpY(NameOrValueFlag=1, args=[3.0]), [3.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_ExpX_ExpY(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpX_PowExpY(NameOrValueFlag=1, args=[2.0, 1.0]), [2.0, 1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowExpX_PowExpY(NameOrValueFlag=1, args=[1.0, 2.0]), [1.0, 2.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp += " + self.coefficientDesignatorTuple[0] + ";\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[1] + " * exp(x_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[2] + " * exp(y_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[3] + " * pow(exp(x_in), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[4] + " * pow(exp(y_in), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[5] + " * pow(exp(x_in), 3.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[6] + " * pow(exp(y_in), 3.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[7] + " * exp(x_in) * exp(y_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[8] + " * pow(exp(x_in), 2.0) * exp(y_in);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[9] + " * exp(x_in) * pow(exp(y_in), 2.0);\n"
        return s



class LinearExponentialTransform3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Linear Exponential Transform"
    _HTML = "z = a + b*exp(d*x+f) + c*exp(g*y+h)"
    coefficientDesignatorTuple = ("a", "b", "c", 'd', 'f', 'g', 'h')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * exp(coeff[3]*_id[_cwo[0]+i]+coeff[4]) + coeff[2] * exp(coeff[5]*_id[_cwo[1]+i]+coeff[6]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Y(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp += " + self.coefficientDesignatorTuple[0] + ";\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[1] + " * exp(d * x_in + f);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[2] + " * exp(g * y_in + h);\n"
        return s



class SimplifiedQuadraticExponentialTransform3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Simplified Quadratic Exponential Transform"
    _HTML = "z = a + b*exp(g*x+h) + c*exp(i*y+j) + d*exp(g*x+h)<SUP>2</SUP> + f*exp(i*y+j)<SUP>2</SUP>"
    coefficientDesignatorTuple = ("a", "b", "c", "d", 'f', 'g', 'h', 'i', 'j')
    function_cpp_code = 'temp_x_sq = exp(coeff[5]*_id[_cwo[0]+i]+coeff[6]);'
    function_cpp_code += 'temp_y_sq = exp(coeff[7]*_id[_cwo[1]+i]+coeff[8]);'
    function_cpp_code += 'temp = coeff[0] + coeff[1] * temp_x_sq + coeff[2] * temp_y_sq + '
    function_cpp_code += 'coeff[3] * pow(temp_x_sq, 2.0) + coeff[4] * pow(temp_y_sq, 2.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Y(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp += " + self.coefficientDesignatorTuple[0] + ";\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[1] + " * exp(g * x_in + h);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[2] + " * exp(i * y_in + j);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[3] + " * pow(exp(g * x_in + h), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[4] + " * pow(exp(i * y_in + j), 2.0);\n"
        return s



class FullQuadraticExponentialTransform3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Full Quadratic Exponential Transform"
    _HTML = "z = a + b*exp(h*x+i) + c*exp(j*y+k) + d*exp(h*x+i)<SUP>2</SUP> + e*exp(j*y+k)<SUP>2</SUP> + f*exp(h*x+i)*exp(j*y+k)"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g", 'h', 'i', 'j', 'k')
    function_cpp_code = 'temp_x_sq = exp(coeff[6]*_id[_cwo[0]+i]+coeff[7]);'
    function_cpp_code += 'temp_y_sq = exp(coeff[8]*_id[_cwo[1]+i]+coeff[9]);'
    function_cpp_code += 'temp = coeff[0] + coeff[1] * temp_x_sq + coeff[2] * temp_y_sq + '
    function_cpp_code += 'coeff[3] * pow(temp_x_sq, 2.0) + coeff[4] * pow(temp_y_sq, 2.0) + '
    function_cpp_code += 'coeff[5] * temp_x_sq * temp_y_sq;'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Y(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp += " + self.coefficientDesignatorTuple[0] + ";\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[1] + " * exp(h * x_in + i);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[2] + " * exp(j * y_in + k);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[3] + " * pow(exp(h * x_in + i), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[4] + " * pow(exp(j * y_in + k), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[5] + " * exp(h * x_in + i) * exp(j * y_in + k);\n"
        return s



class SimplifiedCubicExponentialtransform3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Simplified Cubic Exponential Transform"
    _HTML = "z = a + b*exp(i*x+j) + c*exp(k*y+m) + d*exp(i*x+j)<SUP>2</SUP> + f*exp(k*y+m)<SUP>2</SUP> + g*exp(i*x+j)<SUP>3</SUP> + h*exp(k*y+m)<SUP>3</SUP>"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g", 'h', 'i', 'j', 'k', 'm')
    function_cpp_code = 'temp_x_sq = exp(coeff[7]*_id[_cwo[0]+i]+coeff[8]);'
    function_cpp_code += 'temp_y_sq = exp(coeff[9]*_id[_cwo[1]+i]+coeff[10]);'
    function_cpp_code += 'temp = coeff[0] + coeff[1] * temp_x_sq + coeff[2] * temp_y_sq + '
    function_cpp_code += 'coeff[3] * pow(temp_x_sq, 2.0) + coeff[4] * pow(temp_y_sq, 2.0) + '
    function_cpp_code += 'coeff[5] * pow(temp_x_sq, 3.0) + coeff[6] * pow(temp_y_sq, 3.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Y(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp += " + self.coefficientDesignatorTuple[0] + ";\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[1] + " * exp(i * x_in + j);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[2] + " * exp(k * y_in + m);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[3] + " * pow(exp(i * x_in + j), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[4] + " * pow(exp(k * y_in + m), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[5] + " * pow(exp(i * x_in + j), 3.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[6] + " * pow(exp(k * y_in + m), 3.0);\n"
        return s



class FullCubicExponentialTransform3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Full Cubic Exponential Transform"
    _HTML = "z = a + b*exp(m*x+n) + c*exp(o*y+p) + d*exp(m*x+n)<SUP>2</SUP> + f*exp(o*y+p)<SUP>2</SUP> + g*exp(m*x+n)<SUP>3</SUP> + h*exp(o*y+p)<SUP>3</SUP> + i*exp(m*x+n)*exp(o*y+p) + j*exp(m*x+n)<SUP>2</SUP>*exp(o*y+p) + k*exp(m*x+n)*exp(o*y+p)<SUP>2</SUP>"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g", "h", "i", "j", 'k', 'm', 'n', 'o', 'p')
    function_cpp_code = 'temp_x_sq = exp(coeff[10]*_id[_cwo[0]+i]+coeff[11]);'
    function_cpp_code += 'temp_y_sq = exp(coeff[12]*_id[_cwo[1]+i]+coeff[13]);'
    function_cpp_code += 'temp = coeff[0] + coeff[1] * temp_x_sq + coeff[2] * temp_y_sq + '
    function_cpp_code += 'coeff[3] * pow(temp_x_sq, 2.0) + coeff[4] * pow(temp_y_sq, 2.0) + '
    function_cpp_code += 'coeff[5] * pow(temp_x_sq, 3.0) + coeff[6] * pow(temp_y_sq, 3.0) + '
    function_cpp_code += 'coeff[7] * temp_x_sq * temp_y_sq + '
    function_cpp_code += 'coeff[8] * pow(temp_x_sq, 2.0) * temp_y_sq + coeff[9] * temp_x_sq * pow(temp_y_sq, 2.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Y(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp += " + self.coefficientDesignatorTuple[0] + ";\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[1] + " * exp(m * x_in + n);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[2] + " * exp(o * y_in + p);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[3] + " * pow(exp(m * x_in + n), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[4] + " * pow(exp(o * y_in + p), 2.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[5] + " * pow(exp(m * x_in + n), 3.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[6] + " * pow(exp(o * y_in + p), 3.0);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[7] + " * exp(m * x_in + n) * exp(o * y_in + p);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[8] + " * pow(exp(m * x_in + n), 2.0) * exp(o * y_in + p);\n"
        s += "\ttemp += " + self.coefficientDesignatorTuple[9] + " * exp(m * x_in + n) * pow(exp(o * y_in + p), 2.0);\n"
        return s
