public virtual Algebraic Map(LambdaAlgebraic lambda, Algebraic arg) { if (arg == null) { var r = lambda.SymEval(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 SymbolicException("Wrong type of arguments."); } return(lambda.SymEval(this, arg)); }
public override Algebraic Map(LambdaAlgebraic f) { var cn = CreateRectangularArray <Algebraic>(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.SymEval(a[i][k]); } } return(new Matrix(cn)); }