Function iaintershow

namespace:morph
page:iaintershow

Synopse

Visualize an interval.

  • s = iaintershow(Iab)
    • s: String
    • Iab: Interval
01. from numpy import *
02. from string import join
03. 
04. def iaintershow(Iab):
05.     from iaseunion import iaseunion
06.     from iaintersec import iaintersec
07. 
08. 
09.     assert (type(Iab) is tuple) and (len(Iab) == 2),'not proper fortmat of hit-or-miss template'
10.     A,Bc = Iab
11.     S = iaseunion(A,Bc)
12.     Z = iaintersec(S,0)
13.     n = product(S.shape)
14.     one  = reshape(array(n*'1','c'),S.shape)
15.     zero = reshape(array(n*'0','c'),S.shape)
16.     x    = reshape(array(n*'.','c'),S.shape)
17.     saux = choose( S + iaseunion(Z,A), ( x, zero, one))
18.     s = ''
19.     for i in range(saux.shape[0]):
20.         s=s+(join(list(saux[i]))+' \n')
21. 
22.     return s

Description

iaintershow creates a representation for an interval using 0, 1 and . ( don't care).

Examples

Example 1

1. from ia870 import iaintershow
2. from ia870 import iahomothin
3. 
4. 
5. print iaintershow( iahomothin())
0 0 0 
. 0 . 
0 0 0

See Also