![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Open Source Projects The place to discuss Basic4ppc open source applications. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Neil, dont think maths is ur strong point. Even with ur way of reading it 800% faster would nly be 9 times the speed!
AG Maybe I got the word wrong but I thought u could get a function to take big num down to a small one. Whatever the crunching look up whatsit is called, it requires R,G,B colors to go to Indexing Ints 1,2,3 .... Then I would need a reverse function to get back from the Index to the color, but that must be impossible as u cant get compression out of nothing as its not a 1 to 1 mapping. If it just stored as a dictionary pair it must be slow because it has to look through the whole list of RGBs to find its Index on reverse look-up? My condense routine works really well, also doesnt need a look up table so Ive used that. Simple as well, as long as u dont pick any two colours closely similar. all 3 RGB's reduced DiV 64 so (R,G,B) (4*4*4)=64 COLOURS RGB -> index = R/64*16 + G/64*4 +B Plus having the rule crammed into a double makes passing the array easy! Problem with the PPC version is the bit Im now totally stuck on. Last edited by colin9876 : 12-15-2007 at 11:40 PM. |
|
||||
|
Single index number looks up big numbers from an linear array. Hashtable or dictionary use Key/value pairs to get ordered little numbers (indexes) from big/random ones. Standard computer science stuff. What do you need that's different?
|
|
|||
|
If it is 100% faster then it IS faster... for example if you have a product that you sell so you get 100% profit as a percentage from the cost price then if you spent £1 making it then you would sell it for £2... If it is 100% then it is 100% added on to what is already there... which is doubling.
0% faster is the same not 100%!!! This is because it is 100% FASTER NOT 100% of the speed!!! Maths is one of my strong points! |
|
|||
|
All I wanted was a fast way to get back from a color to an index. With an instant function.
If it has to look through a table (MaxCols long) it May have to check Maxlong records before it gets a hit? My condense function gets the index immediately |
|
||||
|
Quote:
BTW I think the problem is a Compact Framework limitation - more tomorrow, my bottle of wine is nearly half empty now and past experience tells me to stop now or I'll end up redoing everything tomorrow! Good night. |
|
|||
|
Dont worry about writing any hash routines, condensing method RGBs each div 64 is simple and fast.
Though if u could alter how grav&spread are stored it would be majorly more efficient- Was thinking how wasteful it was to have Spread, and gravity each as doubles. Combined both into an INT, 8 bits each. This gives major improvement, also means rule change can be passed through simpliy, and stored in array of Doubles Can we get rid of gravity and spread and have INT gravspread ** 8bits gravity (1 bit sign, plus 7 bits for 0-100) '% chance it will move up or down 8bits spread (0-100) '% chance it will move left or right ** all logic is now if rnd<gravbits/100 then move +1 or -1 depending on sign if rnd<spreadbits/100 then move either -1 or +1 horizonatlly This gives huge improvements, in memory usage. Also makes the Rule which is kept in a double so simple to pass over RULE ** 8 bits probabilty (0-100) 8 bits newindex 16 bits newgravspread ** Then rule change is if rnd<probabilty/100 grav then { index= newindex gravspread=newgravspread } AG question. If gravity stored as a signed 8 bit int can c# cope with those? Last edited by colin9876 : 12-16-2007 at 09:23 AM. Reason: Major logic improvement |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Personal Pocket PC Wiki | tsteward | Open Source Projects | 121 | 11-29-2008 09:06 AM |
| Tippy v.1.0 [open source] | N1c0_ds | Share Your Creations | 4 | 11-20-2008 10:08 PM |
| Another Pocket Wiki | digitaldon37 | Open Source Projects | 1 | 09-17-2008 11:01 AM |
| Pocket Burning Sand | neilnapier | Questions & Help Needed | 2 | 11-05-2007 08:53 PM |
| dzSpy - Spy and Task Manager App - Open Source | dzt | Share Your Creations | 3 | 07-15-2007 06:21 AM |