Re: [Scilab-users] Reading numericaldata from txt file containing headlines

2017-03-03 Thread Jens Simon Strom

Thanks Serge,

That seems to be the most convenient solution to me.

Regards,  Jens
---
Am 03.03.2017 21:58, schrieb Serge Steer:

You can proceed as follow without any change in your file:

u=mopen("myfile","r");
header=mgetl(u,4)

data=mfscanf(-1,u,"%f %f\n")

Le 03/03/2017 à 13:09, Jens Simon Strom a écrit :

Hi,
with
x=read(file,-1,2)
I can read the data from a text file containing e. g.

1  2.12   First line of text file
2.12   3.2
3 2
4  2
5 2.
6 2
7 2
Last line empty

What can I do to read only the numbers from a text file like

Header 1 First line of text file
Header 2


1 2.12
2.12 3.2
3 2
4 2
5 2.
6 2
7 2
Last line empty

where the data start in the 5th line?

Regards, Jens



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





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


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


Re: [Scilab-users] Reading numericaldata from txt file containing headlines

2017-03-03 Thread Serge Steer

You can proceed as follow without any change in your file:

u=mopen("myfile","r");
header=mgetl(u,4)

data=mfscanf(-1,u,"%f %f\n")

Le 03/03/2017 à 13:09, Jens Simon Strom a écrit :

Hi,
with
x=read(file,-1,2)
I can read the data from a text file containing e. g.

1  2.12   First line of text file
2.12   3.2
3 2
4  2
5 2.
6 2
7 2
Last line empty

What can I do to read only the numbers from a text file like

Header 1 First line of text file
Header 2


1 2.12
2.12 3.2
3 2
4 2
5 2.
6 2
7 2
Last line empty

where the data start in the 5th line?

Regards, Jens



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



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


[Scilab-users] Once and for all curing input() : a good target for Scilab 6.0.1 <== Re: Bug in input statement

2017-03-03 Thread Samuel Gougeon

Hello Osvaldo,

Yes, there are awful sticky bugs on input(). Despite it is a "basic" 
function, it has never ever worked in a completely right way. It is a 
quite nasty situation for a high level language to have such a pitfall 
on basics.
IMO, curing it once and for all should be in the top-10 priorities for 
Scilab 6.0.1.


Let's have a look to input() behavior versus Scilab's versions:
*4.0 - 4.1.2:*
-->mprintf("head of line"); mprintf(" without ending newline");
head of line without ending newline
-->mprintf("head of line"); s=input("Message: ","s")
head of lineMessage: *-->*myAnswer // no way to forget that we are 
prompted.. :/

 s  =
 myAnswer

*5.1.0, 5.2.0, 5.3.0:*
-->mprintf("head of line"); mprintf(" without ending newline");
head of line without ending newline
// this blank line is displayed only from Scilab 5.3.0 on
-->mprintf("head of line"); s=input("Message: ","s")
head of line // why this newline?
Message:myAnswer // eaten space after ":" when prompting
 s  =
 myAnswer

*5.4.0, 5.5.0 - 5.5.2:*
-->mprintf("head of line"); mprintf(" without ending newline");
head of line without ending newline
-->mprintf("head of line"); s=input("Message: ","s")
head of line // but still: why this appended newline?
Message: myAnswer// now the space is correctly displayed when prompting
 s  =
 myAnswer

*6.0.0*:  the worst, as you described it and as it is already reported 
in Bugzilla.

http://bugzilla.scilab.org/14376
http://bugzilla.scilab.org/14424

I did not find any workaround.. Same issue with mscanf(): 
http://bugzilla.scilab.org/14998


Any idea for a workaround?

Regards
Samuel

Le 03/03/2017 à 15:20, Osvaldo Sergio Farhat de Carvalho a écrit :

Hello,
I was trying some simple programs that use the input statement on 
Scilab 6.0.0, and I got unexpected behaviour. Here is a test:

n  =  input("n = ")
while  n  >  0
 n  =  input("n = ")
end
printf("\nThanks")

Here is the result of this program on Scilab 6.0.0 console with input 
1, 2, 3, 4 and 0:


n =
1

n =
--> 2
n =
3

n =
4

n =
0


Thanks
2+2
 ans  =

   4.

Compare this with the output on Scilab 5.5.2 console for the same input:

n = 1
n = 2
n = 3
n = 4
n = 0

Thanks

This is much more what one should expect from this litle program. 
Remark that on 6.0.0 console
1) There is a disturbing new line after printing the input statement 
message
2) There is a spurious apearance of the console prompt "-->" after the 
first execution of input statement
3) The console prompt "-->" does not appear after the end of program 
execution.


I am using Scilab on a Windows 10 system.

Thanks for your attention.
Osvaldo



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



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


Re: [Scilab-users] Scilab 6.0 + starting a new jvm + evstr('1+1; ') => crash

2017-03-03 Thread Samuel Gougeon

Hello Michael,

Again, it is hard or even impossible to help or/and debug without having 
any true complete (and if possible minimal) way to run an actual code 
and reproduce the issue.


Le 03/03/2017 à 14:40, Michael Benguigui a écrit :

Hi all,
As a Scilab user, i am facing difficulties during the Scilab 
6 adaptation of my project. I did my best to isolate the pb. This code 
works with Scilab 5.5. At some point of my code, I have:


>pair = jinvoke(deployer,'deployOrLookup');
>evstr('1+1');// crash!
>// or
>// deff('[x]=myplus(y,z)','x=y+z') // crash!

Important points:
- The common point of evstr and deff is it calls the scilab compiler.
- deployOrLookup() calls a java method using jinvoke(), which creates 
a java Process (Process process = pb.start(); ) that executes another 
java class
(cmd like java -Djava.security.policy=xxx -Dlog4j.configuration=xx 
-Drmi.port=xxx myClass).
- If the jvm already exists, deployOrLookup() does not create it 
again, but just registers it..


Either you can provide this code, or you provide an equivalent public 
one with which you get the same issue, in a way we can copy/paste it in 
the console with all the required context (so lines of codes without any 
leading prompts -->).
Otherwise, nothing prevents thinking that the issue is possibly in the 
private code or in the private context instead of in Scilab itself.


By the way, if your prompt was really ">" instead of "-->", you were not 
at the top level, and something else could be wrong out of jinvoke, 
evstr or deff)


For my part, i do not get any crash running
jimport java.lang.System;
jimport java.awt.Color;
jimport java.lang.String;
// Non-static methods
jinvoke("Hello World !!", "length");
evstr('1+1');// crash!
deff('[x]=myplus(y,z)','x=y+z')

as coming from the first example of the jinvoke() help page.

Regards
Samuel

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


Re: [Scilab-users] Reading numericaldata from txt file containing headlines

2017-03-03 Thread Jens Simon Strom

Thanks Amanda, that helps.

In the meantime I have found an alternate way by editing the text file:
Move the leading text lines to the end of the data colums.
Append  a hint after the first data line that there is information below.
Use
x=read(file,r,c)
where r and c define the row and colum number of the numerical data. 
That works even for my chaotic data format wherein different numbers of 
blanks and tabs in each line  separate the data.


Regards, Jens

---


Am 03.03.2017 13:42, schrieb Amanda Osvaldo:

Hi,

if your data it's tabular, in another words, you can open it in Excel 
or Libre Office Calc like you whant to do.


You should be able to read in the same way with csvRead, however you 
need to adjust the parameters


Something like:

[M,comments] =csvRead('myfile.txt','',[],[],[],[],[],5);

Note that ' ' need to be the same separator in your text file.
*May be*  it can be a TAB (the key in keyboard) or a simple space, you need try 
or open your file and check it.

And the 5 value it's to ignore the first 5 lines.

https://help.scilab.org/docs/6.0.0/en_US/csvRead.html
Is that what you are looking for ?

-- Amanda Osvaldo

On Fri, 2017-03-03 at 13:09 +0100, Jens Simon Strom wrote:

Hi,
with
x=read(file,-1,2)
I can read the data from a text file containing e. g.

1  2.12   First line of text file
2.12   3.2
3 2
4  2
5 2.
6 2
7 2
Last line empty

What can I do to read only the numbers from a text file like

Header 1 First line of text file
Header 2


1 2.12
2.12 3.2
3 2
4 2
5 2.
6 2
7 2
Last line empty

where the data start in the 5th line?

Regards, Jens

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



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


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


[Scilab-users] Bug in input statement

