001 /*
002 * $Id: ModulFactory.java 1708 2008-02-24 17:28:36Z kredel $
003 */
004
005 package edu.jas.structure;
006
007 import java.util.List;
008
009
010 /**
011 * Module factory interface.
012 * Defines conversion from list and sparse random.
013 * @param <M> module type
014 * @param <C> coefficient type
015 * @author Heinz Kredel
016 */
017 public interface ModulFactory<M extends ModulElem<M,C>,
018 C extends RingElem<C>>
019 extends AbelianGroupFactory<M> {
020
021
022 /**
023 * Convert list to module.
024 * @param v list of ring elements.
025 * @return a module element with the elements from v.
026 */
027 public M fromList(List<C> v);
028
029
030 /**
031 * Random vector.
032 * @param k size of coefficients.
033 * @param q fraction of non zero elements.
034 * @return a random vector.
035 */
036 public M random(int k, float q);
037
038 }