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