Exemplo n.º 1
0
            public override void InitializeNextPass(IRow row, RoleMappedSchema schema)
            {
                Contracts.Assert(PassNum < 1);
                Contracts.AssertValue(schema.Label);
                Contracts.AssertValue(schema.Group);

                var score = schema.GetUniqueColumn(MetadataUtils.Const.ScoreValueKind.Score);

                _labelGetter = RowCursorUtils.GetLabelGetter(row, schema.Label.Index);
                _scoreGetter = row.GetGetter <Single>(score.Index);
                _newGroupDel = RowCursorUtils.GetIsNewGroupDelegate(row, schema.Group.Index);
                if (schema.Weight != null)
                {
                    _weightGetter = row.GetGetter <Single>(schema.Weight.Index);
                }

                if (UnweightedCounters.GroupSummary)
                {
                    ValueGetter <StringBuilder> groupIdBuilder = RowCursorUtils.GetGetterAsStringBuilder(row, schema.Group.Index);
                    _groupSbUpdate = () => groupIdBuilder(ref _groupSb);
                }
                else
                {
                    _groupSbUpdate = () => { }
                };
            }