2017-03-03 Thread Osvaldo Sergio Farhat de Carvalho
Hello,I was trying some simple programs that use the input statement on Scilab 6.0.0, and I got unexpected behaviour. Here is a test:n = input("n = ")
while n > 0
n = input("n = ")
end
printf("\nThanks")Here is the result of this program on Scilab 6.0.0 console with input 1, 2, 3, 4 and 0:n = 1n = --> 2n = 3n = 4n = 0Thanks2+2 ans  =   4.Compare this with the output on Scilab 5.5.2 console for the same input:n = 1n = 2n = 3n = 4n = 0Thanks This is much more what one should expect from this litle program. Remark that on 6.0.0 console1) There is a disturbing new line after printing the input statement message2) There is a spurious apearance of the console prompt "-->" after the first execution of input statement3) The console prompt "-->" does not appear after the end of program execution.I am using Scilab on a Windows 10 system.Thanks for your attention.Osvaldo
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Scilab 6.0 + starting a new jvm + evstr('1+1; ') => crash

2017-03-03 Thread Michael Benguigui
Hi all,
As a Scilab user, i am facing difficulties during the Scilab
6 adaptation of my project. I did my best to isolate the pb. This code
works with Scilab 5.5. At some point of my code, I have:

>pair = jinvoke(deployer,'deployOrLookup');
>evstr('1+1');// crash!
>// or
>// deff('[x]=myplus(y,z)','x=y+z') // crash!

Important points:
- The common point of evstr and deff is it calls the scilab compiler.
- deployOrLookup() calls a java method using jinvoke(), which creates a
java Process (Process process = pb.start(); ) that executes another java
class
(cmd like java -Djava.security.policy=xxx -Dlog4j.configuration=xx
-Drmi.port=xxx myClass).
- If the jvm already exists, deployOrLookup() does not create it again, but
just registers it..

Results:
-Executing this code the first time, deployOrLookup() correctly runs a new
jvm executing myClass.. and ... at the first evstr() or deff() call, Scilab
6.0 close with "Scilab 6.0.0 (GUI) a cessé de fonctionner  .. un problème a
fait que le programme a cessé de fonctionner correctement. Windows va
fermer ce programme et vous indiquer si une solution est disponible."
- Executing this code a 2nd time, deployOrLookup() directly registers the
running JVM and executes fine any evstr() or deff() call.
- If I disable the java Process execution (by putting in comment //Process
process = pb.start(); ),
evstr() or deff() can be executed without crashing Scilab.

Many thanks to the Scilab community
Michael
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Compiling Scilab with MPI

2017-03-03 Thread Amanda Osvaldo
Hi Eduardo, I don't know if I can help you. However, I need to ask.Are you
using an updated operation system ?What Linux are you using ? Did you like
to try with SciLAB 6 ? I can send the scripts to install the dependencies
for a Linux Debian.-- Amanda Osvaldo



--
View this message in context: 
http://mailinglists.scilab.org/Scilab-users-Compiling-Scilab-with-MPI-tp4035686p4035691.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] graphics set

2017-03-03 Thread Daniele Tonelli
Dears,

I send to You a link with some modificacion that I need.

https://drive.google.com/open?id=0B7VoAHxstpPcU0JfT1dDNkdJZ0k

Also I need to save a excel file, however the way it shows the data is in
only one column and I need to separate the results in four columns as shown
in Scilab.

Is there an option that allow to re-write the file because I get the
following message?
*"File "resultsCatenaria.xls" already exists or directory write access
denied."*

Thank You very much,

*Daniele*

PS: Has anyone a mathematic model of cable with linear loads and nodal
forces?


catenaria.sce
Description: Binary data
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Compiling Scilab with MPI

2017-03-03 Thread Eduardo Martini
Hello you all



Hope someone can help me, I am trying to compile scilab 5.5.2 from source in 
order to use MPI to get a simulation to run in parallel.
I downloaded the 5.5.2 version and its Compilation prerequirements from 
https://www.scilab.org/development/ml .
I extracted both into a folder and performed a ./configure with no errors at 
all   (I skipped the --with-mpi in the first try, just to keep it simple)
But when I tried to compile with "make" after a while I get a error
"Found dependency from scilab-cli-bin to libstdc++ foundMakefile:2092: recipe 
for target 'check-libstdcpp-dep' failedmake[1]: *** [check-libstdcpp-dep] Error 
2make[1]: Leaving directory 
'/home/emartini/Downloads/scilab-5.5.2'Makefile:1541: recipe for target 
'all-recursive' failedmake: *** [all-recursive] Error 1"
I have no clue what to do about it, (and clearly adding MPI didn't help 
neither...) .Can someone help me out on this one?!  

Thanks a lot in advance!!!

   

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


[Scilab-users] Compiling Scilab with MPI

2017-03-03 Thread Eduardo Martini
Hello you all

Hope someone can help me, I am trying to compile scilab 5.5.2 from source in 
order to use MPI to get a simulation to run in parallel.
I downloaded the 5.5.2 version and its Compilation prerequirements from 
https://www.scilab.org/development/ml .
I extracted both into a folder and performed a ./configure with no errors at 
all   (I skipped the --with-mpi in the first try, just to keep it simple)
But when I tried to compile with "make" after a while I get a error
"Found dependency from scilab-cli-bin to libstdc++ foundMakefile:2092: recipe 
for target 'check-libstdcpp-dep' failedmake[1]: *** [check-libstdcpp-dep] Error 
2make[1]: Leaving directory 
'/home/emartini/Downloads/scilab-5.5.2'Makefile:1541: recipe for target 
'all-recursive' failedmake: *** [all-recursive] Error 1"
I have no clue what to do about it, (and clearly adding MPI didn't help 
neither...) .Can someone help me out on this one?!  

Thanks a lot in advance!!!

   checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE64_SOURCE value needed for large files... 
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library path variable... LD_LIBRARY_PATH
checking whether to activate relocatable installation... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for shared library run path origin... done
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... (cached) /bin/grep
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gfortran... gfortran
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking if gfortran is a fortran 90 compatible compiler... yes
checking size of int... 4
checking size of long... 8
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for g++... yes
checking whether gfortran understands -c and -o together... yes
checking for nm... nm
checking for leading underscores with Fortran (name-mangling scheme)... no
checking for trailing underscores with Fortran (name-mangling scheme)... yes
checking use of the sharpsign in CPP... yes
Define C2F with Trailing Underscore and Sharp Sign
checking for clock_gettime in -lrt... yes
checking for ocamlc... ocamlc
checking for ocamlopt... ocamlopt
checking for ocamldep... ocamldep
checking for ocamlyacc... ocamlyacc
checking for ocamllex... ocamllex
checking JAVA_HOME variable... JAVA_HOME variable found, use it as JVM root directory
checking for zip or jar files to include on CLASSPATH... 
checking to see if the java compiler works... yes
Using JAVAC=/usr/lib/jvm/java-8-oracle/bin/javac
Java found in /usr/lib/jvm/java-8-oracle
checking type of jvm... jdk
checking java API version... 1.8
Using the following JNI include flags -I/usr/lib/jvm/java-8-oracle/include -I/usr/lib/jvm/java-8-oracle/include/linux
checking if jni.h can be included... yes
Looking for JNI libs with x86_64 as machine hardware name
Looking for /usr/lib/jvm/java-8-oracle/jre/lib/x86_64/libjava.so
Looking for /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libjava.so
Found /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libjava.so
Usin

Re: [Scilab-users] Reading numericaldata from txt file containing headlines

2017-03-03 Thread Amanda Osvaldo
Hi,
if your data it's tabular, in another words, you can open it in Excel
or Libre Office Calc like you whant to do.
You should be able to read in the same way with csvRead, however you
need to adjust the parameters
Something like:
[M, comments] = csvRead('myfile.txt', ' ', [], [], [], [], [],
5);
Note that ' ' need to be the same separator in your text file.May be it
can be a TAB (the key in keyboard) or a simple space, you need try or
open your file and check it.
And the 5 value it's to ignore the first 5 lines.
https://help.scilab.org/docs/6.0.0/en_US/csvRead.html
Is that what you are looking for ?
-- Amanda Osvaldo

On Fri, 2017-03-03 at 13:09 +0100, Jens Simon Strom wrote:
> Hi, 
> 
> with
> 
> x=read(file,-1,2)
> 
> I can read the data from a text file containing e. g. 
> 
> 
> 
> 1  2.12   First line of text file
> 
> 2.12   3.2
> 
> 3 2
> 
> 4  2
> 
> 5 2.
> 
> 6     2
> 
> 7 2 
> 
>     Last line empty
> 
> 
> 
> What can I do to read only the numbers from a text file like
> 
> 
> 
> Header 1 First line of text file
> 
> Header 2
> 
> 
> 
> 
> 
> 1 2.12
> 
> 2.12 3.2
> 
> 3 2
> 
> 4 2
> 
> 5 2.
> 
> 6 2
> 
> 7 2
> 
>     Last line empty  
> 
> 
> 
> 
> where the data start in the 5th line?
> 
> 
> 
> Regards, Jens
> 
> 
> 
>   
> 
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Compiling Scilab with MPI

