Creates the measure dimension based on the sorted value combinations

@param valueCombinations
@param valueCombinationCrosstab
338020
public void createMeasureDimensionValueCombinationCrosstab(
            final Map<ValueCombination<Number>, Number> valueCombinations,
            final Crosstab<Number> valueCombinationCrosstab) {

        if (CrosstabReducerHelper.findDimension(valueCombinationCrosstab, BooleanAnalyzer.DIMENSION_MEASURE)) {

            final SortedSet<Entry<ValueCombination<Number>, Number>> entries =
                    new TreeSet<>(frequentValueCombinationComparator);
            entries.addAll(valueCombinations.entrySet());

            final CrosstabNavigator<Number> nav = new CrosstabNavigator<>(valueCombinationCrosstab);
            final CrosstabDimension measureDimension =
                    valueCombinationCrosstab.getDimension(BooleanAnalyzer.DIMENSION_MEASURE);
            final CrosstabDimension columnDimension =
                    valueCombinationCrosstab.getDimension(BooleanAnalyzer.DIMENSION_COLUMN);
            final List<String> columnDimCategories = columnDimension.getCategories();
            int row = 0;
            for (final Entry<ValueCombination<Number>, Number> entry : entries) {

                // create the category
                final String measureName;
                if (row == 0) {
                    measureName = BooleanAnalyzer.MEASURE_MOST_FREQUENT;
                } else if (row == entries.size() - 1) {
                    measureName = BooleanAnalyzer.MEASURE_LEAST_FREQUENT;
                } else {
                    measureName = BooleanAnalyzer.DIMENSION_COMBINATION_PREFIX + row;
                }
                measureDimension.addCategory(measureName);

                // extract data
                final Number[] values = new Number[columnDimCategories.size()];
                final ValueCombination<Number> key = entry.getKey();
                for (int i = 0; i < key.getValueCount(); i++) {
                    values[i] = key.getValueAt(i);
                }
                values[columnDimCategories.size() - 1] = entry.getValue();

                // put data into crosstab
                for (int i = 0; i < columnDimCategories.size(); i++) {
                    nav.where(columnDimension, columnDimCategories.get(i));
                    nav.where(measureDimension, measureName);
                    nav.put(values[i]);
                }
                row++;
            }
        }
    }
750545
@XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "CombinerParameters")
    public JAXBElement<CombinerParametersType> createCombinerParameters(CombinerParametersType value) {
        return new JAXBElement<CombinerParametersType>(_CombinerParameters_QNAME, CombinerParametersType.class, null, value);
    }
195904
public SDVariable weightedCrossEntropyWithLogits(SDVariable targets, SDVariable inputs,
                                                     SDVariable weights) {
        return weightedCrossEntropyWithLogits(null, targets, inputs, weights);
    }
418476
def combine_sp_values(self, other):
        
        if self.values is None:
            ret = IdValues()
        else:
            ret = IdValues({k: int(v) * int(other.values[k]) for k, v in
                            self.values.items()})
        return ret
621505
protected function calculateTargetDimensionsForCombination(array $dimensionCombination)
    {
        $targetDimensions = [];
        foreach ($dimensionCombination as $dimensionName => $dimensionValues) {
            $targetDimensions[$dimensionName] = reset($dimensionValues);
        }

        return $targetDimensions;
    }
734119
function doGuessOrdinal(
    data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex
) {
    var result;
    // Experience value.
    var maxLoop = 5;

    if (isTypedArray(data)) {
        return false;
    }

    // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine
    // always exists in source.
    var dimName;
    if (dimensionsDefine) {
        dimName = dimensionsDefine[dimIndex];
        dimName = isObject(dimName) ? dimName.name : dimName;
    }

    if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {
        if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {
            var sample = data[dimIndex];
            for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {
                if ((result = detectValue(sample[startIndex + i])) != null) {
                    return result;
                }
            }
        }
        else {
            for (var i = 0; i < data.length && i < maxLoop; i++) {
                var row = data[startIndex + i];
                if (row && (result = detectValue(row[dimIndex])) != null) {
                    return result;
                }
            }
        }
    }
    else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {
        if (!dimName) {
            return;
        }
        for (var i = 0; i < data.length && i < maxLoop; i++) {
            var item = data[i];
            if (item && (result = detectValue(item[dimName])) != null) {
                return result;
            }
        }
    }
    else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {
        if (!dimName) {
            return;
        }
        var sample = data[dimName];
        if (!sample || isTypedArray(sample)) {
            return false;
        }
        for (var i = 0; i < sample.length && i < maxLoop; i++) {
            if ((result = detectValue(sample[i])) != null) {
                return result;
            }
        }
    }
    else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {
        for (var i = 0; i < data.length && i < maxLoop; i++) {
            var item = data[i];
            var val = getDataItemValue(item);
            if (!isArray(val)) {
                return false;
            }
            if ((result = detectValue(val[dimIndex])) != null) {
                return result;
            }
        }
    }

    function detectValue(val) {
        // Consider usage convenience, '1', '2' will be treated as "number".
        // `isFinit('')` get `true`.
        if (val != null && isFinite(val) && val !== '') {
            return false;
        }
        else if (isString(val) && val !== '-') {
            return true;
        }
    }

    return false;
}
417865
public void addMultipleItems(int times, final Object... values) {
		for (int i = 0; i < times; i++) {
            addItemAsArray(values);
        }
	}
