LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

Tags
(This content has not been tagged yet)
2 Pages V   1 2 >  
Reply to this topic Start new topic
> Challenge yourself
Antoine Châlons
post Jun 2 2008, 02:00 PM
Post #1


Extremely Active
****

Premium Member
Posts: 323
Joined: 8-January 07
From: Geneva
Member No.: 7452
Using LabVIEW Since:1999
LV:8.5.1 ,7.1.1 ,5.1
France Switzerland Spain My Gallery


Hi all,

A friend of mine recently dragged me into the Euler Project, anyone here is spending his nights doing it as well ?


By the way, LabVIEW is not in the default "language list" thumbdown.gif

--------------------
____________________________________________________________________________________

It's better to stay out of the rat race because if you win, you're still a rat


_____________________________________________________________________________________


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Jun 2 2008, 02:00 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Cmal
post Jun 2 2008, 03:03 PM
Post #2


4 more posts to go!


NI
Posts: 6
Joined: 16-June 07
From: Austin, TX
Member No.: 8734
Using LabVIEW Since:2006
LV:8.5 ,. ,.
United States us_texas us_colorado


QUOTE (Antoine @ Jun 2 2008, 09:00 AM) *
Hi all,

A friend of mine recently dragged me into the Euler Project, anyone here is spending his nights doing it as well ?


By the way, LabVIEW is not in the default "language list" thumbdown.gif


I've been a fan of it for a while, and it's good to see someone else doing the problems with LabVIEW. Just out of curiosity, how have you been handling the questions that require (or encourage) using big integers? For example, try to find 1000! in LabVIEW.

Chris M


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
PaulG.
post Jun 2 2008, 03:15 PM
Post #3


Extremely Active
****

Member
Posts: 268
Joined: 30-December 05
Member No.: 3786
Using LabVIEW Since:1998
LV:8.5 ,8.20 ,7.1
United States Nothing Selected Nothing Selected


thumbup1.gif Yes, but it's been a while, though. I love where my head goes when I'm trying to work out one of their problems.

--------------------




Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Aristos Queue
post Jun 2 2008, 04:49 PM
Post #4


LV R&D Envoy
*****

NI
Posts: 1226
Joined: 15-August 06
From: Austin, TX
Member No.: 5877
Using LabVIEW Since:2000
LV:8.5.1 ,. ,.
United States Nothing Selected Nothing Selected My Gallery


QUOTE (Cmal @ Jun 2 2008, 10:03 AM) *
For example, try to find 1000! in LabVIEW.

Here's how:
http://forums.lavag.org/index.php?s=&s...post&p=5194

You might also follow up with this link:
http://forums.lavag.org/index.php?s=&s...post&p=5190

--------------------
"A VI outside a class is a gun without a safety. Data outside a class is a target."
--- A message from LabVOOP R&D


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
JiMM
post Jun 3 2008, 03:09 PM
Post #5


Very Active
***

Member
Posts: 93
Joined: 11-October 07
From: Tarboro, NC
Member No.: 9577
Using LabVIEW Since:2001
LV:7.1 ,. ,.
United States us_north_carolina Nothing Selected


Wow, that's some beautiful code!

--------------------
Jim



Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
jaegen
post Jun 3 2008, 06:02 PM
Post #6


Very Active
***

Member
Posts: 129
Joined: 29-October 04
From: Vancouver, B.C.
Member No.: 932
Using LabVIEW Since:1998
LV:8.5.1 ,7.1.1 ,.
Canada ca_british_columbia Nothing Selected


LabVIEW is now in the language list. ninja.gif

Jaegen

--------------------
"Duck was a neutral party, so he brought the ultimatum to the cows." -- Click, Clack, Moo: Cows That Type


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
JiMM
post Jun 3 2008, 11:55 PM
Post #7


Very Active
***

Member
Posts: 93
Joined: 11-October 07
From: Tarboro, NC
Member No.: 9577
Using LabVIEW Since:2001
LV:7.1 ,. ,.
United States us_north_carolina Nothing Selected


