Question: how to use correctly assumptions about Matrix elements

Dear All,

I would like to make assumptuions about the input parameters of a procedure. The input parameter of the procedure should be the (1,1) element of a 2-dimensional Matrix. I make the same assumptions for the elements of the Matrix as expected by the procedure. When I  call he procedure with the (1,1) element of the matrix, it gives the following error. How should I use the assumptions or how to pass correctly the parameter to the procedure in this particular case?

> with(LinearAlgebra):
> X:=Matrix(2,2,symbol=x);
                         [x[1, 1]  x[1, 2]]
                    X := [                ]
                         [x[2, 1]  x[2, 2]]
> for i to 2 do:
> for j to 2 do:
> assume(X[i,j],RealRange(0,1));
> od;
> od;
> about(X,X[1,1]);
Matrix(2, 2, [[x[1,1],x[1,2]],[x[2,1],x[2,2]]], datatype = anything, storage = rectangular, order = Fortran_order, shape = []):  property aliased to Matrix(2, 2, [[x[1,1],x[1,2]],[x[2,1],x[2,2]]], datatype = anything, storage = rectangular, order = Fortran_order, shape = [])
Originally x[1,1], renamed x~[1, 1]:  is assumed to be: RealRange(0,1)


> test:=proc(x::RealRange(0,1))
> print(x);
> end;
      test := proc(x::RealRange(0, 1)) print(x) end proc;
> test(X[1,1]);
Error, invalid input: test expects its 1st argument, x, to be of type RealRange(0, 1), but received `x`[1, 1]

 Any comments are welcome!

BR,

Zoltán Faigl

Please Wait...