private void doWarmStartIfNotNull ( Object warmSolution ) throws FailedToFitException { if ( warmSolution != null ) { if ( warmSolution instanceof SimpleWeightVectorModel ) { SimpleWeightVectorModel warm = ( SimpleWeightVectorModel ) warmSolution ; if ( warm . numWeightsVecs ( ) != ws . length ) throw new FailedToFitException ( "Warm solution has " + warm . numWeightsVecs ( ) + " weight vectors instead of " + ws . length ) ; for ( int i = 0 ; i < ws . length ; i ++ ) { warm . getRawWeight ( i ) . copyTo ( ws [ i ] ) ; if ( useBiasTerm ) bs [ i ] = warm . getBias ( i ) ; } } else throw new FailedToFitException ( "Can not warm warm from " + warmSolution . getClass ( ) . getCanonicalName ( ) ) ; } }
Performs a warm start if the given object is of the appropriate class . Nothing happens if input it null .