Skip to content
/ scpxx Public

A simple C++ library for set covering problem instances made available in OR-Library.

License

Notifications You must be signed in to change notification settings

ropinho/scpxx

Repository files navigation

SCPxx

build Codacy Badge License: MIT

A simple C++ library for reading Set Covering Problem (SCP) instances made available in OR-Library.

Installation

The installation require CMake to generate build files of the library.

Clone this repository, in command line, access the project directory. Create a folder to files generating by cmake.

$ mkdir build && cd build

Uses make to install locally the headers. In build directory, type

$ cmake ..
$ sudo make install

By default, the files are placed in /usr/local/include/scpxx/.

List of problems

Following problems existing in OR-Library that can be readed here are:

  • Set covering problem (SCP)

Usage

Example using matrix class for set covering problem:

#include <iostream>
#include <scpxx/scp.h>

using namespace scpxx;

int main() {
    SCPFile file("../scp41.txt");

    // Read all numbers in file and copy to a vector
    file.bufferize();

    // Get the vector with all numbers
    std::vector<int> vec = file.values();
    std::cout << "Number of values: " << vec.size() << std::endl;
    
    // The method generate_matrix build the matrix object
    auto matrix = file.generate_matrix();

    std::cout << matrix.num_rows() << " rows\n";
    std::cout << matrix.num_columns() << " columns\n";
    return 0;
}

License

Licensed under the MIT license.

About

A simple C++ library for set covering problem instances made available in OR-Library.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages