00001 using System; 00002 using System.Collections.Generic; 00003 using System.Linq; 00004 using System.Text; 00005 00006 namespace GEP.Core.Float.Functions 00007 { 00011 [Serializable] 00012 public class Logarithm : Symbol 00013 { 00017 protected static string NAME = "Log"; 00018 00022 public Logarithm() 00023 : base(2, NAME) 00024 { 00025 } 00026 00037 public override float Value(float[] parameters, int startIndex) 00038 { 00039 return (float)(Math.Log(Math.Abs(parameters[startIndex]), Math.Abs(Math.Abs(parameters[++startIndex])))); 00040 } 00041 00046 public Logarithm(Logarithm symbol) 00047 : base(symbol) 00048 { 00049 } 00050 00051 public override GEP.Core.Common.Symbol Clone() 00052 { 00053 return new Logarithm(this); 00054 } 00055 } 00056 } 00057