1dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/* 2dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Licensed to the Apache Software Foundation (ASF) under one or more 3dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * contributor license agreements. See the NOTICE file distributed with 4dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * this work for additional information regarding copyright ownership. 5dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * The ASF licenses this file to You under the Apache License, Version 2.0 6dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (the "License"); you may not use this file except in compliance with 7dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the License. You may obtain a copy of the License at 8dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 9dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * http://www.apache.org/licenses/LICENSE-2.0 10dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 11dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Unless required by applicable law or agreed to in writing, software 12dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * distributed under the License is distributed on an "AS IS" BASIS, 13dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * See the License for the specific language governing permissions and 15dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * limitations under the License. 16dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 17dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 18dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpackage org.apache.commons.math.linear; 19dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 20dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 21dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondimport org.apache.commons.math.Field; 22dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondimport org.apache.commons.math.FieldElement; 23dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondimport org.apache.commons.math.linear.MatrixVisitorException; 24dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 25dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/** 26dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Interface defining field-valued matrix with basic algebraic operations. 27dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p> 28dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Matrix element indexing is 0-based -- e.g., <code>getEntry(0, 0)</code> 29dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * returns the element in the first row, first column of the matrix.</p> 30dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 31dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param <T> the type of the field elements 32dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @version $Revision: 1073158 $ $Date: 2011-02-21 22:46:52 +0100 (lun. 21 févr. 2011) $ 33dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 34dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpublic interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix { 35dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 36dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 37dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Get the type of field elements of the matrix. 38dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return type of field elements of the matrix 39dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 40dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond Field<T> getField(); 41dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 42dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 43dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Create a new FieldMatrix<T> of the same type as the instance with the supplied 44dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * row and column dimensions. 45dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 46dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param rowDimension the number of rows in the new matrix 47dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param columnDimension the number of columns in the new matrix 48dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return a new matrix of the same type as the instance 49dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws IllegalArgumentException if row or column dimension is not positive 50dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 2.0 51dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 52dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> createMatrix(final int rowDimension, final int columnDimension); 53dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 54dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 55dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns a (deep) copy of this. 56dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 57dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return matrix copy 58dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 59dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> copy(); 60dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 61dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 62dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Compute the sum of this and m. 63dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 64dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param m matrix to be added 65dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return this + m 66dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws IllegalArgumentException if m is not the same size as this 67dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 68dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> add(FieldMatrix<T> m) throws IllegalArgumentException; 69dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 70dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 71dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Compute this minus m. 72dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 73dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param m matrix to be subtracted 74dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return this + m 75dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws IllegalArgumentException if m is not the same size as this 76dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 77dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> subtract(FieldMatrix<T> m) throws IllegalArgumentException; 78dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 79dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 80dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the result of adding d to each entry of this. 81dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 82dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param d value to be added to each entry 83dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return d + this 84dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 85dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> scalarAdd(T d); 86dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 87dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 88dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the result multiplying each entry of this by d. 89dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 90dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param d value to multiply all entries by 91dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return d * this 92dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 93dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> scalarMultiply(T d); 94dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 95dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 96dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the result of postmultiplying this by m. 97dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 98dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param m matrix to postmultiply by 99dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return this * m 100dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws IllegalArgumentException 101dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * if columnDimension(this) != rowDimension(m) 102dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 103dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> multiply(FieldMatrix<T> m) throws IllegalArgumentException; 104dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 105dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 106dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the result premultiplying this by <code>m</code>. 107dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param m matrix to premultiply by 108dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return m * this 109dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws IllegalArgumentException 110dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * if rowDimension(this) != columnDimension(m) 111dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 112dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> preMultiply(FieldMatrix<T> m) throws IllegalArgumentException; 113dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 114dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 115dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns matrix entries as a two-dimensional array. 116dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 117dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return 2-dimensional array of entries 118dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 119dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T[][] getData(); 120dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 121dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 122dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Gets a submatrix. Rows and columns are indicated 123dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * counting from 0 to n-1. 124dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 125dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startRow Initial row index 126dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endRow Final row index (inclusive) 127dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startColumn Initial column index 128dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endColumn Final column index (inclusive) 129dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return The subMatrix containing the data of the 130dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * specified rows and columns 131dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixIndexException if the indices are not valid 132dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 133dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> getSubMatrix(int startRow, int endRow, int startColumn, int endColumn) 134dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException; 135dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 136dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 137dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Gets a submatrix. Rows and columns are indicated 138dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * counting from 0 to n-1. 139dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 140dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param selectedRows Array of row indices. 141dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param selectedColumns Array of column indices. 142dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return The subMatrix containing the data in the 143dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * specified rows and columns 144dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixIndexException if row or column selections are not valid 145dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 146dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> getSubMatrix(int[] selectedRows, int[] selectedColumns) 147dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException; 148dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 149dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 150dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Copy a submatrix. Rows and columns are indicated 151dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * counting from 0 to n-1. 152dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 153dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startRow Initial row index 154dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endRow Final row index (inclusive) 155dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startColumn Initial column index 156dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endColumn Final column index (inclusive) 157dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param destination The arrays where the submatrix data should be copied 158dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (if larger than rows/columns counts, only the upper-left part will be used) 159dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixIndexException if the indices are not valid 160dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception IllegalArgumentException if the destination array is too small 161dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 162dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void copySubMatrix(int startRow, int endRow, int startColumn, int endColumn, 163dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T[][] destination) 164dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, IllegalArgumentException; 165dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 166dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 167dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Copy a submatrix. Rows and columns are indicated 168dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * counting from 0 to n-1. 169dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 170dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param selectedRows Array of row indices. 171dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param selectedColumns Array of column indices. 172dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param destination The arrays where the submatrix data should be copied 173dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (if larger than rows/columns counts, only the upper-left part will be used) 174dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixIndexException if the indices are not valid 175dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception IllegalArgumentException if the destination array is too small 176dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 177dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void copySubMatrix(int[] selectedRows, int[] selectedColumns, T[][] destination) 178dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, IllegalArgumentException; 179dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 180dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 181dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Replace the submatrix starting at <code>row, column</code> using data in 182dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the input <code>subMatrix</code> array. Indexes are 0-based. 183dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p> 184dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Example:<br> 185dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Starting with <pre> 186dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 1 2 3 4 187dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 5 6 7 8 188dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 9 0 1 2 189dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * </pre> 190dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * and <code>subMatrix = {{3, 4} {5,6}}</code>, invoking 191dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <code>setSubMatrix(subMatrix,1,1))</code> will result in <pre> 192dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 1 2 3 4 193dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 5 3 4 8 194dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 9 5 6 2 195dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * </pre></p> 196dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 197dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param subMatrix array containing the submatrix replacement data 198dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row row coordinate of the top, left element to be replaced 199dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column column coordinate of the top, left element to be replaced 200dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if subMatrix does not fit into this 201dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * matrix from element in (row, column) 202dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws IllegalArgumentException if <code>subMatrix</code> is not rectangular 203dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (not all rows have the same length) or empty 204dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws NullPointerException if <code>subMatrix</code> is null 205dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 2.0 206dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 207dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void setSubMatrix(T[][] subMatrix, int row, int column) 208dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException; 209dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 210dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 211dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the entries in row number <code>row</code> 212dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as a row matrix. Row indices start at 0. 213dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 214dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row the row to be fetched 215dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return row matrix 216dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified row index is invalid 217dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 218dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> getRowMatrix(int row) throws MatrixIndexException; 219dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 220dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 221dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Sets the entries in row number <code>row</code> 222dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as a row matrix. Row indices start at 0. 223dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 224dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row the row to be set 225dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param matrix row matrix (must have one row and the same number of columns 226dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as the instance) 227dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified row index is invalid 228dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws InvalidMatrixException if the matrix dimensions do not match one 229dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * instance row 230dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 231dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void setRowMatrix(int row, FieldMatrix<T> matrix) 232dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, InvalidMatrixException; 233dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 234dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 235dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the entries in column number <code>column</code> 236dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as a column matrix. Column indices start at 0. 237dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 238dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column the column to be fetched 239dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return column matrix 240dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified column index is invalid 241dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 242dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> getColumnMatrix(int column) throws MatrixIndexException; 243dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 244dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 245dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Sets the entries in column number <code>column</code> 246dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as a column matrix. Column indices start at 0. 247dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 248dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column the column to be set 249dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param matrix column matrix (must have one column and the same number of rows 250dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as the instance) 251dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified column index is invalid 252dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws InvalidMatrixException if the matrix dimensions do not match one 253dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * instance column 254dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 255dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void setColumnMatrix(int column, FieldMatrix<T> matrix) 256dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, InvalidMatrixException; 257dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 258dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 259dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the entries in row number <code>row</code> 260dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as a vector. Row indices start at 0. 261dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 262dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row the row to be fetched 263dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return row vector 264dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified row index is invalid 265dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 266dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldVector<T> getRowVector(int row) throws MatrixIndexException; 267dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 268dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 269dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Sets the entries in row number <code>row</code> 270dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as a vector. Row indices start at 0. 271dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 272dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row the row to be set 273dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param vector row vector (must have the same number of columns 274dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as the instance) 275dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified row index is invalid 276dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws InvalidMatrixException if the vector dimension does not match one 277dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * instance row 278dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 279dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void setRowVector(int row, FieldVector<T> vector) 280dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, InvalidMatrixException; 281dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 282dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 283dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the entries in column number <code>column</code> 284dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as a vector. Column indices start at 0. 285dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 286dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column the column to be fetched 287dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return column vector 288dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified column index is invalid 289dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 290dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldVector<T> getColumnVector(int column) throws MatrixIndexException; 291dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 292dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 293dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Sets the entries in column number <code>column</code> 294dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as a vector. Column indices start at 0. 295dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 296dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column the column to be set 297dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param vector column vector (must have the same number of rows as the instance) 298dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified column index is invalid 299dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws InvalidMatrixException if the vector dimension does not match one 300dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * instance column 301dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 302dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void setColumnVector(int column, FieldVector<T> vector) 303dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, InvalidMatrixException; 304dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 305dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 306dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the entries in row number <code>row</code> as an array. 307dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p> 308dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Row indices start at 0. A <code>MatrixIndexException</code> is thrown 309dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * unless <code>0 <= row < rowDimension.</code></p> 310dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 311dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row the row to be fetched 312dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return array of entries in the row 313dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified row index is not valid 314dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 315dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T[] getRow(int row) throws MatrixIndexException; 316dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 317dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 318dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Sets the entries in row number <code>row</code> 319dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as a row matrix. Row indices start at 0. 320dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 321dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row the row to be set 322dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param array row matrix (must have the same number of columns as the instance) 323dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified row index is invalid 324dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws InvalidMatrixException if the array size does not match one 325dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * instance row 326dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 327dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void setRow(int row, T[] array) 328dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, InvalidMatrixException; 329dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 330dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 331dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the entries in column number <code>col</code> as an array. 332dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p> 333dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Column indices start at 0. A <code>MatrixIndexException</code> is thrown 334dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * unless <code>0 <= column < columnDimension.</code></p> 335dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 336dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column the column to be fetched 337dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return array of entries in the column 338dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified column index is not valid 339dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 340dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T[] getColumn(int column) throws MatrixIndexException; 341dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 342dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 343dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Sets the entries in column number <code>column</code> 344dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * as a column matrix. Column indices start at 0. 345dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 346dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column the column to be set 347dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param array column array (must have the same number of rows as the instance) 348dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the specified column index is invalid 349dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws InvalidMatrixException if the array size does not match one 350dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * instance column 351dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 352dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void setColumn(int column, T[] array) 353dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, InvalidMatrixException; 354dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 355dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 356dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the entry in the specified row and column. 357dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p> 358dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Row and column indices start at 0 and must satisfy 359dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <ul> 360dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <li><code>0 <= row < rowDimension</code></li> 361dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <li><code> 0 <= column < columnDimension</code></li> 362dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * </ul> 363dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * otherwise a <code>MatrixIndexException</code> is thrown.</p> 364dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 365dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row row location of entry to be fetched 366dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column column location of entry to be fetched 367dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return matrix entry in row,column 368dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the row or column index is not valid 369dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 370dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T getEntry(int row, int column) throws MatrixIndexException; 371dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 372dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 373dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Set the entry in the specified row and column. 374dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p> 375dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Row and column indices start at 0 and must satisfy 376dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <ul> 377dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <li><code>0 <= row < rowDimension</code></li> 378dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <li><code> 0 <= column < columnDimension</code></li> 379dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * </ul> 380dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * otherwise a <code>MatrixIndexException</code> is thrown.</p> 381dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 382dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row row location of entry to be set 383dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column column location of entry to be set 384dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param value matrix entry to be set in row,column 385dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the row or column index is not valid 386dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 2.0 387dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 388dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void setEntry(int row, int column, T value) throws MatrixIndexException; 389dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 390dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 391dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Change an entry in the specified row and column. 392dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p> 393dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Row and column indices start at 0 and must satisfy 394dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <ul> 395dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <li><code>0 <= row < rowDimension</code></li> 396dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <li><code> 0 <= column < columnDimension</code></li> 397dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * </ul> 398dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * otherwise a <code>MatrixIndexException</code> is thrown.</p> 399dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 400dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row row location of entry to be set 401dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column column location of entry to be set 402dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param increment value to add to the current matrix entry in row,column 403dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the row or column index is not valid 404dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 2.0 405dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 406dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void addToEntry(int row, int column, T increment) throws MatrixIndexException; 407dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 408dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 409dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Change an entry in the specified row and column. 410dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p> 411dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Row and column indices start at 0 and must satisfy 412dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <ul> 413dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <li><code>0 <= row < rowDimension</code></li> 414dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <li><code> 0 <= column < columnDimension</code></li> 415dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * </ul> 416dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * otherwise a <code>MatrixIndexException</code> is thrown.</p> 417dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 418dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param row row location of entry to be set 419dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param column column location of entry to be set 420dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param factor multiplication factor for the current matrix entry in row,column 421dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws MatrixIndexException if the row or column index is not valid 422dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 2.0 423dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 424dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond void multiplyEntry(int row, int column, T factor) throws MatrixIndexException; 425dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 426dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 427dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the transpose of this matrix. 428dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 429dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return transpose matrix 430dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 431dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldMatrix<T> transpose(); 432dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 433dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 434dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the <a href="http://mathworld.wolfram.com/MatrixTrace.html"> 435dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * trace</a> of the matrix (the sum of the elements on the main diagonal). 436dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 437dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return trace 438dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws NonSquareMatrixException if the matrix is not square 439dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 440dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T getTrace() throws NonSquareMatrixException; 441dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 442dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 443dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the result of multiplying this by the vector <code>v</code>. 444dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 445dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param v the vector to operate on 446dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return this*v 447dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws IllegalArgumentException if columnDimension != v.size() 448dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 449dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T[] operate(T[] v) throws IllegalArgumentException; 450dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 451dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 452dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the result of multiplying this by the vector <code>v</code>. 453dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 454dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param v the vector to operate on 455dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return this*v 456dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws IllegalArgumentException if columnDimension != v.size() 457dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 458dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldVector<T> operate(FieldVector<T> v) throws IllegalArgumentException; 459dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 460dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 461dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the (row) vector result of premultiplying this by the vector <code>v</code>. 462dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 463dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param v the row vector to premultiply by 464dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return v*this 465dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws IllegalArgumentException if rowDimension != v.size() 466dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 467dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T[] preMultiply(T[] v) throws IllegalArgumentException; 468dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 469dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 470dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Returns the (row) vector result of premultiplying this by the vector <code>v</code>. 471dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * 472dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param v the row vector to premultiply by 473dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return v*this 474dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @throws IllegalArgumentException if rowDimension != v.size() 475dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 476dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond FieldVector<T> preMultiply(FieldVector<T> v) throws IllegalArgumentException; 477dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 478dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 479dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (and possibly change) all matrix entries in row order. 480dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Row order starts at upper left and iterating through all elements 481dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of a row from left to right before going to the leftmost element 482dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the next row.</p> 483dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 484dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 485dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 486dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 487dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 488dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 489dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 490dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 491dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 492dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 493dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 494dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 495dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 496dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixChangingVisitor#end()} at the end 497dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 498dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 499dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInRowOrder(FieldMatrixChangingVisitor<T> visitor) 500dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixVisitorException; 501dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 502dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 503dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (but don't change) all matrix entries in row order. 504dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Row order starts at upper left and iterating through all elements 505dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of a row from left to right before going to the leftmost element 506dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the next row.</p> 507dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 508dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 509dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 510dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 511dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 512dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 513dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 514dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 515dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 516dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 517dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 518dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 519dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 520dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixPreservingVisitor#end()} at the end 521dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 522dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 523dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInRowOrder(FieldMatrixPreservingVisitor<T> visitor) 524dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixVisitorException; 525dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 526dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 527dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (and possibly change) some matrix entries in row order. 528dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Row order starts at upper left and iterating through all elements 529dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of a row from left to right before going to the leftmost element 530dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the next row.</p> 531dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 532dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startRow Initial row index 533dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endRow Final row index (inclusive) 534dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startColumn Initial column index 535dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endColumn Final column index 536dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 537dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixIndexException if the indices are not valid 538dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 539dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 540dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 541dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 542dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 543dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 544dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 545dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 546dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 547dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 548dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 549dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixChangingVisitor#end()} at the end 550dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 551dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 552dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInRowOrder(FieldMatrixChangingVisitor<T> visitor, 553dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond int startRow, int endRow, int startColumn, int endColumn) 554dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, MatrixVisitorException; 555dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 556dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 557dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (but don't change) some matrix entries in row order. 558dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Row order starts at upper left and iterating through all elements 559dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of a row from left to right before going to the leftmost element 560dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the next row.</p> 561dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 562dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startRow Initial row index 563dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endRow Final row index (inclusive) 564dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startColumn Initial column index 565dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endColumn Final column index 566dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 567dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixIndexException if the indices are not valid 568dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 569dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 570dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 571dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 572dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 573dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 574dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 575dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 576dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 577dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 578dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 579dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixPreservingVisitor#end()} at the end 580dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 581dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 582dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInRowOrder(FieldMatrixPreservingVisitor<T> visitor, 583dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond int startRow, int endRow, int startColumn, int endColumn) 584dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, MatrixVisitorException; 585dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 586dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 587dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (and possibly change) all matrix entries in column order. 588dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Column order starts at upper left and iterating through all elements 589dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of a column from top to bottom before going to the topmost element 590dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the next column.</p> 591dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 592dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 593dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 594dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 595dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 596dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 597dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 598dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 599dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 600dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 601dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 602dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 603dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 604dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixChangingVisitor#end()} at the end 605dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 606dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 607dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInColumnOrder(FieldMatrixChangingVisitor<T> visitor) 608dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixVisitorException; 609dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 610dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 611dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (but don't change) all matrix entries in column order. 612dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Column order starts at upper left and iterating through all elements 613dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of a column from top to bottom before going to the topmost element 614dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the next column.</p> 615dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 616dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 617dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 618dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 619dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 620dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 621dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 622dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 623dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 624dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 625dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 626dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 627dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 628dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixPreservingVisitor#end()} at the end 629dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 630dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 631dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInColumnOrder(FieldMatrixPreservingVisitor<T> visitor) 632dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixVisitorException; 633dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 634dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 635dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (and possibly change) some matrix entries in column order. 636dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Column order starts at upper left and iterating through all elements 637dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of a column from top to bottom before going to the topmost element 638dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the next column.</p> 639dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 640dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startRow Initial row index 641dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endRow Final row index (inclusive) 642dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startColumn Initial column index 643dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endColumn Final column index 644dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 645dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixIndexException if the indices are not valid 646dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 647dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 648dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 649dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 650dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 651dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 652dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 653dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 654dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 655dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 656dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 657dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixChangingVisitor#end()} at the end 658dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 659dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 660dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInColumnOrder(FieldMatrixChangingVisitor<T> visitor, 661dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond int startRow, int endRow, int startColumn, int endColumn) 662dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, MatrixVisitorException; 663dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 664dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 665dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (but don't change) some matrix entries in column order. 666dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Column order starts at upper left and iterating through all elements 667dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of a column from top to bottom before going to the topmost element 668dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the next column.</p> 669dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 670dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startRow Initial row index 671dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endRow Final row index (inclusive) 672dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startColumn Initial column index 673dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endColumn Final column index 674dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 675dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixIndexException if the indices are not valid 676dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 677dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 678dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 679dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 680dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 681dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 682dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 683dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 684dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 685dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 686dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 687dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixPreservingVisitor#end()} at the end 688dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 689dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 690dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInColumnOrder(FieldMatrixPreservingVisitor<T> visitor, 691dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond int startRow, int endRow, int startColumn, int endColumn) 692dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, MatrixVisitorException; 693dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 694dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 695dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (and possibly change) all matrix entries using the fastest possible order. 696dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>The fastest walking order depends on the exact matrix class. It may be 697dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * different from traditional row or column orders.</p> 698dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 699dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 700dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 701dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 702dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 703dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 704dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 705dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 706dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 707dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 708dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 709dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 710dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 711dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixChangingVisitor#end()} at the end 712dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 713dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 714dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInOptimizedOrder(FieldMatrixChangingVisitor<T> visitor) 715dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixVisitorException; 716dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 717dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 718dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (but don't change) all matrix entries using the fastest possible order. 719dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>The fastest walking order depends on the exact matrix class. It may be 720dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * different from traditional row or column orders.</p> 721dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 722dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 723dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 724dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 725dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 726dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 727dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 728dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 729dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 730dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 731dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 732dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 733dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 734dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixPreservingVisitor#end()} at the end 735dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 736dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 737dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInOptimizedOrder(FieldMatrixPreservingVisitor<T> visitor) 738dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixVisitorException; 739dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 740dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 741dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (and possibly change) some matrix entries using the fastest possible order. 742dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>The fastest walking order depends on the exact matrix class. It may be 743dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * different from traditional row or column orders.</p> 744dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 745dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startRow Initial row index 746dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endRow Final row index (inclusive) 747dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startColumn Initial column index 748dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endColumn Final column index (inclusive) 749dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 750dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixIndexException if the indices are not valid 751dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 752dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 753dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 754dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 755dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 756dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 757dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 758dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 759dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 760dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 761dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int) 762dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixChangingVisitor#end()} at the end 763dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 764dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 765dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInOptimizedOrder(FieldMatrixChangingVisitor<T> visitor, 766dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond int startRow, int endRow, int startColumn, int endColumn) 767dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, MatrixVisitorException; 768dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 769dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond /** 770dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Visit (but don't change) some matrix entries using the fastest possible order. 771dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>The fastest walking order depends on the exact matrix class. It may be 772dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * different from traditional row or column orders.</p> 773dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param visitor visitor used to process all matrix entries 774dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startRow Initial row index 775dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endRow Final row index (inclusive) 776dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param startColumn Initial column index 777dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @param endColumn Final column index (inclusive) 778dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixVisitorException if the visitor cannot process an entry 779dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @exception MatrixIndexException if the indices are not valid 780dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor) 781dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor) 782dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) 783dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) 784dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor) 785dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor) 786dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int) 787dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int) 788dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor) 789dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixPreservingVisitor) 790dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see #walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int) 791dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @return the value returned by {@link FieldMatrixPreservingVisitor#end()} at the end 792dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of the walk 793dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */ 794dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond T walkInOptimizedOrder(FieldMatrixPreservingVisitor<T> visitor, 795dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond int startRow, int endRow, int startColumn, int endColumn) 796dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond throws MatrixIndexException, MatrixVisitorException; 797dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond 798dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond} 799