Java API By Example, From Geeks To Geeks.

# Java > Open Source Codes > org > jscience > mathematics > vectors > DenseMatrix

 `1 /*2  * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences.3  * Copyright (C) 2006 - JScience (http://jscience.org/)4  * All rights reserved.5  * 6  * Permission to use, copy, modify, and distribute this software is7  * freely granted, provided that this notice is preserved.8  */9 package org.jscience.mathematics.vectors;10 11 import java.util.Iterator ;12 import java.util.List ;13 14 import javolution.context.ConcurrentContext;15 import javolution.lang.MathLib;16 import javolution.util.FastTable;17 import javolution.util.Index;18 19 import org.jscience.mathematics.structures.Field;20 21 /**22  *

This class represents a matrix made of {@link DenseVector dense23  * vectors} (as rows). To create a dense matrix made of column vectors the 24  * {@link #transpose} method can be used. 25  * For example:[code]26  * DenseVector column0 = DenseVector.valueOf(...);27  * DenseVector column1 = DenseVector.valueOf(...);28  * DenseMatrix M = DenseMatrix.valueOf(column0, column1).transpose();29  * [/code]

30  *

As for any concrete {@link org.jscience.mathematics.structures.Structure31  * structure}, this class is declared final (otherwise most32  * operations would have to be overridden to return the appropriate type).33  * Specialized dense matrix should sub-class {@link Matrix} directly.34  * For example:[code]35  * // Extension through composition.36  * final class TriangularMatrix > extends Matrix {37  * private DenseMatrix _value; // Possible implementation.38  * ...39  * public TriangularMatrix opposite() { // Returns the right type.40  * return TriangularMatrix.valueOf(_value.opposite());41  * }42  * ...43  * }[/code]44  *