2017-03-03 Thread Eduardo Martini
Hello you all
Hope someone can help me, I am trying to compile scilab 5.5.2 from source in 
order to use MPI to get a simulation to run in parallel.
I downloaded the 5.5.2 version and its Compilation prerequirements from 
https://www.scilab.org/development/ml .
I extracted both into a folder and performed a ./configure with no errors at 
all   (I skipped the --with-mpi in the first try, just to keep it simple)
But when I tried to compile with "make" after a while I get a error
"Found dependency from scilab-cli-bin to libstdc++ foundMakefile:2092: recipe 
for target 'check-libstdcpp-dep' failedmake[1]: *** [check-libstdcpp-dep] Error 
2make[1]: Leaving directory 
'/home/emartini/Downloads/scilab-5.5.2'Makefile:1541: recipe for target 
'all-recursive' failedmake: *** [all-recursive] Error 1"
I have no clue what to do about it, (and clearly adding MPI didn't help 
neither...) .Can someone help me out on this one?!  

Thanks a lot in advance!!!checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE64_SOURCE value needed for large files... 
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library path variable... LD_LIBRARY_PATH
checking whether to activate relocatable installation... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for shared library run path origin... done
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... (cached) /bin/grep
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gfortran... gfortran
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking if gfortran is a fortran 90 compatible compiler... yes
checking size of int... 4
checking size of long... 8
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for g++... yes
checking whether gfortran understands -c and -o together... yes
checking for nm... nm
checking for leading underscores with Fortran (name-mangling scheme)... no
checking for trailing underscores with Fortran (name-mangling scheme)... yes
checking use of the sharpsign in CPP... yes
Define C2F with Trailing Underscore and Sharp Sign
checking for clock_gettime in -lrt... yes
checking for ocamlc... ocamlc
checking for ocamlopt... ocamlopt
checking for ocamldep... ocamldep
checking for ocamlyacc... ocamlyacc
checking for ocamllex... ocamllex
checking JAVA_HOME variable... JAVA_HOME variable found, use it as JVM root directory
checking for zip or jar files to include on CLASSPATH... 
checking to see if the java compiler works... yes
Using JAVAC=/usr/lib/jvm/java-8-oracle/bin/javac
Java found in /usr/lib/jvm/java-8-oracle
checking type of jvm... jdk
checking java API version... 1.8
Using the following JNI include flags -I/usr/lib/jvm/java-8-oracle/include -I/usr/lib/jvm/java-8-oracle/include/linux
checking if jni.h can be included... yes
Looking for JNI libs with x86_64 as machine hardware name
Looking for /usr/lib/jvm/java-8-oracle/jre/lib/x86_64/libjava.so
Looking for /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libjava.so
Found /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libjava.so
Using the 

Re: [Scilab-users] Matlab vs Scilab perf; calling a fortran routine.

2017-03-03 Thread Amanda Osvaldo
Hi Steve.
In fact, this is an issue that seems to require more detail.My 20GB of
data its server's logs with weak correlation with each other.So I can
process a few MB at time without any penalty.
It takes about 1 hour in a notebook with a very simple memory
optimization to reduce the disk access.
However, I think in this debate we are forgetting about each kind of
data requires a type of treatment.
Process 20GB or even 1 TB of data with very low correlation can be very
easy.However, process the same amount of data with high correlation,
like a particle accelerator data or some financial data, and it can be
a hell without an appropriate framework and hardware.
I think we should talk about the "ecosystem", not only about
vectorization or algorithms.
-- Amanda Osvaldo

