Exemplo n.º 1
0
    public virtual Algebraic map(LambdaAlgebraic lambda, Algebraic arg)
    {
        if (arg == null)
        {
            var r = lambda.f_exakt(this);

            if (r != null)
            {
                return(r);
            }

            var fname = lambda.GetType().Name;

            if (fname.StartsWith("Lambda", StringComparison.Ordinal))
            {
                fname = fname.Substring("Lambda".Length);
                fname = fname.ToLower();

                return(FunctionVariable.create(fname, this));
            }

            throw new JasymcaException("Wrong type of arguments.");
        }

        return(lambda.f_exakt(this, arg));
    }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public Algebraic map(LambdaAlgebraic f) throws JasymcaException
    public override Algebraic map(LambdaAlgebraic f)
    {
        Algebraic x = v is SimpleVariable ? new Polynomial(v): FunctionVariable.create(((FunctionVariable)v).fname, f.f_exakt(((FunctionVariable)v).arg));
        Algebraic r = Zahl.ZERO;

        for (int i = a.Length - 1; i > 0; i--)
        {
            r = r.add(f.f_exakt(a[i])).mult(x);
        }
        if (a.Length > 0)
        {
            r = r.add(f.f_exakt(a[0]));
        }
        return(r);
    }
Exemplo n.º 3
0
    public override Algebraic value(Variable @var, Algebraic x)
    {
        if (Equals(@var))
        {
            return(x);
        }
        else
        {
            x = arg.value(@var, x);

            Algebraic r = la.f_exakt(x);

            if (r != null)
            {
                return(r);
            }

            if (x is Unexakt)
            {
                return(la.f(( Zahl )x));
            }

            return(new Polynomial(new FunctionVariable(fname, x, la)));
        }
    }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public Algebraic map(LambdaAlgebraic f) throws JasymcaException
    public override Algebraic map(LambdaAlgebraic f)
    {
        Algebraic[] cn = new Algebraic[a.Length];
        for (int i = 0; i < a.Length; i++)
        {
            cn[i] = f.f_exakt(a[i]);
        }
        return(new Vektor(cn));
    }
Exemplo n.º 5
0
    public override Algebraic map(LambdaAlgebraic f)
    {
//JAVA TO C# CONVERTER NOTE: The following call to the 'RectangularArrays' helper class reproduces the rectangular array initialization that is automatic in Java:
//ORIGINAL LINE: Algebraic[][] cn = new Algebraic[a.Length][a[0].Length];
        Algebraic[][] cn = RectangularArrays.ReturnRectangularAlgebraicArray(a.Length, a[0].Length);
        for (int i = 0; i < a.Length; i++)
        {
            for (int k = 0; k < a[0].Length; k++)
            {
                cn[i][k] = f.f_exakt(a[i][k]);
            }
        }
        return(new Matrix(cn));
    }
Exemplo n.º 6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public Algebraic map(LambdaAlgebraic f) throws JasymcaException
    public override Algebraic map(LambdaAlgebraic f)
    {
        return(f.f_exakt(nom).div(f.f_exakt(den)));
    }