next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
NormalToricVarieties :: isWellDefined(ToricDivisor)

isWellDefined(ToricDivisor) -- whether a toric divisor is well-defined

Synopsis

Description

This function checks that the following aspects of the data structure:
  • the underlying HashTable has the expected keys, namely the integers from 0 to n-1 where n = # rays variety D, variety, and cache,
  • the value of each integer key is an ZZ,
  • the value of the variety key is a NormalToricVariety,
  • the value of the cache key is a CacheTable.
i1 : PP2 = projectiveSpace 2

o1 = PP2

o1 : NormalToricVariety
i2 : D1 = toricDivisor({2,-7,3}, PP2)

o2 = 2*PP2  - 7*PP2  + 3*PP2
          0        1        2

o2 : ToricDivisor on PP2
i3 : assert isWellDefined D1
i4 : debugLevel = 1;
i5 : D2 = new ToricDivisor from hashTable { 0 => 2, symbol variety => PP2, symbol cache => new CacheTable};

o5 : ToricDivisor on PP2
i6 : isWellDefined D2
-- missing key(s): {1, 2}

o6 = false
i7 : D3 = new ToricDivisor from hashTable { 0 => 2, 1 => x, 2 => 3, symbol variety => PP2, symbol cache => new CacheTable};

o7 : ToricDivisor on PP2
i8 : isWellDefined D3        
expected 1-th coefficient to be an integer

o8 = false
i9 : D4 = new ToricDivisor from hashTable { 0 => 2, 1 => -7, 2 => 3, symbol variety => 7, symbol cache => new CacheTable};   

o9 : ToricDivisor on 7
i10 : isWellDefined D4        
expected a divisor over a normal toric variety

o10 = false
i11 : debugLevel = 0; 
i12 : assert not isWellDefined D2
i13 : assert not isWellDefined D3     
i14 : assert not isWellDefined D4             
The function expression(ToricDivisor) assumes that the input toric divisor is well-defined.

See also