All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.sandia.cognition.math.RingAverager Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
/*
 * File:                RingAverager.java
 * Authors:             Kevin R. Dixon
 * Company:             Sandia National Laboratories
 * Project:             Cognitive Foundry
 *
 * Copyright March 7, 2007, Sandia Corporation.  Under the terms of Contract
 * DE-AC04-94AL85000, there is a non-exclusive license for use of this work by
 * or on behalf of the U.S. Government. Export of this program may require a
 * license from the United States Government. See CopyrightHistory.txt for
 * complete details.
 *
 */

package gov.sandia.cognition.math;

import gov.sandia.cognition.annotation.CodeReview;
import gov.sandia.cognition.util.AbstractCloneableSerializable;
import gov.sandia.cognition.util.Summarizer;
import java.util.Collection;

/**
 * A type of Averager for Rings (Matrices, Vectors, ComplexNumbers). Returns
 * the arithmetic mean of a Collection of Rings
 *
 * @param  Type of Ring to average
 * @author Kevin R. Dixon
 * @since  1.0
 *
 */
@CodeReview(
    reviewer="Kevin R. Dixon",
    date="2008-02-26",
    changesNeeded=false,
    comments="Looks good."
)
public class RingAverager>
    extends AbstractCloneableSerializable
    implements Summarizer
{

    /** Creates a new instance of RingAverager */
    public RingAverager()
    {
    }

    public RingType summarize(
        Collection data )
    {
        RingAccumulator accumulator =
            new RingAccumulator( data );

        return accumulator.getMean();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy