25.3 Algebraic Manipulation of Multivariate Functions (.NET, C#, CSharp, VB, Visual Basic, F#)
NMath provides overloaded arithmetic operators for multivariate functions with their conventional meanings for those .NET languages that support them, and equivalent named methods for those that do not. Table 20 lists the equivalent operators and methods.
Operator |
Equivalent Named Method |
+ |
Add() |
- |
Subtract() |
* |
Multiply() |
/ |
Divide() |
Unary - |
Negate() |
All binary operators and equivalent named methods work either with two functions, or with a function and a scalar. For example, this C# code uses the overloaded operators:
Code Example – C# multivariate functions
MultiVariableFunction g = f/2;
MultiVariableFunction sum = f + g;
MultiVariableFunction neg = -f;
This Visual Basic code uses the equivalent named methods:
Code Example – VB multivariate functions
Dim G = MultiVariableFunction.Divide(F, 2)
Dim Sum = MultiVariableFunction.Add(F, G)
Dim Neg = MultiVariableFunction.Negate(F)