Jump to content



Photo
- - - - -

compression


  • Please log in to reply
35 replies to this topic

#1 rjstephens

rjstephens

    Casio Freak

  • Members
  • PipPipPipPip
  • 239 posts
  • Location:Brisbane, Queensland, Australia

  • Calculators:
    CFX9850GB+

Posted 08 April 2003 - 11:07 AM

i am working on my rpg engine, and i wanna know, how do i compress a matrix? I see you guys talking about compressing matrices. how have you guys done it and how can i do it?

#2 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 08 April 2003 - 11:21 AM

It's basically about packing more than 1 number into each cell, "shifting" the digits left by multiplying with a power of 10

Say that all you numbers are less than 10, you could pack 15 numbers into one cell (seeing as how Casio's varables holds 15 digits), plus you could even use the exponent to hold 2 numbers.
if you had the numbers 3, 2, and 8
you would put them at their designated cell by assigning it: 3 + 2 * 10 + 8 * 100, and so on
you could retreive them through a loop, extracting the most or least significan number, removing it from the mantissa, and "shifting" the mantissa up or down to make the next number ready for extracion

obviously, you could chose to multiply by 100, or 1000, or whatever size your numbers are, and naturally this will make less numbers fit in one cell :)

you don't have to chose a power of 10 multiplier either, you could use any number that might fit the size of your numbers

#3 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 08 April 2003 - 09:32 PM

I use my decimile notation, which stores numbers in the decimile places of each cell, then when needed you just look at the decimiles and get your number. its really quite easy.

this is the link to the thread on that topic: here

#4 ross8653

ross8653

    Casio Addict

  • Members
  • PipPipPip
  • 96 posts
  • Location:over the river and through the woods
  • Interests:paintball

  • Calculators:
    9850 fx2.0

Posted 09 April 2003 - 05:41 AM

i also used it in my tetris program it can take 16 digits per cell
do this if you dont understand
1234567890123456->A
A (enter) (to show that it wont display all the digits)

you can loop this part if you want
Frac (A/10) (you get the lowest digit 6, multiply by 10 for non decimal)
Int (A/10) -> A (cut the last digit off A, and repeat if you want)

thats basically how it's done both Frac and Int are found under NUM (option f.. something)

#5 rjstephens

rjstephens

    Casio Freak

  • Members
  • PipPipPipPip
  • 239 posts
  • Location:Brisbane, Queensland, Australia

  • Calculators:
    CFX9850GB+

Posted 09 April 2003 - 08:14 AM

thanks heaps guys

think i'll write a tutorial or something.

#6 Mohamed

Mohamed

    UCF Police

  • [Legends]
  • PipPipPipPipPipPipPip
  • 519 posts
  • Gender:Male
  • Location:Egypt, Cairo

  • Calculators:
    AFX 2.0, PV-S660, fx-570MS

Posted 09 April 2003 - 04:36 PM

Where's dscoshpe and his algorithms and software?
Maybe you'd look for his site.

#7 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 09 April 2003 - 05:44 PM

i also used it in my tetris program it can take 16 digits per cell

the calc variables hold 15 digits

9 byte packed bcd numbers
first byte:
bits:

0 - 3: exponent seccond digit
4: exponent first digit
5 - 7: sign, and format
seccond byte:
bits:

0 - 3: mantissa, first digit
4 - 7: exponent last digit
byte 3 - 9: mantissa


a packed bcd number holds 2 digits per byte, the mantissa is 7 bytes and 1 nibble, making for 15 digits of precision, if you want more, you have 2 digits and1 bit in the exponent + 1 bit in the sign :)

#8 rjstephens

rjstephens

    Casio Freak

  • Members
  • PipPipPipPip
  • 239 posts
  • Location:Brisbane, Queensland, Australia

  • Calculators:
    CFX9850GB+

Posted 10 April 2003 - 05:26 AM

thanks bitwise. will incorporate this into tutorial

what's discosheep's site? anyone got a bookmark? what's his real name i'll look itup on CPA.

#9 Brazzucko

Brazzucko

    UCF BASIC Programming Champion

  • Super Member
  • PipPipPipPipPipPip
  • 412 posts

  • Calculators:
    FX 1.0, CFX 9850 GB Plus and FX 9750G

Posted 10 April 2003 - 09:58 AM

:huh: Are you creating one Tutorial?

In the CASIO site there is various tutorials, see it......

see the related topic.....

#10 rjstephens

rjstephens

    Casio Freak

  • Members
  • PipPipPipPip
  • 239 posts
  • Location:Brisbane, Queensland, Australia

  • Calculators:
    CFX9850GB+

