Re: Logical handling
- From: "Terence" <tbwright@xxxxxxxxx>
- Date: 2 Sep 2006 17:13:30 -0700
It's general on virtually any existing processor. For Fortran LOGICAL
is, as you note, equivalent in length to INTEGER and does not have an
intrinsic bit type. Since Intel processors in particular (and
virtually all in general) are word- or byte-addressable, the faster
operation(s) are on words,
True so far.
...and addressing individual bits would, if implemented,
be more compute-intensive than the equivalent word operation(s).
This is sounds logical but is debateable.
TAU Systems and Quantum built their Market Research processing software
(since the early seventies) on using 16 (or 32) bit words, where each
bit represents a truth value. Almost every other commercial research
software uses ascii files and single to multiple character
representations of codes, on the reasoning that disk space and memory
is cheap and cpu processing is now essential instantaneous.
But it ain't always so...
In searching for conditions or patterns, the bit-wise parallel
processing of 16 (or 32) bit words is 16 (or 32) times faster and takes
up 1/16th (or 1/32th) of the space and access times whether memory or
disk. Since a charcter is usually 8 bits, not 16, the gain in total
time is 16*16/2 = 128 (or 32*32/2) = 512 times, versus a character
representation and processing. These are still important efficiency
factors.
Quantum (now SPSS) also inverts the collected sample global
person-response bit matrix to a response-person matrix, which although
time-consuming to perform that once, all further response-counting for
statistics puposes only needs access to one possible response record as
a filter and two more such records, to produce a staistical report on
demand. (The total response to a question is then just the sample size
in bits, stored as a record of bit-holding words, where each bit is a
YES from a person in person order, rounded up to the next word size
multiple and therfore giving fixed length records acessable directly).
TAU uses a bit-wise vector technique that doesn't need a x vs y
one-by-one check, and produces all reports directly, on one pass. With
today's micros you get all the hundreds of possible reports on disk in
only several seconds. The time to print is another story.
I have solved very many problems much faster, by thinking fisrt and
then often ended up using a bit-based paralled algorithm rather than a
one-by-one matrix search.
Terence Wright
.
- Prev by Date: Re: How to generate non-central random number?
- Next by Date: Re: Reading a string that contains a slash.
- Previous by thread: Re: Parallel communication - SHMEM / ARMCI
- Next by thread: Re: Logical handling
- Index(es):
Relevant Pages
|