587721
protected Double getCubicInterpolationValue(Double[] values, double offset) {
		Double value = null;
		if (values != null) {
			value = getCubicInterpolationValue(values[0], values[1], values[2],
					values[3], offset);
		}
		return value;
	}
705171
private static int aggregateDimValue(
      final int[] positions,
      final BufferAggregator[] theAggregators,
      final ByteBuffer resultsBuf,
      final int numBytesPerRecord,
      final int[] aggregatorOffsets,
      final int aggSize,
      final int aggExtra,
      final int dimIndex,
      int currentPosition
  )
  {
    if (SKIP_POSITION_VALUE == positions[dimIndex]) {
      return currentPosition;
    }
    if (INIT_POSITION_VALUE == positions[dimIndex]) {
      positions[dimIndex] = currentPosition * numBytesPerRecord;
      currentPosition++;
      final int pos = positions[dimIndex];
      for (int j = 0; j < aggSize; ++j) {
        theAggregators[j].init(resultsBuf, pos + aggregatorOffsets[j]);
      }
    }
    final int position = positions[dimIndex];

    switch (aggExtra) {
      case 7:
        theAggregators[6].aggregate(resultsBuf, position + aggregatorOffsets[6]);
        // fall through
      case 6:
        theAggregators[5].aggregate(resultsBuf, position + aggregatorOffsets[5]);
        // fall through
      case 5:
        theAggregators[4].aggregate(resultsBuf, position + aggregatorOffsets[4]);
        // fall through
      case 4:
        theAggregators[3].aggregate(resultsBuf, position + aggregatorOffsets[3]);
        // fall through
      case 3:
        theAggregators[2].aggregate(resultsBuf, position + aggregatorOffsets[2]);
        // fall through
      case 2:
        theAggregators[1].aggregate(resultsBuf, position + aggregatorOffsets[1]);
        // fall through
      case 1:
        theAggregators[0].aggregate(resultsBuf, position + aggregatorOffsets[0]);
    }
    for (int j = aggExtra; j < aggSize; j += AGG_UNROLL_COUNT) {
      theAggregators[j].aggregate(resultsBuf, position + aggregatorOffsets[j]);
      theAggregators[j + 1].aggregate(resultsBuf, position + aggregatorOffsets[j + 1]);
      theAggregators[j + 2].aggregate(resultsBuf, position + aggregatorOffsets[j + 2]);
      theAggregators[j + 3].aggregate(resultsBuf, position + aggregatorOffsets[j + 3]);
      theAggregators[j + 4].aggregate(resultsBuf, position + aggregatorOffsets[j + 4]);
      theAggregators[j + 5].aggregate(resultsBuf, position + aggregatorOffsets[j + 5]);
      theAggregators[j + 6].aggregate(resultsBuf, position + aggregatorOffsets[j + 6]);
      theAggregators[j + 7].aggregate(resultsBuf, position + aggregatorOffsets[j + 7]);
    }
    return currentPosition;
  }
122848
function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
    var otherDimIndex = 1 - dimIndex;
    var dimName = coordSys.dimensions[dimIndex];
    return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex])
        && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);
}
159705
function buildTotalSelectedColumn(item, columnCombinations) {
  // Build a total column equal to the sum of all the active concepts.
  if (!canTotalBeCalculatedAndIfNotWarnUser(item)) {
    return [];
  }
  var thisColumnOptions = clone(item._columnOptions);
  thisColumnOptions.tableStructure = item._tableStructure;
  thisColumnOptions.id = "total selected";
  var activeConceptIds = calculateActiveConceptIds(item);
  if (activeConceptIds.length === 0) {
    return [];
  }
  // Find all the combinations of active concepts.
  // Eg. [['GDP'], ['METHOD-A', 'METHOD-C'], ['Q']] => [['GDP', 'METHOD-A', 'Q'], ['GDP', 'METHOD-C', 'Q']]
  var activeCombinations = arrayProduct(activeConceptIds);
  // Look up which columns these correspond to.
  // Note we need to convert the arrays to strings for indexOf to work.
  // Join with + as we know it cannot appear in an id, since it's used in the URL.
  // (If this string appears in any id, it will confuse things.)
  var joinString = "+";
  var stringifiedCombinations = columnCombinations.ids.map(function(
    combination
  ) {
    return combination.join(joinString);
  });
  var indicesIntoCombinations = activeCombinations.map(function(
    activeCombination
  ) {
    var stringifiedActiveCombination = activeCombination.join(joinString);
    return stringifiedCombinations.indexOf(stringifiedActiveCombination);
  });
  // Slice off the initial region &/or time columns, and only keep the value columns (ignoring total columns which come at the end).
  var valueColumns = item._tableStructure.columns.slice(
    item._numberOfInitialColumns,
    columnCombinations.ids.length + item._numberOfInitialColumns
  );
  var includedColumns = valueColumns.filter(function(column, i) {
    return indicesIntoCombinations.indexOf(i) >= 0;
  });
  if (includedColumns.length === 0) {
    return [];
  }
  var totalColumn = new TableColumn(
    "Total selected",
    TableColumn.sumValues(includedColumns),
    thisColumnOptions
  );
  totalColumn.isActive = !item.displayPercent;
  return totalColumn;
}
30612
private void mergeRows(ExcelRows excelRowsAnn, Cell templateCell, int itemSize) {
        val tmplCellRowIndex = templateCell.getRowIndex();

        for (val ann : excelRowsAnn.mergeRows()) {
            val fr = ann.fromRef();
            val cellRef = PoiUtil.isFullCellReference(fr) ? fr : fr + (tmplCellRowIndex + 1);
            val fromCell = PoiUtil.findCell(sheet, cellRef);

            val lastRow = tmplCellRowIndex + itemSize - 1;
            if (ann.type() == MergeType.Direct) {
                val fromRow = fromCell.getRow().getRowNum();
                directMergeRows(ann, fromRow, lastRow, fromCell.getColumnIndex());
            } else if (ann.type() == MergeType.SameValue) {
                sameValueMergeRows(ann, itemSize, fromCell);
            }
        }
    }
111353
public MetricNameBuilder addDimension(Dimension dimension, boolean permute) throws MetricsNameSyntaxException {
        return addDimension(dimension.getName(), dimension.getValue(), false);
    }
507921
public CrosstabBuilder addRow(String title, String property, String className, boolean showTotal) {
		DJCrosstabRow row = new CrosstabRowBuilder()
			.setProperty(property,className)
			.setShowTotals(showTotal)
			.setTitle(title)
			.build();
		addRow(row);
		return this;
	}
493395
public static int assertSameDimensionality(SpatialComparable box1, SpatialComparable box2) {
    final int dim = box1.getDimensionality();
    if(dim != box2.getDimensionality()) {
      throw new IllegalArgumentException("The spatial objects do not have the same dimensionality!");
    }
    return dim;
  }
168113
@Override
  public void aggregate()
  {
    final IndexedInts keys = keySelector.getRow();
    for (int i = 0; i < valueSelectors.length; i++) {
      values[i] = valueSelectors[i].getDouble();
    }
    synchronized (this) {
      for (int i = 0, keysSize = keys.size(); i < keysSize; i++) {
        final String key = keySelector.lookupName(keys.get(i));
        sketch.update(key, values);
      }
    }
  }
9475
public void accumulate(List<? extends StandardMetricResult> metricValues) {
        if (metricValues == null || metricValues.isEmpty()) return;
        for (StandardMetricResult v : metricValues) {
            if (lastOffset < v.offset) values.put(v.value.intValue());
        }
        lastOffset = ListUtils.last(metricValues).offset;
    }