Hi,

Is it possible to pass multiple matrices to a function? along with certain constraints? In short how to deal with matrix valued function along with constraints ( e.g. an inequality containing matrices)?

A*X-B =C;

Where A, X, B and C are matrices.

Can you please also elaborate in this case what to pass f.eval_matrix() function?

if the function is of the form: Function f (A,B,C,X, Return(A*X-B))

NumConstraint(A,B,C,X, A*X-B =C)

Thanks,

- Log in to post comments

zenno

Wed, 02/25/2015 - 23:54

Permalink

## Giving Arguments to a function

Usman,

All eval_XXX functions expects a single box in argument that represents all the arguments (scalars, vectors, matrices) stored in a single flat array.

To build this vector, the best is to use backward projection functions. Here is an example with f(A,B,C)=A+B-C:

Then:

Sincerly,

Gilles

usmanrauf85

Fri, 02/27/2015 - 19:48

Permalink

## Thanks,

Hi,

I tried following but it throws me an error: Segmentation fault (core dumped)

Variable a,b,c;

Function pA(a,b,c,a);

Function pB(a,b,c,b);

Function pC(a,b,c,c);

Function f(a,b,c, (a+b-c));

double _A[2*2][2]={{2,2},{-1,-1},{-1,-1},{2,2}};

IntervalMatrix MA(2,2,_A);

double _B[2*2][2]={{1,1},{-1,-1},{1,1},{1,1}};

IntervalMatrix MB(2,2,_B);

double _C[2*2][2]={{1,1},{0,0},{0,0},{1,1}};

IntervalMatrix MC(2,2,_C);

IntervalVector box(3*2*2);

pA.backward(MA,box);

pB.backward(MB,box);

pC.backward(MC,box);

IntervalMatrix M = f.eval_matrix(box);

What can be the reason?

Thanks,

zenno

Sun, 03/01/2015 - 13:45

Permalink

## It's because you did not

It's because you did not specify the row/column dimension of the variables.

I have update the documentation and inserted the (correct) code for this example here:

http://www.ibex-lib.org/doc/modeling.html#evaluation-forward-computation

Best regards

Gilles

usmanrauf85

Mon, 03/02/2015 - 21:47

Permalink

## Didn't Work

Dr. Gilles,

It still throws an error, of segmantation fault (core dumped), even the running example that you mentioned throws the same error. It has anything to do with the version of ibex?

Thank,

zenno

Tue, 03/03/2015 - 09:13

Permalink

## It should not throw a seg

It should not throw a seg fault. Maybe, try to upgrade to the last release of Ibex.

Gilles