On Thu, 2017-03-02 at 16:25 -0500, sho...@energetiq.com wrote:
> I've never had to deal with such large data sets.   My first thought
> would be to use an ssd to improve swap times to the disk.  Or add
> more ram.
> 
> Or buy a bigger workstation.   Is your algorithm parallelizable?  
> Or, of course, just wait -- it all depends on what your real
> constraints are.
> 
> 
> 
>  
> 
> 
> 
> 
> 
> 
> Amanda Osvaldo ---03/02/2017 04:00:03 PM---Steve, how you handle with
> the memory limitations in your system ? For example, how you handle
> 20 GB
> Amanda Osvaldo ---03/02/2017 04:00:03 PM---Steve, how you handle with
> the memory limitations in your system ? For example, how you handle
> 20 GB
> 
> 
> 
> From: Amanda Osvaldo 
> 
> To:   Users mailing list for Scilab 
> 
> Date: 03/02/2017 04:00 PM
> 
> Subject:  Re: [Scilab-users] Matlab vs Scilab perf; calling a
> fortran routine.
> 
> Sent by:  "users" 
> 
> 
> 
> 
> 
> 
> 
> Steve, how you handle with the memory limitations in your system ?
> 
> 
> 
> For example, how you handle 20 GB of data in a machine with 4 GB of
> RAM ?
> 
> 
> 
> -- Amanda Osvaldo
> 
> 
> 
> 
> 
> On Thu, 2017-03-02 at 15:14 -0500, sho...@energetiq.com wrote:
> 
> 
> I have done a lot of this kind of thing in scilab and other similar
> tools.  A key point - If the algorithm is naturally vectorizable,
> there probably won't be much benefit in further optimization.
>  However it it inherently is not vectorizable then the key
> calculation can be written as a callable fortran (my favorite)
> subroutine.   Use Scilab for the I/O and visualization; write the
> compute intensive core in fortran.  
> 
> 
> 
> While I'm on the subject, the old  Intersci system was a very
> convenient way to automatically generate the interface routine
> between scilab and an arbitrary fortran subroutine.  There seems
> 
> not to be recent documentation on doing the same (specifically for
> fortran).  Or am I missing something?   I've had to use the "call"
> interface to use old code.  Is there a better way?
> 
> 
> 
> Thanks - 
> 
> Steve
> Ricardo Fabbri ---03/02/2017 01:30:36 PM---Speaking from experience:
> It is worth mentioning that in many ways performance is not critical
> 
> Ricardo Fabbri ---03/02/2017 01:30:36 PM---Speaking from experience:
> It is worth mentioning that in many ways performance is not critical
> 
> 
> 
> From: Ricardo Fabbri 
> 
> To: Users mailing list for Scilab 
> 
> Date: 03/02/2017 01:30 PM
> 
> Subject: Re: [Scilab-users] Matlab vs Scilab perf
> 
> Sent by: "users" 
> 
> 
> 
> 
> 
> 
> 
> Speaking from experience:
> 
> 
> 
> It is worth mentioning that in many ways performance is not critical
> 
> for a "lab" language like Scilab or Matlab. It is just an extremely
> 
> simple language to test concepts and algorithms at a very small scale
> 
> of granularity. The real crucial factor for Scilab or Matlab is the
> 
> GUI for exploring data and developing algorithms interactively. Once
> 
> you have a working solution, you'll fit it inside a bigger and more
> 
> relevant
> 
> system by porting promptly to a language like C++ for scalability and
> speed.
> 
> 
> 
> Just use Scilab for what its worth, don't obsess with speed, even
> 
> though it is important.
> 
> 
> 
> Best,
> 
> 
> 
> --
> 
> Dr Ricardo Fabbri
> 
> Professor of Computer Engineering
> 
> GNU/Linux registered user #175401
> 
> pt.wikipedia.org/wiki/IPRJ
> 
> labmacambira.sf.net
> 
> rfabbri.github.io
> 
> 
> 
> 
> 
> On Thu, Mar 2, 2017 at 2:00 PM, Samuel Gougeon 
> wrote:
> 
> > Le 02/03/2017 à 16:29, Michael Benguigui a écrit :
> 
> >
> 
> > Hi all,
> 
> > As a Scilab user, I am currently fighting to reach Matlab
> performance..My
> 
> > current scilab program takes 4x more than my matlab's vesion. Here
> are some
> 
> > instructions requiring some optimizations.. If you have an idea...
> thanks a
> 
> > lot!
> 
> >
> 
> > All times are cumulative times after the execution (iterations)
> 
> > I used the Matlab and Scilab profilers
> 
> >
> 
> >
> 
> > Congratulations for using the new Scilab profiler :)
> 
> > Could you post please the file of results? It is indeed hard to
> answer
> 
> > without having more information either on a runnable p

