public static Info ones ( final Variable A , final Variable B , ManagerTempVariables manager ) { Info ret = new Info ( ) ; final VariableMatrix output = manager . createMatrix ( ) ; ret . output = output ; if ( A instanceof VariableInteger && B instanceof VariableInteger ) { ret . op = new Operation ( "ones-ii" ) { @ Override public void process ( ) { int numRows = ( ( VariableInteger ) A ) . value ; int numCols = ( ( VariableInteger ) B ) . value ; output . matrix . reshape ( numRows , numCols ) ; CommonOps_DDRM . fill ( output . matrix , 1 ) ; } } ; } else { throw new RuntimeException ( "Expected two integers got " + A + " " + B ) ; } return ret ; }
Returns a matrix full of ones