public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { FunctionValues aVals = m_a.GetValues(context, readerContext); FunctionValues bVals = m_b.GetValues(context, readerContext); return(new SingleDocValuesAnonymousClass(this, this, aVals, bVals)); }
private void CreateGraphOfCobweb(ZedGraphControl zgc) { PointPairList list = new PointPairList(); PointPair point = new PointPair(); LineItem myCurve; LineItem myCurve2; double x; myPane.XAxis.Color = OppositeGraphColor; myPane.YAxis.Color = OppositeGraphColor; myPane.XAxis.IsVisible = true; myPane.YAxis.IsVisible = true; PointPairList list1 = new PointPairList(); PointPairList list2 = new PointPairList(); for (x = grSettings.XMin; x <= grSettings.XMax; x = x + grSettings.XIncr) { list1.Add(x, x); FunctionValues.Add(point); myCurve = myPane.AddCurve("", list1, Color.Blue, SymbolType.None); list2.Add(x, function(x)); FunctionValues.Add(point); myCurve2 = myPane.AddCurve("", list2, OppositeGraphColor, SymbolType.None); } CobwebPlots(); }
private void CreateGraphOfSlope(ZedGraphControl zgc) { // Make up some data arrays based on the Sine function double x, y, y1, y2, y3; PointPairList list = new PointPairList(); PointPairList list1 = new PointPairList(); PointPairList list2 = new PointPairList(); PointPairList list3 = new PointPairList(); PointPair point = new PointPair(); LineItem myCurve; // y' = y^2 - x for (x = grSettings.XMin; x <= grSettings.XMax; x = x + grSettings.XIncr) { for (y = grSettings.YMin; y <= grSettings.YMax; y = y + grSettings.YIncr) { y1 = slope(x, y); y2 = y1 + 0.1 * y1; y3 = y1 - 0.1 * y1; list = new PointPairList(); point = new PointPair(); point.X = x; point.Y = y; list.Add(point); FunctionValues.Add(point); myCurve = myPane.AddCurve("", list, SlopeColor(y1), SymbolType.Default); myCurve.Symbol.Size = 1; } } }
private void CreateGraphOfVectorField(ZedGraphControl zgc) { double x, y, z; PointPairList list = new PointPairList(); PointPair point = new PointPair(); LineItem myCurve; for (x = grSettings.XMin; x <= grSettings.XMax; x = x + grSettings.XIncr) { for (y = grSettings.YMin; y <= grSettings.YMax; y = y + grSettings.YIncr) { z = vectorfield(x, y); list = new PointPairList(); point = new PointPair(); point.X = x; point.Y = y; list.Add(point); FunctionValues.Add(point); point.X = x + z * Math.Cos(Math.Atan(z)); point.Y = y + z * Math.Sin(Math.Atan(z)); list.Add(point); FunctionValues.Add(point); myCurve = myPane.AddCurve("", list, RedBlueSlopeColor(z), SymbolType.Default); myCurve.Symbol.Size = 1; } } }
public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { int @base = readerContext.DocBase; FunctionValues vals = m_source.GetValues(context, readerContext); return(new CachingDoubleFunctionValue(@base, vals, m_cache)); }
public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs) { // TODO: this is just like ValueSourceScorer, // ValueSourceFilter (spatial), // ValueSourceRangeFilter (solr); also, // https://issues.apache.org/jira/browse/LUCENE-4251 FunctionValues values = valueSource.GetValues(new Dictionary <string, object>(), context); int maxDoc = context.Reader.MaxDoc; Bits fastMatchBits; if (fastMatchFilter != null) { DocIdSet dis = fastMatchFilter.GetDocIdSet(context, null); if (dis == null) { // No documents match return(null); } fastMatchBits = dis.GetBits(); if (fastMatchBits == null) { throw new System.ArgumentException("fastMatchFilter does not implement DocIdSet.bits"); } } else { fastMatchBits = null; } return(new DocIdSetAnonymousInnerClassHelper(this, acceptDocs, values, maxDoc, fastMatchBits)); }
public BitsAnonymousHelper(DocIdSetAnonymousHelper outerInstance, FunctionValues predFuncValues, AtomicReaderContext context, IBits acceptDocs) { this.outerInstance = outerInstance; this.predFuncValues = predFuncValues; this.context = context; this.acceptDocs = acceptDocs; }
private void CreateGraphOfFunction(ZedGraphControl zgc) { PointPairList list = new PointPairList(); PointPair point = new PointPair(); LineItem myCurve; double x, y; for (x = grSettings.XMin; x <= grSettings.XMax; x = x + grSettings.XIncr) { y = function(x); if (!grSettings.SmoothGraph) { list = new PointPairList(); } point = new PointPair(); point.X = x; point.Y = y; list.Add(point); FunctionValues.Add(point); if (!grSettings.SmoothGraph) { myCurve = myPane.AddCurve("", list, OppositeGraphColor, SymbolType.Default); myCurve.Symbol.Size = 1; } } if (grSettings.SmoothGraph) { myCurve = myPane.AddCurve("", list, OppositeGraphColor, SymbolType.Default); myCurve.Symbol.Size = 1; } }
public FloatDocValuesAnonymousInnerClassHelper(DualFloatFunction outerInstance, DualFloatFunction @this, FunctionValues aVals, FunctionValues bVals) : base(@this) { this.outerInstance = outerInstance; this.aVals = aVals; this.bVals = bVals; }
public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { FunctionValues aVals = a.GetValues(context, readerContext); FunctionValues bVals = b.GetValues(context, readerContext); return(new FloatDocValuesAnonymousInnerClassHelper(this, this, aVals, bVals)); }
public override Bits GetBits() { //null Map context -- we simply don't have one. That's ok. FunctionValues predFuncValues = outerInstance.predicateValueSource.GetValues(null, context); return(new BitsAnonymousHelper(this, predFuncValues, context, acceptDocs)); }
public FunctionValuesAnonymousInnerClassHelper(IfFunction outerInstance, FunctionValues ifVals, FunctionValues trueVals, FunctionValues falseVals) { this.outerInstance = outerInstance; this.ifVals = ifVals; this.trueVals = trueVals; this.falseVals = falseVals; }
public ValueSourceFilteredDocIdSet(ValueSourceFilter outerInstance, DocIdSet?innerSet, FunctionValues values) : base(innerSet) { // LUCENENET specific - added guard clauses this.outerInstance = outerInstance ?? throw new ArgumentNullException(nameof(outerInstance)); this.values = values ?? throw new ArgumentNullException(nameof(values)); }
public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { IDictionary <string, FunctionValues> valuesCache = (IDictionary <string, FunctionValues>)context["valuesCache"]; if (valuesCache == null) { valuesCache = new Dictionary <string, FunctionValues>(); context = new Hashtable(context) { ["valuesCache"] = valuesCache }; } FunctionValues[] externalValues = new FunctionValues[expression.Variables.Length]; for (int i = 0; i < variables.Length; ++i) { string externalName = expression.Variables[i]; if (!valuesCache.TryGetValue(externalName, out FunctionValues values)) { values = variables[i].GetValues(context, readerContext); if (values == null) { // LUCENENET specific: Changed from RuntimeException to InvalidOperationException to match .NET conventions #pragma warning disable IDE0016 // Use 'throw' expression throw IllegalStateException.Create($"Internal error. External ({externalName}) does not exist."); #pragma warning restore IDE0016 // Use 'throw' expression } valuesCache[externalName] = values; } externalValues[i] = values; } return(new ExpressionFunctionValues(this, expression, externalValues)); }
public BitsAnonymousClass(FunctionValues predFuncValues, AtomicReaderContext context, IBits?acceptDocs) { // LUCENENET specific - added guard clauses this.predFuncValues = predFuncValues ?? throw new ArgumentNullException(nameof(predFuncValues)); this.context = context ?? throw new ArgumentNullException(nameof(context)); this.acceptDocs = acceptDocs; }
private void CreateGraphOfIteration(ZedGraphControl zgc) { PointPairList list = new PointPairList(); PointPair point = new PointPair(); LineItem myCurve; double x, y; y = grSettings.StartingX; for (long n = 1; n <= grSettings.N; n++) { y = function(y); if (!grSettings.SmoothGraph) { list = new PointPairList(); } point = new PointPair(); point.X = n; point.Y = y; list.Add(point); FunctionValues.Add(point); if (!grSettings.SmoothGraph) { myCurve = myPane.AddCurve("", list, OppositeGraphColor, SymbolType.Default); myCurve.Symbol.Size = 1; } } if (grSettings.SmoothGraph) { myCurve = myPane.AddCurve("", list, OppositeGraphColor, SymbolType.Default); myCurve.Symbol.Size = 1; } }
private void CreateGraphOfDerivative(ZedGraphControl zgc) { // Make up some data arrays based on the Sine function double x, y; PointPairList list = new PointPairList(); PointPair point = new PointPair(); LineItem myCurve; for (x = grSettings.XMin; x <= grSettings.XMax; x = x + grSettings.XIncr) { y = derivative(x); if (!grSettings.SmoothGraph) { list = new PointPairList(); } point = new PointPair(); point.X = x; point.Y = y; list.Add(point); FunctionValues.Add(point); if (!grSettings.SmoothGraph) { myCurve = myPane.AddCurve("", list, SlopeColor(y), SymbolType.Default); myCurve.Symbol.Size = 1; } } if (grSettings.SmoothGraph) { myCurve = myPane.AddCurve("", list, Color.Yellow, SymbolType.Default); myCurve.Symbol.Size = 1; } }
public override void SetNextReader(AtomicReaderContext context) { FunctionValues values = groupBy.GetValues(vsContext, context); filler = values.GetValueFiller(); mval = (TMutableValue)filler.Value; }
public SingleDocValuesAnonymousClass(DualSingleFunction outerInstance, DualSingleFunction @this, FunctionValues aVals, FunctionValues bVals) : base(@this) { this.outerInstance = outerInstance; this.aVals = aVals; this.bVals = bVals; }
public virtual void TestRangeScorer() { Expression expr = JavascriptCompiler.Compile("2*popularity"); SimpleBindings bindings = new SimpleBindings(); bindings.Add(new SortField("popularity", SortFieldType.INT64)); ValueSource vs = expr.GetValueSource(bindings); Assert.AreEqual(1, reader.Leaves.Count); AtomicReaderContext leaf = reader.Leaves[0]; FunctionValues values = vs.GetValues(new Dictionary <string, object>(), leaf); // everything ValueSourceScorer scorer = values.GetRangeScorer(leaf.Reader, "4" , "40", true, true); Assert.AreEqual(-1, scorer.DocID); Assert.AreEqual(0, scorer.NextDoc()); Assert.AreEqual(1, scorer.NextDoc()); Assert.AreEqual(2, scorer.NextDoc()); Assert.AreEqual(DocIdSetIterator.NO_MORE_DOCS, scorer.NextDoc()); // just the first doc scorer = values.GetRangeScorer(leaf.Reader, "4", "40", false, false); Assert.AreEqual(-1, scorer.DocID); Assert.AreEqual(0, scorer.NextDoc()); Assert.AreEqual(DocIdSetIterator.NO_MORE_DOCS, scorer.NextDoc()); }
/// <summary>This method is unused, it is just here to make sure that the function signatures don't change.</summary> /// <remarks> /// This method is unused, it is just here to make sure that the function signatures don't change. /// If this method fails to compile, you also have to change the byte code generator to correctly /// use the <see cref="FunctionValues"/> class. /// </remarks> #pragma warning disable IDE0051 // Remove unused private members private static void UnusedTestCompile() #pragma warning restore IDE0051 // Remove unused private members { FunctionValues f = null; /*double ret = */ f.DoubleVal(2); // LUCENENET: IDE0059: Remove unnecessary value assignment }
public FunctionValuesAnonymousInnerClassHelper(IfFunction outerInstance, FunctionValues ifVals, FunctionValues trueVals, FunctionValues falseVals) { this.outerInstance = outerInstance; this.ifVals = ifVals; this.trueVals = trueVals; this.falseVals = falseVals; }
public BoolDocValuesAnonymousClass(ShapePredicateValueSource outerInstance, FunctionValues shapeValues) : base(outerInstance) { // LUCENENET specific - added guard clauses this.outerInstance = outerInstance ?? throw new ArgumentNullException(nameof(outerInstance)); this.shapeValues = shapeValues ?? throw new ArgumentNullException(nameof(shapeValues)); }
public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { IDictionary <string, FunctionValues> valuesCache = (IDictionary <string, FunctionValues>)context["valuesCache"]; if (valuesCache == null) { valuesCache = new Dictionary <string, FunctionValues>(); context = new Hashtable(context); context["valuesCache"] = valuesCache; } FunctionValues[] externalValues = new FunctionValues[expression.Variables.Length]; for (int i = 0; i < variables.Length; ++i) { string externalName = expression.Variables[i]; FunctionValues values; if (!valuesCache.TryGetValue(externalName, out values)) { values = variables[i].GetValues(context, readerContext); if (values == null) { throw new InvalidOperationException("Internal error. External (" + externalName + ") does not exist."); } valuesCache[externalName] = values; } externalValues[i] = values; } return(new ExpressionFunctionValues(this, expression, externalValues)); }
public CachingDoubleFunctionValue(int docBase, FunctionValues vals, IDictionary <int, double> cache) { // LUCENENET specific - added guard clauses this.docBase = docBase; values = vals ?? throw new ArgumentNullException(nameof(vals)); this.cache = cache ?? throw new ArgumentNullException(nameof(cache)); }
public override void SetNextReader(AtomicReaderContext context) { base.SetNextReader(context); FunctionValues values = groupByVS.GetValues(vsContext, context); filler = values.GetValueFiller(); mval = filler.Value; }
protected override float Func(int doc, FunctionValues[] valsArr) { if (valsArr.Length == 0) { return 0.0f; } return valsArr.Select(vals => vals.FloatVal(doc)).Concat(new[] {float.PositiveInfinity}).Min(); }
public FloatDocValuesAnonymousInnerClassHelper(RangeMapFloatFunction outerInstance, RangeMapFloatFunction @this, FunctionValues vals, FunctionValues targets, FunctionValues defaults) : base(@this) { this.outerInstance = outerInstance; this.vals = vals; this.targets = targets; this.defaults = defaults; }
public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { FunctionValues ifVals = ifSource.GetValues(context, readerContext); FunctionValues trueVals = trueSource.GetValues(context, readerContext); FunctionValues falseVals = falseSource.GetValues(context, readerContext); return(new FunctionValuesAnonymousInnerClassHelper(ifVals, trueVals, falseVals)); }
public DocIdSetAnonymousInnerClassHelper(FilterAnonymousInnerClassHelper outerInstance, Bits acceptDocs, FunctionValues values, int maxDoc, Bits fastMatchBits) { this.outerInstance = outerInstance; this.acceptDocs = acceptDocs; this.values = values; this.maxDoc = maxDoc; this.fastMatchBits = fastMatchBits; }
public SingleDocValuesAnonymousInnerClassHelper(RangeMapSingleFunction outerInstance, RangeMapSingleFunction @this, FunctionValues vals, FunctionValues targets, FunctionValues defaults) : base(@this) { this.outerInstance = outerInstance; this.vals = vals; this.targets = targets; this.defaults = defaults; }
public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { FunctionValues vals = m_source.GetValues(context, readerContext); FunctionValues targets = m_target.GetValues(context, readerContext); FunctionValues defaults = (this.m_defaultVal == null) ? null : m_defaultVal.GetValues(context, readerContext); return(new SingleDocValuesAnonymousInnerClassHelper(this, this, vals, targets, defaults)); }
public SingleDocValuesAnonymousInnerClassHelper(ScaleSingleFunction outerInstance, ScaleSingleFunction @this, float scale, float minSource, float maxSource, FunctionValues vals) : base(@this) { this.outerInstance = outerInstance; this.scale = scale; this.minSource = minSource; this.maxSource = maxSource; this.vals = vals; }
public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { var valsArr = new FunctionValues[sources.Length]; for (int i = 0; i < sources.Length; i++) { valsArr[i] = sources[i].GetValues(context, readerContext); } return new FloatDocValuesAnonymousInnerClassHelper(this, this, valsArr); }
protected override float Func(int doc, FunctionValues[] valsArr) { if (valsArr.Length == 0) { return 0.0f; } float val = float.NegativeInfinity; foreach (FunctionValues vals in valsArr) { val = Math.Max(vals.FloatVal(doc), val); } return val; }
public static string ToString(string name, FunctionValues[] valsArr, int doc) { var sb = new StringBuilder(); sb.Append(name).Append('('); bool firstTime = true; foreach (FunctionValues vals in valsArr) { if (firstTime) { firstTime = false; } else { sb.Append(','); } sb.Append(vals.ToString(doc)); } sb.Append(')'); return sb.ToString(); }
public Values(MultiFunction outerInstance, FunctionValues[] valsArr) { this.outerInstance = outerInstance; this.valsArr = valsArr; }
protected override float Func(int doc, FunctionValues aVals, FunctionValues bVals) { return (float)Math.Pow(aVals.FloatVal(doc), bVals.FloatVal(doc)); }
public FunctionValuesAnonymousInnerClassHelper(FunctionValues ifVals, FunctionValues trueVals, FunctionValues falseVals) { this.ifVals = ifVals; this.trueVals = trueVals; this.falseVals = falseVals; }
/// <summary> /// Returns the weight for the current <code>docId</code> as computed /// by the <code>weightsValueSource</code> /// /// </summary> protected internal override long GetWeight(Document doc, int docId) { if (currentWeightValues == null) { return 0; } int subIndex = ReaderUtil.subIndex(docId, starts); if (subIndex != currentLeafIndex) { currentLeafIndex = subIndex; try { currentWeightValues = outerInstance.weightsValueSource.GetValues(new Dictionary<string, object>(), leaves[currentLeafIndex]); } catch (IOException) { throw new Exception(); } } return currentWeightValues.LongVal(docId - starts[subIndex]); }
protected abstract float Func(int doc, FunctionValues aVals, FunctionValues bVals);
protected override float Func(int doc, FunctionValues[] valsArr) { return valsArr.Aggregate(1.0f, (current, vals) => current * vals.FloatVal(doc)); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public DocumentValueSourceInputIterator(boolean hasPayloads, boolean hasContexts) throws java.io.IOException public DocumentValueSourceInputIterator(DocumentValueSourceDictionary outerInstance, bool hasPayloads, bool hasContexts) : base(outerInstance, hasPayloads, hasContexts) { this.outerInstance = outerInstance; leaves = outerInstance.reader.Leaves(); starts = new int[leaves.Count + 1]; for (int i = 0; i < leaves.Count; i++) { starts[i] = leaves[i].DocBase; } starts[leaves.Count] = outerInstance.reader.MaxDoc(); currentWeightValues = (leaves.Count > 0) ? outerInstance.weightsValueSource.GetValues(new Dictionary<string, object>(), leaves[currentLeafIndex]) : null; }
public BoolDocValuesAnonymousInnerClassHelper(SimpleBoolFunction outerInstance, SimpleBoolFunction @this, FunctionValues vals) : base(@this) { this.outerInstance = outerInstance; this.vals = vals; }
public FunctionValuesAnonymousInnerClassHelper2(VectorValueSource outerInstance, FunctionValues[] valsArr) { this.outerInstance = outerInstance; this.valsArr = valsArr; }
protected abstract bool Func(int doc, FunctionValues vals);
public DocIdSetAnonymousInnerClassHelper(FilterAnonymousInnerClassHelper outerInstance, Bits acceptDocs, FunctionValues values, int maxDoc, Bits fastMatchBits) { this.outerInstance = outerInstance; this.acceptDocs = acceptDocs; this.values = values; this.maxDoc = maxDoc; this.fastMatchBits = fastMatchBits; }
public FloatDocValuesAnonymousInnerClassHelper(DualFloatFunction outerInstance, DualFloatFunction @this, FunctionValues aVals, FunctionValues bVals) : base(@this) { this.outerInstance = outerInstance; this.aVals = aVals; this.bVals = bVals; }
public static FunctionValues[] ValsArr(IList<ValueSource> sources, IDictionary fcontext, AtomicReaderContext readerContext) { var valsArr = new FunctionValues[sources.Count]; int i = 0; foreach (var source in sources) { valsArr[i++] = source.GetValues(fcontext, readerContext); } return valsArr; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Create a new style on the specified style list. /// </summary> /// <param name="styleList">The style list to add the style to</param> /// <param name="name">style name</param> /// <param name="context">style context</param> /// <param name="structure">style structure</param> /// <param name="function">style function</param> /// <param name="isCharStyle">true if character style, otherwise false</param> /// <param name="userLevel">User level</param> /// <param name="isBuiltin">True for a builtin style, otherwise, false.</param> /// <returns>The new created (and properly owned style.</returns> /// ------------------------------------------------------------------------------------ public IStStyle Create(IFdoOwningCollection<IStStyle> styleList, string name, ContextValues context, StructureValues structure, FunctionValues function, bool isCharStyle, int userLevel, bool isBuiltin) { var retval = new StStyle(); styleList.Add(retval); retval.Name = name; retval.Context = context; retval.Structure = structure; retval.Function = function; retval.Type = (isCharStyle ? StyleType.kstCharacter : StyleType.kstParagraph); retval.UserLevel = userLevel; retval.IsBuiltIn = isBuiltin; return retval; }
public ValueSourceFilteredDocIdSet(DocIdSet innerSet, FunctionValues values, ValueSourceFilter caller) : base(innerSet) { this.enclosingFilter = caller; this.values = values; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Create a new style and add it to the Language Project stylesheet. /// </summary> /// <param name="name">style name</param> /// <param name="context">style context</param> /// <param name="structure">style structure</param> /// <param name="function">style function</param> /// <param name="isCharStyle">true if character style, otherwise false</param> /// <param name="userLevel">The user level.</param> /// <param name="styleCollection">The style collection.</param> /// <returns>The style</returns> /// ------------------------------------------------------------------------------------ public IStStyle AddTestStyle(string name, ContextValues context, StructureValues structure, FunctionValues function, bool isCharStyle, int userLevel, FdoOwningCollection<IStStyle> styleCollection) { CheckDisposed(); ITsPropsBldr bldr = TsPropsBldrClass.Create(); StStyle style = new StStyle(); styleCollection.Add(style); style.Name = name; style.Context = context; style.Structure = structure; style.Function = function; style.Rules = bldr.GetTextProps(); style.Type = (isCharStyle ? StyleType.kstCharacter : StyleType.kstParagraph); style.UserLevel = userLevel; return style; }
/// ------------------------------------------------------------------------------------- /// <summary> /// Detemine whether the newly proposed function for a style is compatible with its /// current function. /// </summary> /// <param name="currFunction">The existing function of the style</param> /// <param name="proposedFunction">The function we want</param> /// <returns><c>true </c>if the passed in function can be upgraded as requested; /// <c>false</c> otherwise.</returns> /// ------------------------------------------------------------------------------------- public override bool CompatibleFunction(FunctionValues currFunction, FunctionValues proposedFunction) { return base.CompatibleFunction(currFunction, proposedFunction) || (currFunction == FunctionValues.Line && proposedFunction == FunctionValues.StanzaBreak); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Create a new style and add it to the Language Project stylesheet. /// </summary> /// <param name="name">style name</param> /// <param name="context">style context</param> /// <param name="structure">style structure</param> /// <param name="function">style function</param> /// <param name="isCharStyle">true if character style, otherwise false</param> /// <param name="styleCollection">The style collection.</param> /// <returns>The style</returns> /// ------------------------------------------------------------------------------------ public IStStyle AddTestStyle(string name, ContextValues context, StructureValues structure, FunctionValues function, bool isCharStyle, FdoOwningCollection<IStStyle> styleCollection) { return AddTestStyle(name, context, structure, function, isCharStyle, 0, styleCollection); }
public FunctionValuesAnonymousInnerClassHelper(VectorValueSource outerInstance, FunctionValues x, FunctionValues y) { this.outerInstance = outerInstance; this.x = x; this.y = y; }
public FloatDocValuesAnonymousInnerClassHelper(ReciprocalFloatFunction outerInstance, ReciprocalFloatFunction @this, FunctionValues vals) : base(@this) { this.outerInstance = outerInstance; this.vals = vals; }
public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { var size = sources.Count; // special-case x,y and lat,lon since it's so common if (size == 2) { var x = sources[0].GetValues(context, readerContext); var y = sources[1].GetValues(context, readerContext); return new FunctionValuesAnonymousInnerClassHelper(this, x, y); } var valsArr = new FunctionValues[size]; for (int i = 0; i < size; i++) { valsArr[i] = sources[i].GetValues(context, readerContext); } return new FunctionValuesAnonymousInnerClassHelper2(this, valsArr); }
protected override float Func(int doc, FunctionValues aVals, FunctionValues bVals) { return aVals.FloatVal(doc) / bVals.FloatVal(doc); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Constructor with ContextValues and MarkerDomain as a parameters. /// </summary> /// <param name="sStyleName">Name of the style.</param> /// <param name="styleType">kstCharacter or kstParagraph</param> /// <param name="ws">character or paragraph writing system</param> /// <param name="context">Context that will be used if this is a new style (otherwise existing /// context in DB will be used), see ContextValues for possible types</param> /// <param name="domain">The marker domain to use</param> /// <param name="styleSheet">The style sheet</param> /// ------------------------------------------------------------------------------------ public ImportStyleProxy(string sStyleName, StyleType styleType, int ws, ContextValues context, MarkerDomain domain, FwStyleSheet styleSheet) { m_FwStyleSheet = styleSheet; m_domain = domain; Debug.Assert(m_FwStyleSheet != null); m_ttpFormattingProps = null; m_fIsScriptureStyle = true; //default m_sEndMarker = null; //default if (context == ContextValues.EndMarker) { // this proxy represents an end marker - not a style; set bogus info sStyleName = "End"; //name does not matter styleType = StyleType.kstCharacter; } else if (sStyleName != null) { // Determine whether style exists in the StyleSheet Debug.Assert(ws != 0); m_style = m_FwStyleSheet.FindStyle(sStyleName); if (m_style != null) { // If this is an existing style, the actual type, context, structure, and // function always override the requested values. styleType = m_style.Type; context = (ContextValues)m_style.Context; m_structure = (StructureValues)m_style.Structure; m_function = (FunctionValues)m_style.Function; } } m_sStyleName = sStyleName; m_StyleType = styleType; m_ws = ws; m_Context = context; // //force StartOfFootnote marker to be processed as a para style proxy having para props // if (context == StyleRole.StartOfFootnote) // m_StyleType = StyleType.kstParagraph; //set the text property vars for this proxy SetTextProps(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Create a new style and add it to the Language Project stylesheet. /// </summary> /// <param name="name">style name</param> /// <param name="context">style context</param> /// <param name="structure">style structure</param> /// <param name="function">style function</param> /// <param name="isCharStyle">true if character style, otherwise false</param> /// <returns>The style</returns> /// ------------------------------------------------------------------------------------ public IStStyle AddTestStyle(string name, ContextValues context, StructureValues structure, FunctionValues function, bool isCharStyle) { return AddTestStyle(name, context, structure, function, isCharStyle, Cache.LangProject.StylesOC); }