| 40 | namespace NLR { |
| 41 | |
| 42 | DeepPolyAnalysis::DeepPolyAnalysis( LayerOwner *layerOwner ) |
| 43 | : _layerOwner( layerOwner ) |
| 44 | , _work1SymbolicLb( NULL ) |
| 45 | , _work1SymbolicUb( NULL ) |
| 46 | , _work2SymbolicLb( NULL ) |
| 47 | , _work2SymbolicUb( NULL ) |
| 48 | , _workSymbolicLowerBias( NULL ) |
| 49 | , _workSymbolicUpperBias( NULL ) |
| 50 | { |
| 51 | const Map<unsigned, Layer *> &layers = _layerOwner->getLayerIndexToLayer(); |
| 52 | // Get the maximal layer size |
| 53 | unsigned maxLayerSize = 0; |
| 54 | for ( const auto &pair : layers ) |
| 55 | { |
| 56 | unsigned thisLayerSize = pair.second->getSize(); |
| 57 | if ( thisLayerSize > maxLayerSize ) |
| 58 | maxLayerSize = thisLayerSize; |
| 59 | } |
| 60 | _maxLayerSize = maxLayerSize; |
| 61 | |
| 62 | allocateMemory(); |
| 63 | for ( const auto &pair : layers ) |
| 64 | { |
| 65 | /* |
| 66 | Go over the layers, one by one. Each time construct and execute |
| 67 | the abstract element. |
| 68 | */ |
| 69 | unsigned index = pair.first; |
| 70 | Layer *layer = pair.second; |
| 71 | log( Stringf( "Creating deeppoly element for layer %u...", index ) ); |
| 72 | DeepPolyElement *deepPolyElement = createDeepPolyElement( layer ); |
| 73 | _deepPolyElements[index] = deepPolyElement; |
| 74 | log( Stringf( "Creating deeppoly element for layer %u - done", index ) ); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | DeepPolyAnalysis::~DeepPolyAnalysis() |
| 79 | { |