当前位置: 首页>>代码示例>>Java>>正文


Java ICombinatoricsVector.getSize方法代码示例

本文整理汇总了Java中org.paukov.combinatorics.ICombinatoricsVector.getSize方法的典型用法代码示例。如果您正苦于以下问题:Java ICombinatoricsVector.getSize方法的具体用法?Java ICombinatoricsVector.getSize怎么用?Java ICombinatoricsVector.getSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.paukov.combinatorics.ICombinatoricsVector的用法示例。


在下文中一共展示了ICombinatoricsVector.getSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ComplexCombinationGenerator

import org.paukov.combinatorics.ICombinatoricsVector; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param originalVector
 *            Original vector/set which is used for combination generation
 * @param combinationsLength
 *            Length of combination to generate
 * @param isOrderImportant
 *            true if the order of the generated combinations is important
 * @param excludeEmptySet
 *            true if the empty set has to be excluded from the generated
 *            combinations
 */
public ComplexCombinationGenerator(ICombinatoricsVector<T> originalVector,
		int combinationsLength, boolean isOrderImportant,
		boolean excludeEmptySet) {

	if (excludeEmptySet && combinationsLength > originalVector.getSize())
		throw new RuntimeException(
				"Unable to generate complex combinations, the requested combination length is more then the size of the original vector, length: "
						+ combinationsLength
						+ ", originalVector: "
						+ originalVector);

	_originalVector = Factory.createVector(originalVector);
	_combinationLength = combinationsLength;
	_isOrderImportant = isOrderImportant;
	_excludeEmptySet = excludeEmptySet;
}
 
开发者ID:dpaukov,项目名称:combinatoricslib,代码行数:30,代码来源:ComplexCombinationGenerator.java

示例2: convertIndexes2String

import org.paukov.combinatorics.ICombinatoricsVector; //导入方法依赖的package包/类
/**
 * This method converts a composition into a string
 * 
 * @param vector
 *            The vector
 * @return A string representation of the given vector
 */
public static <T> String convertIndexes2String(T[] elements,
		ICombinatoricsVector<ICombinatoricsVector<Integer>> vector) {
	StringBuilder sb = new StringBuilder();
	sb.append("(");
	for (int i = 0; i < vector.getSize(); i++) {
		sb.append("[");
		for (int j = 0; j < vector.getValue(i).getVector().size(); j++)	{
			sb.append(elements[vector.getValue(i).getValue(j)]);
			if (j != vector.getValue(i).getVector().size() - 1)
				sb.append(",");
		}
		sb.append("]");
		if (i != vector.getSize() - 1)
			sb.append(",");
	}
	sb.append(")");
	return sb.toString();

}
 
开发者ID:dpaukov,项目名称:combinatoricslib,代码行数:27,代码来源:ComplexCombinationGenerator.java

示例3: validateWithAllCombinations

import org.paukov.combinatorics.ICombinatoricsVector; //导入方法依赖的package包/类
/**
 * Validates processor against many combinations built from available converters. For more details check
 * https://github.com/dpaukov/combinatoricslib#5-subsets
 * 
 * @param content
 *            content that should be converted
 */
public void validateWithAllCombinations(String content) {
    ICombinatoricsVector<Converter> allConverters = Factory.createVector(CONVERTERS);
    Generator<Converter> subSet = Factory.createSubSetGenerator(allConverters);

    for (ICombinatoricsVector<Converter> subConverters : subSet) {
        if (subConverters.getSize() != 0) {
            Converter[] converters = subConverters.getVector().toArray(new Converter[subConverters.getSize()]);
            validateWithSetsOfDecisions(converters, content);
        }
    }
}
 
开发者ID:damianszczepanik,项目名称:silencio,代码行数:19,代码来源:ProcessorSmokeChecker.java

示例4: validateWithSetsOfDecisions

import org.paukov.combinatorics.ICombinatoricsVector; //导入方法依赖的package包/类
private void validateWithSetsOfDecisions(Converter[] converters, String content) {
    ICombinatoricsVector<Decision> allDecisions = Factory.createVector(DECISIONS);
    Generator<Decision> subSet = Factory.createSubSetGenerator(allDecisions);

    for (ICombinatoricsVector<Decision> subDecisions : subSet) {
        if (subDecisions.getSize() != 0) {
            Decision[] decisions = subDecisions.getVector().toArray(new Decision[subDecisions.getSize()]);
            Execution[] executions = { new Execution(decisions, converters) };
            validateProcessor(executions, content);
        }
    }
}
 
开发者ID:damianszczepanik,项目名称:silencio,代码行数:13,代码来源:ProcessorSmokeChecker.java

示例5: convert2String

import org.paukov.combinatorics.ICombinatoricsVector; //导入方法依赖的package包/类
/**
 * This method converts a composition into a string
 * 
 * @param vector
 *            The vector
 * @return A string representation of the given vector
 */
public static <T> String convert2String(
		ICombinatoricsVector<ICombinatoricsVector<T>> vector) {
	StringBuilder sb = new StringBuilder();
	sb.append("(");
	for (int i = 0; i < vector.getSize(); i++) {
		sb.append(vector.getValue(i).getVector().toString());
		if (i != vector.getSize() - 1)
			sb.append(",");
	}
	sb.append(")");
	return sb.toString();

}
 
开发者ID:dpaukov,项目名称:combinatoricslib,代码行数:21,代码来源:ComplexCombinationGenerator.java


注:本文中的org.paukov.combinatorics.ICombinatoricsVector.getSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。