[gecode-users] seg. fault

penche21 penche21 penche21 at hotmail.com
Wed May 16 22:42:31 CEST 2007


upps! I have just found what is wrong with Q1. Sorry for that.
Nevermind, its off-gecode.

>From: "penche21 penche21" <penche21 at hotmail.com>
>To: users at gecode.org
>Subject: [gecode-users] seg. fault
>Date: Wed, 16 May 2007 16:50:05 +0000
>
>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/
>
>
>_______________________________________________
>Gecode users mailing list
>users at gecode.org
>https://www.gecode.org/mailman/listinfo/gecode-users

_________________________________________________________________
Spam filtresi ile virüslere karsi en güvenilir koruma, MSN PC Koruma'dan 
geçer. http://www.msn.com.tr/security/





More information about the gecode-users mailing list