Re: [Scilab-users] unusable cat() rewritten. Call for reviewers

2017-08-10 Thread Samuel Gougeon

Le 10/08/2017 à 19:55, Samuel Gougeon a écrit :


Dear co-scilabers,

The bug 8297  reporting the 
outstanding slowness of the cat() function was reported in 2010
but lasts since cat() was introduced. As measured and commented in the 
report, this
slowness actually makes cat() almost unusable, except for small sized 
arrays to be concatenated.


For instance, after M = rand(500,500); cat(3,M,M) takes more than 11 
days (yes)

with Scilab 5.5.2, and roughly 4 hours with Scilab 6.0.0.

So, everyone could imagine how much Scilab currently takes just to 
build a standard
1000x1000 RGB image by stacking its 3  1000x1000 R,G,B layers using 
cat(3,R,G,B).

The current algorithm is exponential with respect to the array size...

Before using GPU routines to process images, a much simpler thing can 
be done

to enable cat() for true life usages : rewritting it.
This is what is done here: https://codereview.scilab.org/#/c/19278/

Some rewievers are needed to make cat() truly available in Scilab 6.0.1.
So, do not hesitate to contribute online.



To complete: This new implementation spends 0.25 s (instead of 4 hours) 
to execute


M = rand(500,500);
cat(3,M,M);

and 0.42 s to process

M = rand(1000,1000);
cat(3,M,M,M);

Doesn't it fit more to what could be expected?
SG

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] unusable cat() rewritten. Call for reviewers

2017-08-10 Thread Samuel Gougeon

Dear co-scilabers,

The bug 8297  reporting the outstanding 
slowness of the cat() function was reported in 2010
but lasts since cat() was introduced. As measured and commented in the 
report, this
slowness actually makes cat() almost unusable, except for small sized 
arrays to be concatenated.


For instance, after M = rand(500,500); cat(3,M,M) takes more than 11 
days (yes)

with Scilab 5.5.2, and roughly 4 hours with Scilab 6.0.0.

So, everyone could imagine how much Scilab currently takes just to build 
a standard
1000x1000 RGB image by stacking its 3  1000x1000 R,G,B layers using 
cat(3,R,G,B).

The current algorithm is exponential with respect to the array size...

Before using GPU routines to process images, a much simpler thing can be 
done

to enable cat() for true life usages : rewritting it.
This is what is done here: https://codereview.scilab.org/#/c/19278/

Some rewievers are needed to make cat() truly available in Scilab 6.0.1.
So, do not hesitate to contribute online.

Thank you.
Samuel

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] {EXT} scilab2c toolbox query

2017-08-10 Thread Dang Ngoc Chan, Christophe
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
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Leading Spaces in xstring

2017-08-10 Thread Samuel Gougeon

Hi Richard,

Le 10/08/2017 à 13:58, Richard llom a écrit :

Hey All,
I have this code to print some information in the graph:
// Save info as string
infobox(1) = msprintf('Min V  %.2f V \n',min(log_data(:,3)));
infobox(2) = msprintf('Max V  %.2f V \n',max(log_data(:,3)));
infobox(3) = msprintf('Capacity   %.2f Ah\n',amphrs);
infobox(4) = msprintf('   %.2f Wh\n',watthrs);
// Print info as box on the figure
xstring(1,0.1,infobox,0,1);
boxh = gce();
boxh.font_style = 0; // Set monospace font


I agree, this forced trimming is often annoying.
There is here an easy workaround: use a 2-column matrix instead of a 
unique column:


t  =  ["abc"   "def"
 "ghij"  "kl"
 ""  "mn"
 ];
xstring(1,0.1,t,0,1);

HTH Samuel
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Leading Spaces in xstring

2017-08-10 Thread Richard llom
Hey All,
I have this code to print some information in the graph:
// Save info as string
infobox(1) = msprintf('Min V  %.2f V \n',min(log_data(:,3)));
infobox(2) = msprintf('Max V  %.2f V \n',max(log_data(:,3)));
infobox(3) = msprintf('Capacity   %.2f Ah\n',amphrs);
infobox(4) = msprintf('   %.2f Wh\n',watthrs);
// Print info as box on the figure
xstring(1,0.1,infobox,0,1);
boxh = gce();
boxh.font_style = 0; // Set monospace font

As you can see in infobox(4) I'm using just spaces to align the values.
However unfortunately xstring isn't printing these leading spaces.
Is this expected behavior or a bug?

Any ideas to workaround that limitation?

Thanks
richard



--
View this message in context: 
http://mailinglists.scilab.org/Leading-Spaces-in-xstring-tp4036841.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] scilab2c toolbox query

2017-08-10 Thread Abhinav Dronamraju
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
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users