public static ManagerFunctions . InputN createMultTransA ( ) { return ( inputs , manager ) -> { if ( inputs . size ( ) != 2 ) throw new RuntimeException ( "Two inputs required" ) ; final Variable varA = inputs . get ( 0 ) ; final Variable varB = inputs . get ( 1 ) ; Operation . Info ret = new Operation . Info ( ) ; if ( varA instanceof VariableMatrix && varB instanceof VariableMatrix ) { // The output matrix or scalar variable must be created with the provided manager final VariableMatrix output = manager . createMatrix ( ) ; ret . output = output ; ret . op = new Operation ( "multTransA-mm" ) { @ Override public void process ( ) { DMatrixRMaj mA = ( ( VariableMatrix ) varA ) . matrix ; DMatrixRMaj mB = ( ( VariableMatrix ) varB ) . matrix ; CommonOps_DDRM . multTransA ( mA , mB , output . matrix ) ; } } ; } else { throw new IllegalArgumentException ( "Expected both inputs to be a matrix" ) ; } return ret ; } ; }
Create the function . Be sure to handle all possible input types and combinations correctly and provide meaningful error messages . The output matrix should be resized to fit the inputs .