/// <summary> /// Gets the inverse <see cref="LINA.AlgebraOperation"/> with the specified left operand. /// </summary> /// <returns>The inverse operation.</returns> /// <param name="left">The left operand.</param> protected override AlgebraOperation GetInverse(Algebrable left) { return(new DivisionOperation(left, Right)); }
/// <summary> /// Initializes a new instance of the /// <see cref="LINA.Operations.MultiplicationOperation"/> class. /// </summary> /// <param name="left">The left operand.</param> /// <param name="right">The right operand.</param> public MultiplicationOperation(Algebrable left, Algebrable right) { Left = left; Right = right; }
/// <summary> /// Initializes a new instance of the /// <see cref="LINA.Operations.ExponentiationOperation"/> class. /// </summary> /// <param name="left">The left operand.</param> /// <param name="right">The right operand.</param> public ExponentiationOperation(Algebrable left, Algebrable right) { Left = left; Right = right; }
/// <summary> /// Initializes a new instance of the <see cref="LINA.Operations.DivisionOperation"/> class. /// </summary> /// <param name="left">The left operand.</param> /// <param name="right">The right operand.</param> public DivisionOperation(Algebrable left, Algebrable right) { Left = left; Right = right; }
/// <summary> /// Gets the inverse <see cref="LINA.AlgebraOperation"/> with the specified left operand. /// </summary> /// <returns>The inverse operation.</returns> /// <param name="left">The left operand.</param> protected override AlgebraOperation GetInverse(Algebrable left) { return(new ExponentiationOperation(Right, left)); }
/// <summary> /// Initializes a new instance of the /// <see cref="LINA.Operations.LogarithmOperation"/> class. /// </summary> /// <param name="left">The left operand.</param> /// <param name="right">The right operand.</param> public LogarithmOperation(Algebrable left, Algebrable right) { Left = left; Right = right; }
/// <summary> /// Takes the logarithm of this object in the base of another algebrable object. /// </summary> /// <param name="second">The other object.</param> public override Algebrable Logarithm(Algebrable second) { return(second is IPrimitiveAlgebrable?ToAlgebrable((decimal)Math.Log((double)ToDecimal(), (double)((IPrimitiveAlgebrable)second).ToDecimal())) : Logarithm(second.Evaluate())); }
/// <summary> /// Initializes a new instance of the /// <see cref="LINA.Operations.SubtractionOperation"/> class. /// </summary> /// <param name="left">The left operand.</param> /// <param name="right">The right operand.</param> public SubtractionOperation(Algebrable left, Algebrable right) { Left = left; Right = right; }
/// <summary> /// Exponentiates this object by another algebrable object. /// </summary> /// <param name="second">The other object.</param> public override Algebrable Exponentiate(Algebrable second) { return(second is IPrimitiveAlgebrable?ToAlgebrable((decimal)Math.Pow((double)ToDecimal(), (double)((IPrimitiveAlgebrable)second).ToDecimal())) : Exponentiate(second.Evaluate())); }
/// <summary> /// Divides this object by another algebrable object. /// </summary> /// <param name="second">The other object.</param> public override Algebrable Divide(Algebrable second) { return(second is IPrimitiveAlgebrable?ToAlgebrable(ToDecimal() / ((IPrimitiveAlgebrable)second).ToDecimal()) : Divide(second.Evaluate())); }
/// <summary> /// Multiplies another algebrable object by this object. /// </summary> /// <param name="second">The other object.</param> public override Algebrable Multiply(Algebrable second) { return(second is IPrimitiveAlgebrable?ToAlgebrable(ToDecimal() *((IPrimitiveAlgebrable)second).ToDecimal()) : Multiply(second.Evaluate())); }
/// <summary> /// Subtracts another algebrable object from this object. /// </summary> /// <param name="second">The other object.</param> public override Algebrable Subtract(Algebrable second) { return(second is IPrimitiveAlgebrable?ToAlgebrable(ToDecimal() - ((IPrimitiveAlgebrable)second).ToDecimal()) : Subtract(second.Evaluate())); }
/// <summary> /// Adds another algebrable object to this object. /// </summary> /// <param name="second">The other object.</param> public override Algebrable Add(Algebrable second) { return(second is IPrimitiveAlgebrable?ToAlgebrable(ToDecimal() + ((IPrimitiveAlgebrable)second).ToDecimal()) : Add(second.Evaluate())); }