Antoine,
Thank you for introducing me to this fascinating challenge. My wife would not thank you biggrin.gif I would be interested in any suggestions to improve my code. I can get the job done, but I am sure that my LabVIEW coding skills can only go up. Attached is my solution to the Euler project chalenge #3. I would love to hear any suggestions as to how to improve it's efficiency. I am not looking for fancy mathematical insights (won't help future projects). I have a solution, it's just slow (~4.5 minutes). What I am interested to learn is how to improve the code using more efficient LabVIEW practices. Thanks for any insights!


BTW Jaegen, are you farmilliar with a company named ISE in Port Coquitlam?

This post has been edited by JiMM: Jun 3 2008, 11:57 PM
Attached File(s)
Attached File  Euler3.vi ( 15.28K ) Number of downloads: 70
 

--------------------
Jim



Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Antoine Châlons
post Jun 4 2008, 06:39 AM
Post #8


Extremely Active
****

Premium Member
Posts: 323
Joined: 8-January 07
From: Geneva
Member No.: 7452
Using LabVIEW Since:1999
LV:8.5.1 ,7.1.1 ,5.1
France Switzerland Spain My Gallery


QUOTE (jaegen @ Jun 3 2008, 08:02 PM) *
LabVIEW is now in the language list. ninja.gif

Jaegen


That's cool !


QUOTE
Antoine,
Thank you for introducing me to this fascinating challenge. My wife would not thank you biggrin.gif I would be interested in any suggestions to improve my code. I can get the job done, but I am sure that my LabVIEW coding skills can only go up. Attached is my solution to the Euler project chalenge #3. I would love to hear any suggestions as to how to improve it's efficiency. I am not looking for fancy mathematical insights (won't help future projects). I have a solution, it's just slow (~4.5 minutes). What I am interested to learn is how to improve the code using more efficient LabVIEW practices. Thanks for any insights!


I hope I'm putting you into trouble unsure.gif .

I started the Euler projet with the same intent : improving my LabVIEW skills.
The first solution I found for problem 3 is quite slow as well, now that I saw the above linked code I will try to get inspired and improve my subVIs because it's easy to draw a solution that WILL find the solution but not untill the end of the universe ! shifty.gif

Don't have time right now to have a look at your code, but I will.

EDIT :
I tested the prime factor VI that won the coding challenge on NI Forums, it takes 2ms to find the solution of prob 3 blink.gif

Cheers

--------------------
____________________________________________________________________________________

It's better to stay out of the rat race because if you win, you're still a rat


_____________________________________________________________________________________


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Antoine Châlons
post Jun 4 2008, 08:40 AM
Post #9


Extremely Active
****

Premium Member
Posts: 323
Joined: 8-January 07
From: Geneva
Member No.: 7452
Using LabVIEW Since:1999
LV:8.5.1 ,7.1.1 ,5.1
France Switzerland Spain My Gallery


QUOTE (JiMM @ Jun 4 2008, 01:55 AM) *
Antoine,
[...]
I would love to hear any suggestions as to how to improve it's efficiency. I am not looking for fancy mathematical insights (won't help future projects). I have a solution, it's just slow (~4.5 minutes). What I am interested to learn is how to improve the code using more efficient LabVIEW practices. Thanks for any insights!


I can't open you VI ohmy.gif .
What version of LabVIEW did you use ?
Can you repost it please ?

--------------------
____________________________________________________________________________________

It's better to stay out of the rat race because if you win, you're still a rat


_____________________________________________________________________________________


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
JiMM
post Jun 4 2008, 09:47 PM
Post #10


Very Active
***

Member
Posts: 93
Joined: 11-October 07
From: Tarboro, NC
Member No.: 9577
Using LabVIEW Since:2001
LV:7.1 ,. ,.
United States us_north_carolina Nothing Selected


The first posted version was in LV8. I now have two revised versions. The first (Euler3_Take2.vi) fixes blatent errors in my first attempt - like I eliminated testing of even numbers (DUH!). That dropped execution to ~2.3 minutes. The third version (Euler3_VJT.vi) uses a theory that to test N for primality you only need to check for divisibility by all of the primes up to N/2. Not the route I was really looking for because it relies on number theory rather than programming efficiency, but interesting to try. That one dropped execution time to 1.2 minutes. And used up my lunch hour rather than a night biggrin.gif The attached VIs are in LV7.1.

This post has been edited by JiMM: Jun 4 2008, 09:48 PM
Attached File(s)
Attached File  Euler3_VJT.zip ( 45.09K ) Number of downloads: 20
 

--------------------
Jim



Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
JDave
post Jun 4 2008, 10:32 PM
Post #11


Extremely Active
****

Premium Member
Posts: 430
Joined: 2-February 05
From: Southern California
Member No.: 1519
Using LabVIEW Since:2004
LV:8.20 ,7.1.1 ,8.0.1
United States Peru us_california


QUOTE (JiMM @ Jun 4 2008, 02:47 PM) *
The first posted version was in LV8. I now have two revised versions. The first (Euler3_Take2.vi) fixes blatent errors in my first attempt - like I eliminated testing of even numbers (DUH!). That dropped execution to ~2.3 minutes. The third version (Euler3_VJT.vi) uses a theory that to test N for primality you only need to check for divisibility by all of the primes up to N/2. Not the route I was really looking for because it relies on number theory rather than programming efficiency, but interesting to try. That one dropped execution time to 1.2 minutes. And used up my lunch hour rather than a night biggrin.gif The attached VIs are in LV7.1.

Math efficiency is going to be a large part of keeping the speed down. A slow mathematical algorithm will be slow no matter have programmatically efficient you make it.

QUOTE (JiMM @ Jun 3 2008, 04:55 PM) *
My wife would not thank you biggrin.gif


I don't know if my wife would appreciate me starting up. It does look fun though.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
JiMM
post Jun 4 2008, 10:58 PM
Post #12


Very Active
***

Member
Posts: 93
Joined: 11-October 07
From: Tarboro, NC
Member No.: 9577
Using LabVIEW Since:2001
LV:7.1 ,. ,.
United States us_north_carolina Nothing Selected


QUOTE (JDave @ Jun 4 2008, 06:32 PM) *
Math efficiency is going to be a large part of keeping the speed down. A slow mathematical algorithm will be slow no matter have programmatically efficient you make it.

Oh, there is no doubt that knowing tricks of the mathematical trade will help solve those problems more efficiently. As is seen by the version thatn only looks to the smaller primes for divisibility. But I was not looking to set records. I am meerly looking for insights from better LabVIEW programmers as to how I can optimize my use of arrays, loops etc. Trying to polish my toolbox, and improve my ability to use it thumbup1.gif

I don't know if my wife would appreciate me starting up. It does look fun though.


It is interesting to both solve the problem, and then say "how can I do this better?" At work I to often get in the mode of solve the problem and move on. If it works, the boss doesn't care (or notice) if it's elegant, or efficient.

This post has been edited by JiMM: Jun 4 2008, 10:59 PM

--------------------
Jim



Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
JiMM
post Jun 6 2008, 01:51 AM
Post #13


Very Active
***

Member
Posts: 93
Joined: 11-October 07
From: Tarboro, NC
Member No.: 9577
Using LabVIEW Since:2001
LV:7.1 ,. ,.
United States us_north_carolina Nothing Selected


Holy Mackerel! I am stunned by how fast the Coding Chalenge winner did this. Of course it was obvious that clever math tactics would be necessary to minimize time, but .... just WOW. I got less than 1ms with that VI on my PC. AMAZING! worshippy.gif I am not worthy!!!!!!

This post has been edited by JiMM: Jun 6 2008, 01:52 AM

--------------------
Jim



Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Antoine Châlons