All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.gitlab.chaver.mining.patterns.util.BitSetFactory Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
/*
 * This file is part of io.gitlab.chaver:data-mining (https://gitlab.com/chaver/data-mining)
 *
 * Copyright (c) 2022, IMT Atlantique
 *
 * Licensed under the MIT license.
 *
 * See LICENSE file in the project root for full license information.
 */
package io.gitlab.chaver.mining.patterns.util;

import io.gitlab.chaver.mining.patterns.io.Database;
import org.chocosolver.solver.Model;

public class BitSetFactory {

    public static BitSetFacade getBitSet(String type, Database database, Model model) {
        if (type.equals(RSparseBitSetFacade.TYPE)) {
            return new RSparseBitSetFacade(database, model, database.getNbTransactions());
        }
        throw new RuntimeException("Incorrect BitSet type : " + type);
    }

    public static BitSetFacade getBitSet1(String type, Database database, Model model) {
        if (type.equals(RSparseBitSetFacade.TYPE)) {
            return new RSparseBitSetFacade(database, model, database.getDatasetAsLongArray()[0]);
        }
        throw new RuntimeException("Incorrect BitSet type : " + type);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy