001    /*
002     * $Id: ModularRingFactory.java 3355 2010-10-23 16:01:52Z kredel $
003     */
004    
005    package edu.jas.arith;
006    
007    
008    import edu.jas.structure.RingElem;
009    import edu.jas.structure.RingFactory;
010    
011    
012    /**
013     * Modular ring factory interface. Defines chinese remainder method and get
014     * modul method.
015     * @author Heinz Kredel
016     */
017    
018    public interface ModularRingFactory<C extends RingElem<C> & Modular> extends RingFactory<C> {
019    
020    
021        /**
022         * Return the BigInteger modul for the factory.
023         * @return a BigInteger of this.modul.
024         */
025        public BigInteger getIntegerModul();
026    
027    
028        /**
029         * Chinese remainder algorithm. Assert c.modul >= a.modul and c.modul *
030         * a.modul = this.modul.
031         * @param c modular.
032         * @param ci inverse of c.modul in ring of a.
033         * @param a other ModLong.
034         * @return S, with S mod c.modul == c and S mod a.modul == a.
035         */
036        public C chineseRemainder(C c, C ci, C a);
037    
038    }