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

Synopsis

• Function: isWellDefined
• Usage:
isWellDefined D
• Inputs:
• D, ,
• Outputs:
• , that is true if underlying data structure is correctly formatted

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 = toricProjectiveSpace 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 : assert not isWellDefined D2 -- missing key(s): {1, 2} i7 : D3 = new ToricDivisor from hashTable { 0 => 2, 1 => x, 2 => 3, symbol variety => PP2, symbol cache => new CacheTable}; o7 : ToricDivisor on PP2 i8 : assert not isWellDefined D3 expected 1-th coefficient to be an integer i9 : D4 = new ToricDivisor from hashTable { 0 => 2, 1 => -7, 2 => 3, symbol variety => 7, symbol cache => new CacheTable}; o9 : ToricDivisor on 7 i10 : assert not isWellDefined D4 expected a divisor over a normal toric variety

The function expression(ToricDivisor) assumes that the input toric divisor is well-defined.