Macaulay2 » Documentation
Packages » DGAlgebras » Accessors and cache management » ensureDGAlgebraCaches
next | previous | forward | backward | up | index | toc

ensureDGAlgebraCaches -- Guarantee that the standard cache sub-tables are present

Description

ensureDGAlgebraCaches is idempotent: it creates the cache sub-tables that the rest of the package expects (the homology, homologyAlgebra, and diffs sub-tables for a DG algebra; the diffs sub-table for a DG module), and leaves any that already exist untouched. Code that reads from the cache can call this method once up front and thereafter assume the sub-tables are present with the right types, rather than defensively checking each access.

i1 : R = QQ[x, y] / ideal(x^2, y^2)

o1 = R

o1 : QuotientRing
i2 : A = koszulComplexDGA R

o2 = {Ring => R                          }
      Underlying algebra => R[T   ..T   ]
                               1,1   1,2
      Differential => {x, y}

o2 : DGAlgebra
i3 : ensureDGAlgebraCaches A

o3 = {Ring => R                          }
      Underlying algebra => R[T   ..T   ]
                               1,1   1,2
      Differential => {x, y}

o3 : DGAlgebra
i4 : assert(instance(A.cache, CacheTable))
i5 : ensureDGAlgebraCaches A

o5 = {Ring => R                          }
      Underlying algebra => R[T   ..T   ]
                               1,1   1,2
      Differential => {x, y}

o5 : DGAlgebra
i6 : assert(instance(A.cache, CacheTable))
i7 : KM = koszulComplexDGM R^1

o7 = {Base ring => R                    }
      DG algebra => R[T   ..T   ]
                       1,1   1,2
                                       1
      Natural module => (R[T   ..T   ])
                            1,1   1,2
      Generator degrees => {{0, 0}}
      Differentials on gens => {0}

o7 : DGModule
i8 : ensureDGAlgebraCaches KM

o8 = {Base ring => R                    }
      DG algebra => R[T   ..T   ]
                       1,1   1,2
                                       1
      Natural module => (R[T   ..T   ])
                            1,1   1,2
      Generator degrees => {{0, 0}}
      Differentials on gens => {0}

o8 : DGModule
i9 : assert(instance(KM.cache, CacheTable))

See also

Ways to use ensureDGAlgebraCaches:

  • ensureDGAlgebraCaches(DGAlgebra)
  • ensureDGAlgebraCaches(DGModule)

For the programmer

The object ensureDGAlgebraCaches is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/DGAlgebras/doc.m2:7459:0.