[Scilab-users] overload column/row extraction

classic Classic list List threaded Threaded
3 messages Options
Philippe Roux Philippe Roux
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Scilab-users] overload column/row extraction

hi,

I've created a type "bigint" as an tlist :

x = tlist(['bigint','rep','signe'], tab, signe)
//  tab  =double vector
// signe = +-1

and then created a new type "mbigint" for  "matrix of bigint" as an mlist :

M=mlist(['mbigint','display','value'],D,T)
// D =matrix of strings
// T =cell  of bigint

Then I create the %mbigint_e.sci function to overload the extraction :

function r=%mbigint_e(varargin)
      M=varargin($)
      r=mlist(['mbigint','display','value'], M.display(varargin(1:$-1)),
M.value(varargin(1:$-1)))
endfunction

all kind of extractions works ( M(1,4); M(2,:) ; M(:,2) .... ) except
the mixed extraction on row/column  like M(2:3,2:3). I don't understand
the problem,  does anyone can help me ?

Philippe

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: overload column/row extraction

Hello Philippe,
Could you please provide a full executable example, and the final error
message?
It would help testing and possibly debugging.
Thanks
Samuel


Le 27/06/2017 à 22:06, philippe a écrit :

> hi,
>
> I've created a type "bigint" as an tlist :
>
> x = tlist(['bigint','rep','signe'], tab, signe)
> //  tab  =double vector
> // signe = +-1
>
> and then created a new type "mbigint" for  "matrix of bigint" as an mlist :
>
> M=mlist(['mbigint','display','value'],D,T)
> // D =matrix of strings
> // T =cell  of bigint
>
> Then I create the %mbigint_e.sci function to overload the extraction :
>
> function r=%mbigint_e(varargin)
>        M=varargin($)
>        r=mlist(['mbigint','display','value'], M.display(varargin(1:$-1)),
> M.value(varargin(1:$-1)))
> endfunction
>
> all kind of extractions works ( M(1,4); M(2,:) ; M(:,2) .... ) except
> the mixed extraction on row/column  like M(2:3,2:3). I don't understand
> the problem,  does anyone can help me ?
>
> Philippe
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Philippe Roux Philippe Roux
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: overload column/row extraction

Le 28/06/2017 à 10:45, Samuel Gougeon a écrit :
> Hello Philippe,
> Could you please provide a full executable example, and the final error
> message?  It would help testing and possibly debugging.

Sorry Samuel I finally found the solution by myself ;-) My problem comes
from insertion more than extraction. I can now manage  all matrix of
"bigint". It remains to code some functions for overloading unary/binary
operators +-,*,/,<>,==  for compatibility between double/bigint/mbigint
 .... after that I could  publish it !

best regards,

Philippe

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Loading...