Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*##% NuitonMatrix
* Copyright (C) 2004 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* . ##%*/
package org.nuiton.math.matrix;
import java.io.Serializable;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
/**
* Pour l'instant une sous matrice a obligatoirement le meme nombre de dimension
* que la matrice qu'elle contient. Elle permet juste de reduire le nombre
* d'element d'une dimension.
*
* Created: 29 oct. 2004
*
* @author Benjamin Poussin
* @version $Revision: 187 $
*
* Mise a jour: $Date: 2009-10-16 19:17:29 +0200 (ven., 16 oct. 2009) $
* par : $Author: tchemit $
*/
public class SubMatrix extends AbstractMatrixND { // SubMatrix
/** serialVersionUID. */
private static final long serialVersionUID = 4092234115185263506L;
protected MatrixND matrix = null;
protected DimensionConverter converter = null;
public SubMatrix(MatrixND matrix, int dim, int start, int nb) {
super(matrix.getFactory(), matrix.getName(), matrix.getSemantics(),
matrix.getDimensionNames());
this.matrix = matrix;
converter = new ShiftConverter(dim, start, nb);
setSemantic(dim, getSemantic(dim).subList(start, start + nb));
getDim()[dim] = nb;
}
public SubMatrix(MatrixND matrix, int dim, int[] elem) {
super(matrix.getFactory(), matrix.getName(), matrix.getSemantics(),
matrix.getDimensionNames());
this.matrix = matrix;
converter = new MappingConverter(dim, elem);
List> oldSemantic = getSemantic(dim);
List