[Scilab-users] scilab2c toolbox query

classic Classic list List threaded Threaded
5 messages Options
Abhinav Dronamraju Abhinav Dronamraju
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] scilab2c toolbox query


Dear Sir,

I am Abhinav and I'm working on the scilab2c toolbox. It would be helpful if one of the Scilab2C toolbox developers could guide us with any solution for the problems mentioned below-

1) To write a new function, we always have to decide the output sizes according to scalar inputs or size of input matrix. But, if our output size depends on an element which is a part of matrix, what can we do to assign the output size accordingly.

2) There are few functions whose output size has no relation to input matrix sizes, or they don't follow any regular pattern. For example, they depend on rank of input matrix or something else. For such functions, is there any work around to estimate the size first and assign accordingly in the Tool Initialisation part.
If you could take some time and reply with a workaround for these problems, it would be helpful to successfully emulate most of the Scilab functions in C language. If someone could provide contact details of the toolbox developers, that would be useful too.

Thanks,
Abhinav

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Christophe Dang Ngoc Chan Christophe Dang Ngoc Chan
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} scilab2c toolbox query

Hello,

> De : Abhinav Dronamraju
> Envoyé : jeudi 10 août 2017 08:53
>
>  if our output size depends on an element which is a part of matrix, what can we do to assign the output size accordingly.

I'm not sure I understand well your question,
but maybe you should have a look at varagout

https://help.scilab.org/docs/6.0.0/en_US/varargout.html

HTH,

regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Clément David-3 Clément David-3
Reply | Threaded
Open this post in threaded view
|

Re: scilab2c toolbox query

In reply to this post by Abhinav Dronamraju
Hello Abhinav,

Nice to have someone interested in scilab2c. Currently there is no active maintainer, feel free to
contribute to it.

> 1) To write a new function, we always have to decide the output sizes according to scalar inputs
> or size of input matrix. But, if our output size depends on an element which is a part of matrix,
> what can we do to assign the output size accordingly.

The current code generation need a C-like arguments representation for the Scilab function to
generate the good corresponding C function call. If you wish to have a more dynamic behavior to
define the outputs argument you should probably need to serialize/deserialize them in some way to a
raw vector.

> 2) There are few functions whose output size has no relation to input matrix sizes, or they don't
> follow any regular pattern. For example, they depend on rank of input matrix or something else.
> For such functions, is there any work around to estimate the size first and assign accordingly in
> the Tool Initialisation part.

No currently in the Scilab2C code and with my limited understanding, there is no way to compute the
number of / size of the arguments. This approach however is fully valid and is partially implemented
in the Scilab 6 analysis pass. A completely rewritten Scilab2C could then use the propagated size /
types constraints to handle theses dynamic functions. Could you give me a function you wish to add ?

Thanks,

--
Clément
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
brijesh guptacr brijesh guptacr
Reply | Threaded
Open this post in threaded view
|

Re: scilab2c toolbox query

Hello,

Brijesh here. Abhinav and I work together on Scilab2c. 

1)Will a completely rewritten scilab2c in 5.5.2 solve the issues we are facing?

2) Can you please explain in a little more detail as to how the suggested approach works in Scilab 6 and why not in 5.5.2. 

3)Would switching from 5.5.2 to 6 help us?

Sysdiag, orth, pca and svd to name a few functions that are problematic. 

With Regards,
Brijesh Gupta C R

On Wed, Sep 6, 2017 at 7:13 PM, Clément David <[hidden email]> wrote:
Hello Abhinav,

Nice to have someone interested in scilab2c. Currently there is no active maintainer, feel free to
contribute to it.

> 1) To write a new function, we always have to decide the output sizes according to scalar inputs
> or size of input matrix. But, if our output size depends on an element which is a part of matrix,
> what can we do to assign the output size accordingly.

The current code generation need a C-like arguments representation for the Scilab function to
generate the good corresponding C function call. If you wish to have a more dynamic behavior to
define the outputs argument you should probably need to serialize/deserialize them in some way to a
raw vector.

> 2) There are few functions whose output size has no relation to input matrix sizes, or they don't
> follow any regular pattern. For example, they depend on rank of input matrix or something else.
> For such functions, is there any work around to estimate the size first and assign accordingly in
> the Tool Initialisation part.

No currently in the Scilab2C code and with my limited understanding, there is no way to compute the
number of / size of the arguments. This approach however is fully valid and is partially implemented
in the Scilab 6 analysis pass. A completely rewritten Scilab2C could then use the propagated size /
types constraints to handle theses dynamic functions. Could you give me a function you wish to add ?

Thanks,

--
Clément
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Clément David-3 Clément David-3
Reply | Threaded
Open this post in threaded view
|

Re: scilab2c toolbox query

Hello Brijesh,

To me, scilab2c for 5.5.2 works in its limited functional scope. For sysdiag or any other complex
function is suggest you to define types / sizes in a dynamic way using a scilab function to compute
them from inputs rather than implementing a mapping table (as it is currently done).

FYI scilab2c does not seems to work on Scilab 6.0.0 (at least last time I checked).

Thanks,

--
Clément

Le dimanche 10 septembre 2017 à 12:17 +0530, brijesh guptacr a écrit :

> Hello,
>
> Brijesh here. Abhinav and I work together on Scilab2c.
>
> 1)Will a completely rewritten scilab2c in 5.5.2 solve the issues we are facing?
>
> 2) Can you please explain in a little more detail as to how the suggested approach works in Scilab
> 6 and why not in 5.5.2.
>
> 3)Would switching from 5.5.2 to 6 help us?
>
> Sysdiag, orth, pca and svd to name a few functions that are problematic.
>
> With Regards,
> Brijesh Gupta C R
>
> On Wed, Sep 6, 2017 at 7:13 PM, Clément David <[hidden email]> wrote:
> > Hello Abhinav,
> >
> > Nice to have someone interested in scilab2c. Currently there is no active maintainer, feel free
> > to
> > contribute to it.
> >
> > > 1) To write a new function, we always have to decide the output sizes according to scalar
> > inputs
> > > or size of input matrix. But, if our output size depends on an element which is a part of
> > matrix,
> > > what can we do to assign the output size accordingly.
> >
> > The current code generation need a C-like arguments representation for the Scilab function to
> > generate the good corresponding C function call. If you wish to have a more dynamic behavior to
> > define the outputs argument you should probably need to serialize/deserialize them in some way
> > to a
> > raw vector.
> >
> > > 2) There are few functions whose output size has no relation to input matrix sizes, or they
> > don't
> > > follow any regular pattern. For example, they depend on rank of input matrix or something
> > else.
> > > For such functions, is there any work around to estimate the size first and assign accordingly
> > in
> > > the Tool Initialisation part.
> >
> > No currently in the Scilab2C code and with my limited understanding, there is no way to compute
> > the
> > number of / size of the arguments. This approach however is fully valid and is partially
> > implemented
> > in the Scilab 6 analysis pass. A completely rewritten Scilab2C could then use the propagated
> > size /
> > types constraints to handle theses dynamic functions. Could you give me a function you wish to
> > add ?
> >
> > Thanks,
> >
> > --
> > Clément
> > _______________________________________________
> > users mailing list
> > [hidden email]
> > http://lists.scilab.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users