Getting "segmentation fault" when modeling a sparse matrix

66 views
Skip to first unread message

Albert Canyelles

unread,
Jul 13, 2023, 2:19:17 PM7/13/23
to Gecode
I've been fiddling with Gecode for a couple of weeks now, but I got stuck trying to represent a model. The input consists of a sparse matrix, where each cell must have a value belonging to some non-intersecting intervals that vary from cell to cell. For example, in a 5*5 matrix called "mat", the cell mat[1][1] may have a value within the intervals [10,15] or [20, 23], mat[1][2] within [13, 21], and mat[3][3] within [5,6]. Those cells must satisfy some constraints between each other and the rest of the 5*5 matrix.

To solve such problem I'm building a model extending the class Space. It contains a vector<vector<IntVar>> variable and initializes each IntVar individually inside the body of the model constructor. The thing is that the type of this variable does not seem suitable to work in Gecode, as a "segmentation fault" is thrown when cloning the Space. Any suggestions on how to proceed?

Kind regards,
Albert

INFORMATION ON DATA PROTECTIONDATA CONTROLLER: CADT SOFTWARE AND DRAFTING SL (B64003064)
We inform you that your identifying data and the contents of this email and all attachments may be included in our data files for professional and / or commercial relationships, and that they will be stored for the duration of the relationship. You have the right to access, rectify, delete and oppose your data and exercise other legally recognized rights by contacting the sender's email or gd...@cadt.com.
This message and any attached document, if any, may be confidential and is intended solely for the person or entity to which they have been sent.

INFORMACIÓ PROTECCIÓ DE DADES. Responsable: CADT SOFTWARE AND DRAFTING SL (B64003064)
L'informem que les seves dades identificatives i els continguts en els correus electrònics i fitxers adjunts poden ser incorporats a les nostres bases de dades amb la finalitat de mantenir relacions professionals i/o comercials i, que seran conservats mentre es mantingui la relació. Si ho desitja, pot exercir el seu dret a accedir, rectificar i suprimir els seves dades i altres reconeguts normativament dirigint-se al correu emisor o a gd...@cadt.com.
Aquest missatge i qualsevol document que porti adjunt, en el seu cas, pot ser confidencial i destinat únicament a la persona o entitat a qui ha estat enviat.

INFORMACIÓN PROTECCIÓN DE DATOS. Responsable: CADT SOFTWARE AND DRAFTING SL (B64003064)
Le informamos que sus datos identificativos y los contenidos en los correos electrónicos y ficheros adjuntos pueden ser incorporados a nuestras bases de datos con la finalidad de mantener relaciones profesionales y/o comerciales y, que serán conservados mientras se mantenga la relación. Si lo desea, puede ejercer su derecho a acceder, rectificar y suprimir sus datos y demás reconocidos normativamente dirigiéndose al correo emisor o en gd...@cadt.com.
Este mensaje y cualquier documento que lleve adjunto, en su caso, puede ser confidencial y destinado únicamente a la persona o entidad a quien ha sido enviado. 

Marcus Vilain

unread,
Jul 13, 2023, 8:42:01 PM7/13/23
to gec...@googlegroups.com

Hello,

I have 2 comments:
1) There may be a problem in your copy constructor
2) why do you use a vector of vector instead of a Matrix<IntVarArray> ?

Marcus


--
You received this message because you are subscribed to the Google Groups "Gecode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gecode+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gecode/ee9f88c6-a037-4c6b-8e08-b7e3c3307982n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages