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