

#ifndef _SCPROBLEM_H
#define	_SCPROBLEM_H


#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "common.h"

#ifdef	__cplusplus
extern "C" {
#endif

    
#define RM_ENULL -1
#define RM_ERANGE -2
    
#define RM_TRUE 1
#define RM_FALSE 0

#define SCPROBLEM_IDSYS_SEQUENTIAL 128
    
/** \defgroup SCP Set covering problem
 *  @{
 */

typedef struct _SCProblem SCProblem;


/** \brief Set covering problem */
struct _SCProblem {

    /** Number of rows*/
    int rows;
    /** Number of columns*/
    int columns;

    /** Matrix*/
    unsigned char* data;
    
    /** Vector of column costs*/
    unsigned int* columnCosts;

    
};


/** \brief Create new SCProblem
 *  \param rows Number of rows
 *  \param cols Number of columns
 */
SCProblem* scproblem_new(int rows,int columns);

/** \brief Delete SCProblem
 *  \param m affected SCProblem
 */
void scproblem_delete(SCProblem* m);

/** \brief Set 0 or 1 in specified row and column
 *  \param row row
 *  \param column column
 *  \param value value
 */
void scproblem_set(SCProblem* m,int row,int column,unsigned char value);


/** \brief Set cost of column
 *  \param column Column
 *  \param cost Cost
 */
void scproblem_set_cost(SCProblem* m,int column,unsigned int cost);

/** \brief Set 0 or 1 in spare row
 *  \param column Index of column
 *  \param value value
 */
void scproblem_spare_row_set(SCProblem* m,int column,unsigned char value);
/**@}*/

#ifdef	__cplusplus
}
#endif

#endif	/* _SCPROBLEM_H */