Posted 10 April 2003 - 11:43 AM

i am creating a tutorial on how to use compression.

it is only a small tutorial.

which casio site are you reffering to?

#11 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 10 April 2003 - 11:46 AM

i am working on my rpg engine, and i wanna know, how do i compress a matrix?  I see you guys talking about compressing matrices.  how have you guys done it and how can i do it?

..
You have no clue how to compress stuff, and then, all of a sudden your making a tutorial..
doesn't sound right ;)

#12 rjstephens

rjstephens

    Casio Freak

  • Members
  • PipPipPipPip
  • 239 posts
  • Location:Brisbane, Queensland, Australia

  • Calculators:
    CFX9850GB+

Posted 10 April 2003 - 12:03 PM

i get confident with stuff pretty quickly.

especially something like this I already have all the necessary background knowledge to do, but just didn't now how to do it.

#13 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 10 April 2003 - 12:18 PM

yeah.. I mean, it's not like it's difficult or anything (it's freakin basic.. )

but, why make a tutorial, aren't there enough basic programming tutorials for basic programmin n00bs? (waist of time in'it?)

#14 Brazzucko

Brazzucko

    UCF BASIC Programming Champion

  • Super Member
  • PipPipPipPipPipPip
  • 412 posts

  • Calculators:
    FX 1.0, CFX 9850 GB Plus and FX 9750G

Posted 10 April 2003 - 03:03 PM

B) This could be very helpful to me too

#15 rjstephens

rjstephens

    Casio Freak

  • Members
  • PipPipPipPip
  • 239 posts
  • Location:Brisbane, Queensland, Australia

  • Calculators:
    CFX9850GB+

Posted 10 April 2003 - 08:26 PM

its a compression-specific tutorial. If you want i'll make a basic tutorial, but not yet. i'm still busy with writing about 5 programs at once.

it's holidays for me now though so i have more time.

#16 Pixter

Pixter

    Casio Fan

  • Members
  • PipPip
  • 43 posts
  • Location:The Netherlands
  • Interests:casio, visual basic, lego mindstorms and formula 1.

  • Calculators:
    cfx9850gb plus

Posted 11 April 2003 - 08:17 AM

the calc variables hold 15 digits


weird, my calc (cfx9800gb+) seems to know 10 digits only :(

#17 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 11 April 2003 - 09:52 AM

It displays only 10 digits,

you can see the other 5 by doing something like this:

123456789012345->A
A_  //this outputs A, 10 first digits
Frac(A/1E5)_ //this outputs the 5 last digits


#18 Pixter

Pixter

    Casio Fan

  • Members
  • PipPip
  • 43 posts
  • Location:The Netherlands
  • Interests:casio, visual basic, lego mindstorms and formula 1.

  • Calculators:
    cfx9850gb plus

Posted 11 April 2003 - 05:20 PM

nope, it outputs 0. Strange. :huh:

#19 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 11 April 2003 - 05:43 PM

This may sound silly but did you press the EXP key for the E and
not input the letter? YOu should press the EXP key! a smaller E will appear.

#20 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 11 April 2003 - 05:45 PM

Some older models carry less digits of pressision, but even the fx8000 has 12 or 13 digits..

strange,
perhaps you did something wrong (like inputting the letter E, instead of exonent E.. ;) )

-- EDIT --
sorry huhn_m, didn't see ur post :)

#21 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 13 April 2003 - 05:21 AM

It displays only 10 digits,

you can see the other 5 by doing something like this:

<!--QuoteEBegin-->123456789012345->A<!--QuoteEBegin-->A_  //this outputs A, 10 first digits<!--QuoteEBegin-->Frac(A/1E5)_ //this outputs the 5 last digits<!--QuoteEBegin-->

sorry for the late reply, but I've been trying to get this to work and it wont so I just wrote my own, mabey Pixter is having the same problem I am.
.0123456789123456->A
Lbl 0
10A->A
A-Int A)->A
Int (10A)_     //output sign [SHIFT]+[VARS]+[F4]
Goto 0


that should output all the digits.

#22 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 13 April 2003 - 09:44 AM

Strange, maybe that command doesn't work on the cfx.. only have my afx here, and it works perfectly.. ;)

#23 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 13 April 2003 - 01:18 PM

I have an AFX...

#24 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 13 April 2003 - 01:40 PM

then it should work fine.. printing the fraction of 123456789012345/100000 should give you 0.12345, surely you must do something wrong.. (like input alpha E instead of exponent E, or input 0.123456789012345, instead of 123456789012345...)

#25 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 13 April 2003 - 01:42 PM

oki, I got the .12345 thing, I cant get more though... if it only gets the first 5 what use is it, we can see 10 already? :huh:

#26 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 13 April 2003 - 01:44 PM

it's the last 5.... (the 5 you dont see...)

#27 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 13 April 2003 - 01:47 PM

ohhhhh............
now it makes sense... :blink: :iws:
oh well, mine works to so :P

:lol: :D :lol: :D :lol: :D :lol:

#28 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 13 April 2003 - 02:04 PM

yeah, I used your kind of algorithm as well when I did compression way back.. it's more useful for extracting data :)
just thought this was an easier way of demonstrating how to display more digits of a number than what is printed on screen..

say, for pi, you could do something like this:
pi_                          //displays the first 10 digits
Frac (pi x 1e5)         //gets rid of the first 5 of the fraction + the integer part, all in all the 6 first digits of the number and displays the last 8 (pi is stored only with 14 digits of precission..)


#29 Pixter

Pixter

    Casio Fan

  • Members
  • PipPip
  • 43 posts
  • Location:The Netherlands
  • Interests:casio, visual basic, lego mindstorms and formula 1.

  • Calculators:
    cfx9850gb plus

Posted 13 April 2003 - 02:34 PM

It still doesn't work, whatever I try :(
It always displays 0 for the last 5 digits, even if I type in
Frac (1234567890.12345)

#30 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 13 April 2003 - 02:45 PM

try my method, mabey it will work.

#31 rjstephens

rjstephens

    Casio Freak

  • Members
  • PipPipPipPip
  • 239 posts
  • Location:Brisbane, Queensland, Australia

  • Calculators:
    CFX9850GB+

Posted 14 April 2003 - 01:36 AM

pi related sites:
http://www.angio.net/pi/piquery#find
http://www.angio.net...igits/10000.txt
http://www.hepl.phys...if1000c.data.gz

if anyone finds these useful or interesting, please tell me.

#32 Pixter

Pixter

    Casio Fan

  • Members
  • PipPip
  • 43 posts
  • Location:The Netherlands
  • Interests:casio, visual basic, lego mindstorms and formula 1.

  • Calculators:
    cfx9850gb plus

Posted 14 April 2003 - 06:01 AM

pi related sites:
http://www.angio.net/pi/piquery#find
http://www.angio.net...igits/10000.txt
http://www.hepl.phys...if1000c.data.gz

if anyone finds these useful or interesting, please tell me.

Too few digits, how can I know the surface of my circle precisely enought with that few digits! lol

#33 rjstephens

rjstephens

    Casio Freak

  • Members
  • PipPipPipPip
  • 239 posts
  • Location:Brisbane, Queensland, Australia

  • Calculators:
    CFX9850GB+

Posted 14 April 2003 - 08:40 AM

2 billion!!! come on, you couldn't measure it that precisely!

#34 Pixter

Pixter

    Casio Fan

  • Members
  • PipPip
  • 43 posts
  • Location:The Netherlands
  • Interests:casio, visual basic, lego mindstorms and formula 1.

  • Calculators:
    cfx9850gb plus

Posted 14 April 2003 - 10:38 AM

lol my text editor crashes when I open that file, I think it's too big and my pc is not fast enough to open it. (but my computer sucks). I will give it a try on the laptop tonight.

I am trying to put as much digits of pi as possible on my calc (just for fun :S).
for every byte I have, I can store one digit.
But now something more interesting: is it possible to compress numbers?
I know that you can write 1000 as 1E3 but I'm looking for better ways to compress.

#35 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 14 April 2003 - 02:08 PM

use 1K for 1000 1M for 1,000,000
OPTN->NUM->ESYM

(only for makeing the program smaller.

#36 Pixter

Pixter

    Casio Fan

  • Members
  • PipPip
  • 43 posts
  • Location:The Netherlands
  • Interests:casio, visual basic, lego mindstorms and formula 1.

  • Calculators:
    cfx9850gb plus

Posted 14 April 2003 - 03:27 PM

Sorry, but maybe I was little bit unclear :( .
I mean that I'm thinking about how I can put more numbers in one byte. A programm like winzip or so.


btw, can someone send me a program or a game that uses the 15 digits in one matrix-cell trick? I can't get that working :profanity: . Maybe I'm just too stupid :(

My email is rick_heuijerjans AT hotmail.com

thank you very much :rolleyes:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users