[gecode-users] seg. fault

penche21 penche21 penche21 at hotmail.com
Wed May 16 18:50:05 CEST 2007


Hi all,

I have two questions that I could'nt help myself  though some time passed..

1)  This piece returns me a segmentation fault.

with an initialized matrix M(r,c), I want to have boolean operations on 
cells.

    Cells = BoolVarArray(this, r*c, 0, 1);
    Row = BoolVarArray(this, r, 0, 1);

1. for(i to r)
2.   for(j to c)

3.       current = M[i][j];

4.       if(M[i][j] > 0)

5.           bool_or(this, Row[i], Cells [current], Row [i]);

6.      else
7.           BoolVar negate = BoolVar(this, 0,1);

8.           bool_not(this, Cells [current], negate);

9.           bool_or(this, Row [i], negate, Row [i]);

simply I disjunt every cell in the rows into RowBoolArray.
But this gives me segmentation fault.

When I comment out 5,7,8,9 it terminates safely.
Is there a missing initialization in my BoolArrays or sth else may be??

2) I could not find how to use matrix under minimodel for the Slice 
operator.

declaration with

MiniModel::Matrix<IntVarArray> sub_matrix = matrix.slice(0,r,c,r',c');
rel(this, sub_matrix.row(1), IRT_EQ, sub_matrix.row(2));

error: conversion from 
`Gecode::MiniModel::Matrix<Gecode::IntVarArray>::Slice' to non-scalar type 
`Gecode::MiniModel::Matrix<Gecode::IntVarArray>' requested

Isnt a slice is again a matrix wrappered for IntVarArray ?


Thank you in advance,
Regards

penche

_________________________________________________________________
Hava durumunu bizden ögrenin ve evden öyle çikin! 
http://www.msn.com.tr/havadurumu/





More information about the gecode-users mailing list