class EasterRelatedDay implements ISpecialDay {

    @Override
    public double[][] getLongTermMeanEffect(int freq) {
        // week day

        int w = offset % 7;
        if (w == 0) {
            return null;
        }
        if (w < 0) {
            w += 7;
        }
        // monday must be 0...
        --w;

        // Easter always falls between March, 22 and April, 25 (inclusive). The probability to get a specific day is defined by probEaster.
        // We don't take into account leap year. So, the solution is slightly wrong for offset
        // <= -50.
        // The considered day falls between ...
        int d0, d1;
        if (julian) {
            d0 = JSTART + offset;
            d1 = d0 + JDEL;
        } else {
            d0 = START + offset;
            d1 = d0 + DEL;
        }
        // d1 excluded

        int ifreq = (int) freq;
        int c = 12 / ifreq;

        int c0 = 0, c1 = 0;
        for (int i = 0; i < c; ++i) {
            c1 += g_days[i];
        }

        double[][] rslt = new double[ifreq][];
        for (int i = 0; i < ifreq;) {
            if (d0 < c1 && d1 > c0) {
                double[] m = new double[7];
                double x = 0;
                for (int j = Math.max(d0, c0); j < Math.min(d1, c1); ++j) {
                    x += probEaster(j - d0);
                }
                m[w] = x * weight;
                m[6] = -m[w];
                rslt[i] = m;
            }
            // update c0, c1;
            c0 = c1;
            if (++i < ifreq) {
                for (int j = 0; j < c; ++j) {
                    c1 += g_days[i * c + j];
                }
            }
        }
        return rslt;
    }

    public  EasterRelatedDay();
    public  EasterRelatedDay(int offset);
    public  EasterRelatedDay(int offset, boolean julian);
    public  EasterRelatedDay(int offset, double weight);
    public  EasterRelatedDay(int offset, double weight, boolean julian);

}