示例#1
0
        public static ValueTerm Scaling(ValueTerm factor, ValueTerm value)
        {
            if (factor.Dimension != 1)
            {
                throw new ArgumentException("Dimension of 'factor' is not 1.");
            }

            return(TermsWrapped.Product(factor, value));
        }
示例#2
0
        // common operations
        public static ValueTerm Sum(ValueTerm value1, ValueTerm value2)
        {
            if (value1.Dimension != value2.Dimension)
            {
                throw new ArgumentException("Dimensions of 'value1' and 'value2' do not match.");
            }

            return(TermsWrapped.Sum(value1, value2));
        }
示例#3
0
        public static ValueTerm ArcTangent(ValueTerm value)
        {
            if (value.Dimension != 1)
            {
                throw new ArgumentException("Dimension of 'value' is not 1.");
            }

            return(TermsWrapped.ArcTangent(value));
        }
示例#4
0
        public static ValueTerm Angle(ValueTerm value)
        {
            if (value.Dimension != 2)
            {
                throw new ArgumentException("Dimension of 'value' is not 2.");
            }

            return(TermsWrapped.ArcTangent2(value.Select(1), value.Select(0)));
        }
示例#5
0
        public static ValueTerm DotProduct(ValueTerm value1, ValueTerm value2)
        {
            if (value1.Dimension != value2.Dimension)
            {
                throw new ArgumentException("Dimensions of 'value1' and 'value2' do not match.");
            }

            return(TermsWrapped.MatrixProduct(TermsWrapped.Transpose(value1), value2));
        }
示例#6
0
        public void Dispose()
        {
            if (!disposed)
            {
                disposed = true;

                TermsWrapped.DisposeValue(this);

                GC.SuppressFinalize(this);
            }
        }
示例#7
0
        public static ValueTerm Product(ValueTerm value1, ValueTerm value2)
        {
            if (value1.Dimension != 1)
            {
                throw new ArgumentException("Dimension of 'value1' is not 1.");
            }
            if (value2.Dimension != 1)
            {
                throw new ArgumentException("Dimension of 'value2' is not 1.");
            }

            return(TermsWrapped.Product(value1, value2));
        }
示例#8
0
        public static ValueTerm Exponentiation(ValueTerm @base, ValueTerm exponent)
        {
            if (@base.Dimension != 1)
            {
                throw new ArgumentException("Dimension of 'base' is not 1.");
            }
            if (exponent.Dimension != 1)
            {
                throw new ArgumentException("Dimension of 'exponent' is not 1.");
            }

            return(TermsWrapped.Exponentiation(@base, exponent));
        }
示例#9
0
 public static ValueTerm Selection(ValueTerm value, int index)
 {
     return(TermsWrapped.Selection(value, index));
 }
示例#10
0
 // vectors
 public static ValueTerm Vector(IEnumerable <ValueTerm> values)
 {
     return(TermsWrapped.Vector(values));
 }
示例#11
0
 public static ValueTerm Application(FunctionTerm function, ValueTerm value)
 {
     return(TermsWrapped.Application(function, value));
 }
示例#12
0
 public static FunctionTerm Abstraction(ValueTerm variable, ValueTerm value)
 {
     return(TermsWrapped.Abstraction(variable, value));
 }
示例#13
0
 public override string ToString()
 {
     return(TermsWrapped.ValueToString(this));
 }
示例#14
0
 public IEnumerable <FunctionTerm> GetDerivatives()
 {
     return(TermsWrapped.FunctionDerivatives(this));
 }
示例#15
0
 // lambda terms
 public static ValueTerm Variable(string name, int dimension)
 {
     return(TermsWrapped.Variable(name, dimension));
 }
示例#16
0
 public ValueTerm Simplify()
 {
     return(TermsWrapped.ValueSimplify(this));
 }
示例#17
0
 public IEnumerable <double> Evaluate()
 {
     return(TermsWrapped.ValueEvaluate(this));
 }
示例#18
0
 // constants
 public static ValueTerm Constant(double value)
 {
     return(TermsWrapped.Constant(value));
 }
示例#19
0
 public override string ToString()
 {
     return(TermsWrapped.FunctionToString(this));
 }
示例#20
0
 public FunctionTerm Simplify()
 {
     return(TermsWrapped.FunctionSimplify(this));
 }