Changeset 7735:5af6ad7bad8c


Ignore:
Timestamp:
12/01/07 18:15:02 (5 years ago)
Author:
R. L. Miller <rlmillster@…>
Branch:
default
Tags:
2.9.rc0
Message:

fixed visualize_structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sage/matrix/matrix2.pyx

    r7723 r7735  
    28452845                       the same pixelsize as the matrix dimensions (default: 512) 
    28462846 
     2847        EXAMPLE: 
     2848            sage: M = random_matrix(CC, 4) 
     2849            sage: M.visualize_structure() 
     2850 
    28472851        """ 
    28482852        import gd 
    28492853        import os 
    28502854         
    2851         cdef int x, y, _x, _y, v, bi 
     2855        cdef int x, y, _x, _y, v, bi, bisq 
    28522856        cdef int ir,ic 
    28532857        cdef float b, fct 
     
    28762880        fct = 255.0/(b*b) 
    28772881        bi = <int>b 
     2882        bisq = bi*bi 
    28782883 
    28792884        im = gd.image((ir,ic),1) 
     
    28872892        for x from 0 <= x < ic: 
    28882893            for y from 0 <= y < ir: 
     2894                v = bisq 
    28892895                for _x from 0 <= _x < bi: 
    28902896                    for _y from 0 <= _y < bi: 
     
    28922898                            v-=1 #increase darkness 
    28932899 
    2894                 v = int(b*b*fct) 
     2900                v = int(v*v*fct) 
    28952901                val = colorExact((v,v,v)) 
    28962902                setPixel((y,x), val) 
Note: See TracChangeset for help on using the changeset viewer.