Note that there are some explanatory texts on larger screens.

plurals
  1. POI want to implement a small and fast qualitative data type in Fortran
    text
    copied!<p>This is part of a series of questions about implementing a qualitative data type in Fortran.</p> <p><strong>Background:</strong> The topic relates to something called <em>loop analysis of complex systems</em> which one might read about in, for example, Puccia, C. J. and Levins, R. (1986). <em>Qualitative Modeling of Complex Systems: An Introduction to Loop Analysis and Time Averaging</em>. Harvard University Press, Cambridge, MA, or Levins, R. (1974). The qualitative analysis of partially specified systems. <em>Annals of the New York Academy of Sciences</em>, 231:123–138. While I could implement this technique using numerical matrix algebra (as has been done elsewhere), I am interested in approaching the problem from a different direction. The nature of loop analysis is complex and costly (I am not a CS person, but I think it's something like a #P difficulty calculation), and my long term aims are to create a set of libraries for various and sundry loop analysis problems that employ pruning optimizations based on properties of qualitative arithmetic. If this seems hopelessly misguided, please humor me and consider this an exercise in learning.</p> <p>For my purposes the QUALIT data type can have 4 values: -1, 0, +1, and ? (sometimes represented as -, 0, +, and +/- in the literature).</p> <p>I might implement this using two logical elements:</p> <pre><code>bit2 bit1 value 0 0 -1 0 1 0 1 0 1 1 1 ? </code></pre> <p>Or in Fortan:</p> <pre><code>TYPE QUALIT LOGICAL bit2, bit1 END TYPE </code></pre> <p>There are arithmetic operations on QUALIT data which are different than sign arithmetic in standard math packages, and which will be the subject of different questions. My question here:</p> <p>Is deriving a type with two logical variables as I have done above the smallest (memory) and fastest (in terms of manipulating such data) way to define the QUALIT data type? I am going to want to do a large number of arithmetic operations with them (including arithmetic and conditional testing); I am also going to want to create arrays with elements of type QUALIT and perform many operations on these data.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload