static boolean computeLogMiInitDone(FeatureGenerator featureGen, double lambda[], 
            DoubleMatrix2D Mi_YY,
            DoubleMatrix1D Ri_Y, double DEFAULT_VALUE) {
        if ((Mi_YY==null) && (featureGen instanceof FeatureGenCache) && (DEFAULT_VALUE==0)) {
            ((FeatureGenCache)featureGen).noEdgeFeatures();
        }
        boolean mSet = false;
        while (featureGen.hasNext()) { 
            Feature feature = featureGen.next();
            int f = feature.index();
            int yp = feature.y();
            int yprev = feature.yprev();
            float val = feature.value();
            if (yprev == -1) {
                // this is a single state feature.
                
                // if default value was a negative_infinity, need to
                // reset to.
                double oldVal = Ri_Y.get(yp);
                if (oldVal == DEFAULT_VALUE)
                    oldVal = 0;
                Ri_Y.set(yp,oldVal+lambda[f]*val);
            } else {
                //if (Ri_Y.get(yp) == DEFAULT_VALUE)
                 //   Ri_Y.set(yp,0);
                if (Mi_YY != null) {
                    double oldVal = Mi_YY.get(yprev,yp);
                    if (oldVal == DEFAULT_VALUE) {
                        oldVal = 0;
                    }
                    Mi_YY.set(yprev,yp,oldVal+lambda[f]*val);
                    mSet = true;
                }
            }
        }
        return mSet;
    }