22 namespace Lucene.Net.Search.Function
53 public abstract float FloatVal(
int doc);
60 public virtual int IntVal(
int doc)
62 return (
int) FloatVal(doc);
70 public virtual long LongVal(
int doc)
72 return (
long) FloatVal(doc);
80 public virtual double DoubleVal(
int doc)
82 return (
double) FloatVal(doc);
90 public virtual System.String StrVal(
int doc)
92 return FloatVal(doc).ToString();
96 public abstract System.String ToString(
int doc);
101 return new Explanation(FloatVal(doc), ToString(doc));
115 protected internal virtual object InnerArray
117 get {
throw new System.NotSupportedException(
"this optional method is for test purposes only"); }
121 private float minVal = System.Single.NaN;
122 private float maxVal = System.Single.NaN;
123 private float avgVal = System.Single.NaN;
124 private bool computed =
false;
126 private void Compute()
141 catch (System.IndexOutOfRangeException)
146 minVal = System.Single.IsNaN(minVal)?val:System.Math.Min(minVal, val);
147 maxVal = System.Single.IsNaN(maxVal)?val:System.Math.Max(maxVal, val);
151 avgVal = n == 0?System.Single.NaN:sum / n;
165 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
"CA1024:UsePropertiesWhereAppropriate")]
166 public virtual float GetMinValue()
182 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
"CA1024:UsePropertiesWhereAppropriate")]
183 public virtual float GetMaxValue()
199 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
"CA1024:UsePropertiesWhereAppropriate")]
200 public virtual float GetAverageValue()