/// <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;
 }
Example #3
0
 /// <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;
 }
Example #4
0
 /// <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;
 }
Example #7
0
 /// <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()));
 }
Example #8
0
 /// <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;
 }
Example #9
0
 /// <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()));
 }
Example #10
0
 /// <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()));
 }
Example #11
0
 /// <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()));
 }
Example #12
0
 /// <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()));
 }
Example #13
0
 /// <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()));
 }