[Scilab-users] Reading numericaldata from txt file containing headlines

2017-03-03 Thread Jens Simon Strom

Hi,
with

x=read(file,-1,2)

I can read the data from a text file containing e. g.

1  2.12   First line of text file
2.12   3.2
3 2
4  2
5 2.
6 2
7 2
Last line empty

What can I do to read only the numbers from a text file like

Header 1 First line of text file
Header 2


1 2.12
2.12 3.2
3 2
4 2
5 2.
6 2
7 2
Last line empty

where the data start in the 5th line?

Regards, Jens

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


Re: [Scilab-users] {EXT} Re: Matlab vs Scilab perf

2017-03-03 Thread Michael Benguigui
Many thanks Christophe

Michael

2017-03-03 10:03 GMT+01:00 Dang Ngoc Chan, Christophe <
christophe.d...@sidel.com>:

> Hello again,
>
> > De : De la part de Dang Ngoc Chan, Christophe
> > Envoyé : vendredi 3 mars 2017 09:57
> >
> > considering tooth_psi_angle(:, tooth) is a line vector
>
> Mmmm, quite a silly assertion (-:
>
> tooth_psi_angle(:, tooth) is necessarily a column vector,
> you just have to use the apostrophe
> tooth_psi_angle(:, tooth)'
> to change it to a line vector.
>
> 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
>



-- 
Michael Benguigui, Activeeon
+33 6 304 37 37 0
https://fr.linkedin.com/in/micha%C3%ABl-benguigui-23a85921
skype: michael.bengui...@hotmail.fr
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] {EXT} Re: Matlab vs Scilab perf

2017-03-03 Thread Dang Ngoc Chan, Christophe
Hello again,

> De : De la part de Dang Ngoc Chan, Christophe
> Envoyé : vendredi 3 mars 2017 09:57
>
> considering tooth_psi_angle(:, tooth) is a line vector

Mmmm, quite a silly assertion (-:

tooth_psi_angle(:, tooth) is necessarily a column vector,
you just have to use the apostrophe
tooth_psi_angle(:, tooth)'
to change it to a line vector.

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] Matlab vs Scilab perf

2017-03-03 Thread Dang Ngoc Chan, Christophe
Hello,

> De : users [mailto:users-boun...@lists.scilab.org] De la part de Michael 
> Benguigui
> Envoyé : jeudi 2 mars 2017 17:40
>
> ROT_LCS_TCS =[-cos(tooth_psi_angle(i,tooth)) 
> -sin(tool.kappa)*sin(tooth_psi_angle(i,tooth)) -
> cos(tool.kappa)*sin(tooth_psi_angle(i,tooth)); sin(tooth_psi_angle(i,tooth)) 
> -sin(tool.kappa)*cos(tooth_psi_angle(i,tooth)) -
> cos(tool.kappa)*cos(tooth_psi_angle(i,tooth)); 0 cos(tool.kappa) 
> -sin(tool.kappa)];
>
> Yes, in a for loop..  And in some part of code i have nested loops..

You can optimize this expression in several manners:

1. Avoid the loops.
Scilab computes on vectors, so instead of

for i =1:n; foo(i) = sin(tooth_psi_angle(i, tooth)); end

better use

foo = sin(tooth_psi_angle(:, tooth));

2. Compute only once.
cos(tooth_psi_angle(i, tooth)), sin(tooth_psi_angle(i, tooth)), sin(tool.kappa) 
and cos(tool.kappa)  are computed 3 times.

Better use intermediate variables and factorization,
e.g. considering tooth_psi_angle(:, tooth) is a line vector

ctpa = cos(tooth_psi_angle(:, tooth));
stpa = sin(tooth_psi_angle(:, tooth));
stk = sin(tool.kappa);
ctk = cos(tool.kappa);
sumtk = stk + ctk;
lineofones = ones(tooth_psi_angle(:, tooth));

ROT_LCS_TCS = [ctpa - stpa*sumtk ; stpa - ctpa*sumtk ; (ctk - stk)*lineofones];

You then get a  3*n matrix (n = number of angle values).

You might even try

ROT_LCS_TCS = [ [ctpa ; stpa] - sumtk*[stpa ; ctpa] ; (ctk - stk)*lineofones];

and see if it is better.

3. To be more helpful, we need to know the whole code.

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