Exemplo n.º 1
0
    public static Polynome1D operator *(Polynome1D a, Polynome1D b)
    {
        Polynome1D result = new Polynome1D();

        foreach (Term1D aTerm in a.m_xTerms)
        {
            foreach (Term1D bTerm in b.m_xTerms)
            {
                result.Add(aTerm * bTerm);
            }

            result.Add(aTerm * b.m_k);
        }

        foreach (Term1D bTerm in b.m_xTerms)
        {
            result.Add(a.m_k * bTerm);
        }

        result.m_k = a.m_k * b.m_k;

        return(result);
    }
Exemplo n.º 2
0
    public static Polynome1D operator +(Polynome1D a, Polynome1D b)
    {
        Debug.Log("NOT IMPLEMENTED : Polynome1D.Optimize()");
        Polynome1D result = new Polynome1D();

        result.m_xTerms = new List <Term1D>(a.m_xTerms);
        result.m_k      = a.m_k + b.m_k;
        foreach (Term1D xTerm in b.m_xTerms)
        {
            result.Add(xTerm);
        }

        return(result);
    }