test_class.declarator: logger = LoggerFactory.getLogger( PolynomialFunctionsTests.class )
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger( PolynomialFunctionsTests.class );
test_class.type: Logger
test_class.var_name: logger
test_class.file: kryptnostic-core/src/test/java/com/kryptnostic/multivariate/composition/RecursiveLinearizingComposerTest.java
test_class.identifier: RecursiveLinearizingComposerTest
test_case.body: @Test 
      public void testRecurisveLinearizingComposer() {
          logger.debug("Starting recursive linearing composer tests.");
          BasePolynomialFunction f = (BasePolynomialFunction)SimplePolynomialFunctions.denseRandomMultivariateQuadratic( 128 , 128);
          BasePolynomialFunction inner = (BasePolynomialFunction) EnhancedBitMatrix.randomMatrix( 128 , 256 ) .multiply(  SimplePolynomialFunctions.identity( 256 ) );
          
          
          RecursiveLinearizingComposer composer = new RecursiveLinearizingComposer( f );
          Stopwatch watch = Stopwatch.createStarted();
          SimplePolynomialFunction composed = composer.compose( inner );
          logger.info( "Compose time: {} ms" , watch.elapsed( TimeUnit.MILLISECONDS ) );
          
          BitVector input =  BitVectors.randomVector( inner.getInputLength() );
          BitVector expected = f.apply( inner.apply( input ) );
          BitVector actual = composed.apply( input );
          
          Assert.assertEquals( expected , actual );
      }
test_case.class_method_signature: RecursiveLinearizingComposerTest.testRecurisveLinearizingComposer()
test_case.full_signature: @Test public void testRecurisveLinearizingComposer()
test_case.identifier: testRecurisveLinearizingComposer
test_case.invocations: debug denseRandomMultivariateQuadratic multiply randomMatrix identity createStarted compose info elapsed randomVector getInputLength apply apply apply assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRecurisveLinearizingComposer()
focal_class.declarator: constantContribution
focal_class.modifier: private
focal_class.original_string: private BitVector constantContribution;
focal_class.type: BitVector
focal_class.var_name: constantContribution
focal_class.file: kryptnostic-core/src/main/java/com/kryptnostic/multivariate/composition/RecursiveLinearizingComposer.java
focal_class.identifier: RecursiveLinearizingComposer
focal_class.class_method_signature: RecursiveLinearizingComposer.RecursiveLinearizingComposer(SimplePolynomialFunction outer )
focal_class.full_signature: public  RecursiveLinearizingComposer(SimplePolynomialFunction outer )
focal_class.identifier: RecursiveLinearizingComposer
focal_class.modifiers: public
focal_class.parameters: (SimplePolynomialFunction outer )
focal_class.signature:  RecursiveLinearizingComposer(SimplePolynomialFunction outer )
focal_class.class_method_signature: RecursiveLinearizingComposer.bucket(Monomial m, BitVector contribution)
focal_class.full_signature: @Override public void bucket(Monomial m, BitVector contribution)
focal_class.identifier: bucket
focal_class.modifiers: @Override public
focal_class.parameters: (Monomial m, BitVector contribution)
focal_class.return: void
focal_class.signature: void bucket(Monomial m, BitVector contribution)
focal_class.class_method_signature: RecursiveLinearizingComposer.compose( SimplePolynomialFunction inner )
focal_class.full_signature: public SimplePolynomialFunction compose( SimplePolynomialFunction inner )
focal_class.identifier: compose
focal_class.modifiers: public
focal_class.parameters: ( SimplePolynomialFunction inner )
focal_class.return: SimplePolynomialFunction
focal_class.signature: SimplePolynomialFunction compose( SimplePolynomialFunction inner )
focal_class.class_method_signature: RecursiveLinearizingComposer.getConstantFunction( int innerInputLength)
focal_class.full_signature: public SimplePolynomialFunction getConstantFunction( int innerInputLength)
focal_class.identifier: getConstantFunction
focal_class.modifiers: public
focal_class.parameters: ( int innerInputLength)
focal_class.return: SimplePolynomialFunction
focal_class.signature: SimplePolynomialFunction getConstantFunction( int innerInputLength)
focal_class.class_method_signature: RecursiveLinearizingComposer.indices( Monomial[] innerMonomials )
focal_class.full_signature: private static ConcurrentMap<Monomial,Integer> indices( Monomial[] innerMonomials )
focal_class.identifier: indices
focal_class.modifiers: private static
focal_class.parameters: ( Monomial[] innerMonomials )
focal_class.return: ConcurrentMap<Monomial,Integer>
focal_class.signature: ConcurrentMap<Monomial,Integer> indices( Monomial[] innerMonomials )
focal_class.class_method_signature: RecursiveLinearizingComposer.rowContributions( SimplePolynomialFunction inner )
focal_class.full_signature: private static List<BitVector> rowContributions( SimplePolynomialFunction inner )
focal_class.identifier: rowContributions
focal_class.modifiers: private static
focal_class.parameters: ( SimplePolynomialFunction inner )
focal_class.return: List<BitVector>
focal_class.signature: List<BitVector> rowContributions( SimplePolynomialFunction inner )
focal_class.class_method_signature: RecursiveLinearizingComposer.initializeTreeFromOuter( SimplePolynomialFunction outer )
focal_class.full_signature: private static RecursiveLinearizingComposerTree[] initializeTreeFromOuter( SimplePolynomialFunction outer )
focal_class.identifier: initializeTreeFromOuter
focal_class.modifiers: private static
focal_class.parameters: ( SimplePolynomialFunction outer )
focal_class.return: RecursiveLinearizingComposerTree[]
focal_class.signature: RecursiveLinearizingComposerTree[] initializeTreeFromOuter( SimplePolynomialFunction outer )
focal_class.superclass: extends RecursiveLinearizingComposerTree
focal_method.body: public SimplePolynomialFunction compose( SimplePolynomialFunction inner ) {
          Preconditions.checkArgument(outerInputLength == inner.getOutputLength() , "Outer input length must equal inner output length" );
          List<SimplePolynomialFunction> pieces = evaluate( null , Arrays.asList( inner.getMonomials() ), Lists.newArrayList( inner.getMonomials() ), rowContributions( inner ) , indices( inner.getMonomials() ) );
          SimplePolynomialFunction result = null;
          for( SimplePolynomialFunction piece : pieces ) {
              if( result == null ) { 
                  result = piece;
              } else {
                  result = piece.xor( result );
              }
          }
          if( constantContribution!=null ) {
              result = result.xor( getConstantFunction( inner.getInputLength() ) );
          }
          return result;
      }
focal_method.class_method_signature: RecursiveLinearizingComposer.compose( SimplePolynomialFunction inner )
focal_method.full_signature: public SimplePolynomialFunction compose( SimplePolynomialFunction inner )
focal_method.identifier: compose
focal_method.invocations: checkArgument getOutputLength evaluate asList getMonomials newArrayList getMonomials rowContributions indices getMonomials xor xor getConstantFunction getInputLength
focal_method.modifiers: public
focal_method.parameters: ( SimplePolynomialFunction inner )
focal_method.return: SimplePolynomialFunction
focal_method.signature: SimplePolynomialFunction compose( SimplePolynomialFunction inner )