next | previous | forward | backward | up | top | index | toc | Macaulay2 website
SVDComplexes :: commonEntries

commonEntries -- lists of positions, where they coincide up to threshold

Synopsis

Description

Determine the positions, where the non-zero numbers in both lists which coincide up to a threshold. This is needed in the Laplacian method to compute the SVD normal form of a complex

i1 : needsPackage "RandomComplexes"

o1 = RandomComplexes

o1 : Package
i2 : setRandomSeed "a good example";
i3 : h={2,3,5,3}

o3 = {2, 3, 5, 3}

o3 : List
i4 : r={4,3,5}

o4 = {4, 3, 5}

o4 : List
i5 : elapsedTime C=randomChainComplex(h,r,Height=>100,ZeroMean=>true)
 -- 0.00276124 seconds elapsed

       6       10       13       8
o5 = ZZ  <-- ZZ   <-- ZZ   <-- ZZ
                                
     0       1        2        3

o5 : ChainComplex
i6 : C.dd^2

           6          13
o6 = 0 : ZZ  <----- ZZ   : 2
                0

           10          8
     1 : ZZ   <----- ZZ  : 3
                 0

o6 : ChainComplexMap
i7 : D=disturb(C**RR_53,1e-4)

         6         10         13         8
o7 = RR    <-- RR     <-- RR     <-- RR
       53        53         53         53
                                      
     0         1          2          3

o7 : ChainComplex
i8 : Delta=laplacians D;
i9 : L0=(SVD Delta#0)_0, L1=(SVD Delta#1)_0,L2=(SVD Delta#2)_0,L3=(SVD Delta#3)_0

o9 = ({60648900}, {28210500000}, {28210500000}, {2056900000})
      {55489200}  {9617270000 }  {9617270000 }  {1028620000}
      {29990300}  {3132530000 }  {3132530000 }  {754460000 }
      {9100710 }  {60649000   }  {2056900000 }  {484906000 }
      {.327165 }  {55489300   }  {1028620000 }  {49026600  }
      {.0102018}  {29990300   }  {754460000  }  {3.7497    }
                  {9100740    }  {484906000  }  {2.9526    }
                  {38.8744    }  {49026600   }  {1.35595   }
                  {21.2473    }  {51.0793    }
                  {5.85738    }  {29.3294    }
                                 {20.8771    }
                                 {3.48837    }
                                 {2.04772    }

o9 : Sequence
i10 : commonEntries(L0,L1)

o10 = ({0, 1, 2, 3}, {3, 4, 5, 6})

o10 : Sequence
i11 : commonEntries(L1,L2)

o11 = ({0, 1, 2}, {0, 1, 2})

o11 : Sequence
i12 : commonEntries(L2,L3)

o12 = ({3, 4, 5, 6, 7}, {0, 1, 2, 3, 4})

o12 : Sequence

Caveat

See also

Ways to use commonEntries :

For the programmer

The object commonEntries is a method function with options.