Hi,<br><br>We always need a data type for 'real only' and Scilab currently use MATRIX_OF_DOUBLE_DATATYPE for this purpose. <br><br>We can map sci_matrix to a new name , for example to 'MATRIX_OF_REAL_OR_COMPLEX_DATATYPE'' or 'MATRIX_OF_NUMERIC_DATATYPE' , but can not just replace MATRIX_OF_DOUBLE_DATATYPE by this new name because MATRIX_OF_DOUBLE_DATATYPE is used otherwhere for to mean real only data type. <br>
<br><br>YungLee<br><br><div class="gmail_quote">2008/5/28 Vincent COUVERT <<a href="mailto:vincent.couvert@inria.fr">vincent.couvert@inria.fr</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
We must not take mexlib.c into account for the standardization of Scilab messages. The mexlib module is just an interface to use Matlab MEX-files from Scilab and the data types defined in mexlib.c do not exactly match Scilab data types.<br>
<br>
sci_matrix is the standard data type when you use Scilab (e.g. when you enter a=1, a is a sci_matrix in C code) and has nothing to do with MATRIX_OF_INTEGER_DATATYPE which is the data type used when you enter a=int8(1) for example.<br>
<br>
So MATRIX_OF_DOUBLE_DATATYPE is not so bad even if the fact that this data type can be real or complex...<br>
<br>
Vincent<div class="Ih2E3d"><br>
<br>
Yung-Jang Lee a écrit :<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Wait ,<div><div></div><div class="Wj3C7c"><br>
<br>
You have defined MATRIX_OF_DOUBLE_DATATYPE and MATRIX_OF_COMPLEX_DATATYPE in stackTypeVariable.h which are used for calling F77 code,<br>
<br>
----------------------------------------------------------------<br>
#define MATRIX_OF_DOUBLE_DATATYPE "d"<br>
#define MATRIX_OF_COMPLEX_DATATYPE "z"<br>
#define MATRIX_OF_INTEGER_DATATYPE "i"<br>
#define MATRIX_OF_RATIONAL_DATATYPE "r"<br>
----------------------------------------------------------------<br>
<br>
and then define sci_matrix , sci_poly .. in stack-c.h which are used for scilab internal,<br>
<br>
----------------------------------------------------------<br>
typedef enum {<br>
sci_matrix = 1 ,<br>
sci_poly = 2 ,<br>
sci_boolean = 4 ,<br>
..<br>
--------------------------------------------------------<br>
<br>
And then I find statement in function overloadtype which is called by getrhsvar, here all numeric type (double,integer,rational and complex) are maped to sci_matrix<br>
-------------------------------------------------<br>
case 'd' : case 'i' : case 'r' : case 'z' : /* numeric */<br>
ityp=sci_matrix;<br>
-------------------------------------------------------------<br>
<br>
<br>
Finally, in mexlib.c you use DOUBLEMATRIX to represent sci_matrix.<br>
<br>
----------------------------------------------------<br>
#define DOUBLEMATRIX sci_matrix<br>
------------------------------------------------------<br>
<br>
So DOUBLEMATRIX becomes union of {DOUBLE MATRIX,COMPLEX MATRIX, INTEGER MATRIX...}<br>
.<br>
<br>
I think DOUBLEMATRIX defined in mexlib.c cause confusion and the second row in table of 'data type nameing' in ScilabWiki page,<br>
<br>
<a href="http://wiki.scilab.org/Localization_in_English_-_Standard_messages" target="_blank">http://wiki.scilab.org/Localization_in_English_-_Standard_messages</a><br>
<br>
should be changed to<br>
<br>
constant : sci_matrix : -->a generic numeric type or<br>
union of MATRIX_OF_DOUBLE_DATATYPE, MATRIX_OF_COMPLEX_DATATYPE,<br>
MATRIX_OF_INTEGER_DATATYPE<br>
MATRIX_OF_RATIONAL_DATATYPE<br>
<br>
, sci_matrix is not just MATRIX_OF_DOUBLE_DATATYPE.<br>
<br>
<br>
I think change MATRIX_OF_DOUBLE_DATATYPE to MATRIX_OF_REAL_OR_COMPLEX<br>
<br>
_DATATYPE will cause trouble, because MATRIX_OF_DOUBLE_DATATYPE is<br>
used heavily in calling F77 code.<br>
<br>
<br>
sci_matrix may has a generic name 'MATRIX_OF_NUMERIC_DATATYPE' and let MATRIX_OF_DOUBLE_DATATYPE to a represent (double precision ) real matrix just like its role in F77 code.<br>
<br>
YungLee<br>
<br>
<br>
<br></div></div>
2008/5/27 Sylvestre Ledru <<a href="mailto:sylvestre.ledru@inria.fr" target="_blank">sylvestre.ledru@inria.fr</a> <mailto:<a href="mailto:sylvestre.ledru@inria.fr" target="_blank">sylvestre.ledru@inria.fr</a>>>:<div>
<div></div><div class="Wj3C7c"><br>
<br>
Hmmm, after a quick look with Vincent C. (who is also on this mailing<br>
list), we realize that, yes, 'MATRIX_OF_DOUBLE_DATATYPE' is badly<br>
choose name in the source. It is causing confusion in the code.<br>
We are going to rename it to something like<br>
MATRIX_OF_REAL_OR_COMPLEX_DATATYPE<br>
Any comments on this?<br>
<br>
> To avoid mistake, use 'a real' if it really need a real, 'real<br>
> matrix' if we need a real matrix or 'real or complex matrix' if we<br>
> need a generic data.<br>
Yep, we are reading all messages (you can imagine how sexy it is) and<br>
changing thme.<br>
<br>
Sylvestre<br>
<br>
PS: I c/c the dev mailing list since it is border-line.<br>
<br>
Le mardi 27 mai 2008 à 20:08 +0800, Yung-Jang Lee a écrit :<br>
> If we ever trace the code, (for example GUI\sci_gateway\c<br>
> \sci_delmenu.c)<br>
><br>
><br>
------------------------------------------------------------------------------------------------------<br>
> // Unset a Menu a Scilab Graphic Window<br>
> if (VarType(1) != sci_matrix)<br>
> {<br>
> Scierror(999, _("%s: Wrong type for first input argument:<br>
> Double value expected.\n"),fname);<br>
> return FALSE;<br>
> }<br>
> GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &nbRow, &nbCol,<br>
> &stkAdr);<br>
><br>
------------------------------------------------------------------------------------------------------<br>
> 'Double value' always maps to 'MATRIX_OF_DOUBLE_DATATYPE' which<br>
means<br>
> 'real or complex matrix' in Scilab. (Memory representation of<br>
> variables or<br>
> <a href="http://wiki.scilab.org/Localization_in_English_-_Standard_messages" target="_blank">http://wiki.scilab.org/Localization_in_English_-_Standard_messages</a><br>
> ).<br>
><br>
> But if we follow the gui context then 'Double value' seems to<br>
mean 'a<br>
> real' (I don't expect to read any complex value in GUI<br>
applications).<br>
><br>
> The use of 'Double value' causes trouble in interpretation of the<br>
> meaning, especially if coupled with the use of 'Single value' which<br>
> means 1x1 matrix.<br>
><br>
> To avoid mistake, use 'a real' if it really need a real, 'real<br>
> matrix' if we need a real matrix or 'real or complex matrix' if we<br>
> need a generic data.<br>
><br>
><br>
> YungLee<br>
><br></div></div>
> 2008/5/27 Shiqi Yu <<a href="mailto:shiqi.yu@gmail.com" target="_blank">shiqi.yu@gmail.com</a> <mailto:<a href="mailto:shiqi.yu@gmail.com" target="_blank">shiqi.yu@gmail.com</a>>>:<div class="Ih2E3d">
<br>
> I think they are all means a double float point real<br>
> scalar(1x1 matrix), but we can't replace them with 'real or<br>
> complex matrix'.<br>
> First, if we use 'matrix', users will input a MxN (M,N>1)<br>
> matrix.<br>
> Second, I think they must be real and can't be complex.<br>
><br>
><br>
> 2008/5/27 Yung-Jang Lee <<a href="mailto:yjlee123@gmail.com" target="_blank">yjlee123@gmail.com</a><br></div>
<mailto:<a href="mailto:yjlee123@gmail.com" target="_blank">yjlee123@gmail.com</a>>>:<div class="Ih2E3d"><br>
><br>
><br>
> Hi all,<br>
><br>
> In gui.pot , I found following different messages<br>
><br>
> 'A double value expected',<br>
> 'A double expected',<br>
> 'Scalar value expected',<br>
> 'A value expected',<br>
> 'Single value expected'<br>
><br>
> and they all means 'A real or complex'.<br>
><br>
> I module gui, 'double value' means 'real or complex<br>
> matrix', 'single value' means '1x1 matrix' and 'A..'<br>
> also means '1x1 matrix' . Follow this way, we<br>
have<br>
><br>
> 'A double vaule' == 'Single value' == 'A value'.<br>
><br>
> I think this induce unnecessary mistake. It is<br>
better<br>
> to replace 'double value' to 'real or complex<br>
matrix'<br>
> or just 'matrix' in gui module.<br>
><br>
> YungLee<br>
><br>
><br>
><br>
><br>
> --<br>
> Shiqi Yu<br>
> Shenzhen Institute of Advanced Technology,<br>
> Chinese Academy of Sciences.<br>
> Homepage: <a href="http://yushiqi.cn" target="_blank">http://yushiqi.cn</a><br>
><br>
<br>
<br>
</div></blockquote>
<br>
-- <br>
==============================================<br>
Vincent COUVERT<br>
Centre de Recherche INRIA Paris-Rocquencourt<br>
Domaine de Voluceau - B.P. 105<br>
78153 Le Chesnay Cedex<br>
==============================================<br>
Equipe Projet SCILAB<br>
Bâtiment 1B - Bureau 013<br>
Email : <a href="mailto:vincent.couvert@inria.fr" target="_blank">vincent.couvert@inria.fr</a><br>
Tél : +33 (0)1 39 63 54 46<br>
Fax : +33 (0)1 39 63 55 94<br>
==============================================<br>
<br>
</blockquote></div><br>