public static double initLogMi(double defaultValue, Iterator constraints,
            DoubleMatrix2D Mi, DoubleMatrix1D Ri) {
        if (constraints != null) {
            defaultValue = RobustMath.LOG0;
            if (Mi != null) Mi.assign(defaultValue);
            Ri.assign(defaultValue);
            for (; constraints.hasNext();) {
                Constraint constraint = (Constraint)constraints.next();
                if (constraint.type() == Constraint.ALLOW_ONLY) {
                    RestrictConstraint cons = (RestrictConstraint)constraint;
                    /*
                     for (int c = cons.numAllowed()-1; c >= 0; c--) {
                     Ri.set(cons.allowed(c),0);
                     }
                     */
                    for (cons.startScan(); cons.hasNext();) {
                        cons.advance();
                        int y = cons.y();
                        int yprev = cons.yprev();
                        if (yprev < 0) {
                            Ri.set(y,0);
                        } else {
                            if (Mi != null) Mi.set(yprev,y,0);
                        }
                    }
                }
            }
        } else {
            if (Mi != null) Mi.assign(defaultValue);
            Ri.assign(defaultValue);    
        } 
        return defaultValue;
    }