Skip to content

[doc] adding inter and union for IntervalVector and IntervalMatrix, lessonB and C in Matlab#343

Merged
SimonRohou merged 16 commits intocodac-team:codac2_devfrom
godardma:codac2_dev
Jan 30, 2026
Merged

[doc] adding inter and union for IntervalVector and IntervalMatrix, lessonB and C in Matlab#343
SimonRohou merged 16 commits intocodac-team:codac2_devfrom
godardma:codac2_dev

Conversation

@godardma
Copy link
Collaborator

@godardma godardma commented Jan 20, 2026

  • Adding inter and union for IntervalVector
  • Adding missing subvector_0 and get_item_0
  • Lesson B and C of the tutorial in Matlab
  • CtcInverse documentation update with Matlab
  • binding to choose the random seed

@godardma godardma changed the title [doc] adding inter and union for IntervalVector and IntervalMatrix, lessonB begin [doc] adding inter and union for IntervalVector and IntervalMatrix, lessonB in Matlab Jan 21, 2026
@godardma godardma changed the title [doc] adding inter and union for IntervalVector and IntervalMatrix, lessonB in Matlab [doc] adding inter and union for IntervalVector and IntervalMatrix, lessonB and C in Matlab Jan 26, 2026

% Or using a fixpoint method:
function [x,y,m,a,d] = constraints(x,y,m,a,d,ctc_plus,ctc_polar,ctc_minus)
res_ctc_plus = ctc_plus.contract(py.codac4matlab.cart_prod(x(3), y(2), a)); % The result is a 3D IntervalVector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple curiosité : il est nécessaire de préciser "py.codac4matlab".cart_prod ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui, en matlab les fonctions ont un comportement qui fait qu'il faut visiblement préciser "py.codac4matlab." pour appeler les fonctions de codac.
C'est peut-être dû à une notion de "scope" de l'import
import py.codac4matlab.*


while vol ~= prev_vol
prev_vol = vol;
[x,y,m,a,d] = constraints(x,y,m,a,d,ctc_plus,ctc_polar,ctc_minus);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"contract" au lieu de "constraints" (constraints = symbolique)

Copy link
Collaborator Author

@godardma godardma Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour cette fonction j'ai repris le nom de la version python (constraints). J'ai changé le nom dans les deux fichiers.

@@ -0,0 +1,26 @@
classdef MyCtc < handle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il n'y a pas d'héritage de Ctc_IntervalVector ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matlab n'a pas l'air de vouloir créer un objet matlab à partir d'un objet python (Ctc_IntervalVector).
Un "patch" est d'ajouter un Ctc_IntervalVector dans les propriétés de la classe. Je l'avais fait mais je n'ai pas l'impression que ça soit utile ici donc je l'ai enlevé.

// Example:
a = IntervalVector(2); // box for x
b = IntervalVector({{2,3},{5,6.2}}); // box for m
d = Interval(4.5,5); // interval for y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments using "%" ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui... oops...

@SimonRohou SimonRohou merged commit 1506907 into codac-team:codac2_dev Jan 30, 2026
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants