001    /*
002     * =============================================================================
003     * Simplified BSD License, see http://www.opensource.org/licenses/
004     * -----------------------------------------------------------------------------
005     * Copyright (c) 2008, Marco Terzer, Zurich, Switzerland
006     * All rights reserved.
007     * 
008     * Redistribution and use in source and binary forms, with or without 
009     * modification, are permitted provided that the following conditions are met:
010     * 
011     *     * Redistributions of source code must retain the above copyright notice, 
012     *       this list of conditions and the following disclaimer.
013     *     * Redistributions in binary form must reproduce the above copyright 
014     *       notice, this list of conditions and the following disclaimer in the 
015     *       documentation and/or other materials provided with the distribution.
016     *     * Neither the name of the Swiss Federal Institute of Technology Zurich 
017     *       nor the names of its contributors may be used to endorse or promote 
018     *       products derived from this software without specific prior written 
019     *       permission.
020     * 
021     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
022     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
023     * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
024     * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
025     * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
026     * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
027     * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
028     * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
029     * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030     * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031     * POSSIBILITY OF SUCH DAMAGE.
032     * =============================================================================
033     */
034    package ch.javasoft.smx.iface;
035    
036    public interface RationalMatrix {
037            /**
038             * Reduce the whole matrix, that is, divide numerators/denominators by
039             * their greatest common divisor
040             * 
041             * @return true if any value has been changed in the matrix
042             */
043            boolean reduce();
044            /**
045             * Reduce the specified row, that is, divide numerators/denominators by
046             * their greatest common divisor
047             * 
048             * @return true if any value has been changed in the given row
049             */
050            boolean reduceRow(int row);
051            /**
052             * Reduce the specified value, that is, divide numerator/denominator by
053             * their greatest common divisor
054             * 
055             * @return true if the value has been changed
056             */
057            boolean reduceValueAt(int row, int col);
058    }