Java Doc for SparseMatrix.java in  » Science » jscience-4.3.1 » org » jscience » mathematics » vector » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » jscience 4.3.1 » org.jscience.mathematics.vector 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.jscience.mathematics.vector.SparseMatrix

SparseMatrix
final public class SparseMatrix extends Matrix (Code)

This class represents a matrix made of SparseVector sparsevectors (as rows). To create a sparse matrix made of column vectors the SparseMatrix.transpose method can be used. For example:[code] SparseVector column0 = SparseVector.valueOf(...); SparseVector column1 = SparseVector.valueOf(...); SparseMatrix M = SparseMatrix.valueOf(column0, column1).transpose(); [/code]

As for any concrete org.jscience.mathematics.structure.Structurestructure , this class is declared final (otherwise most operations would have to be overridden to return the appropriate type). Specialized dense matrix should sub-class Matrix directly. For example:[code] // Extension through composition. final class BandMatrix > extends Matrix { private SparseMatrix _value; ... public BandMatrix opposite() { // Returns the right type. return BandMatrix.valueOf(_value.opposite()); } ... }[/code]


author:
   Jean-Marie Dautelle
version:
   3.3, January 2, 2007


Field Summary
 int_n
     Holds the number of columns n or the number of rows m if transposed.
final  FastTable<SparseVector<F>>_rows
     Holds this matrix rows (or columns when transposed).
 boolean_transposed
     Indicates if this matrix is transposed (the rows are then the columns).
 F_zero
     Holds the zero.


Method Summary
public  SparseMatrix<F>adjoint()
    
public  Fcofactor(int i, int j)
    
public  SparseMatrix<F>copy()
    
public  Fdeterminant()
    
public  Fget(int i, int j)
    
public  SparseVector<F>getColumn(int j)
    
public  SparseVector<F>getDiagonal()
    
public  intgetNumberOfColumns()
    
public  intgetNumberOfRows()
    
public  SparseVector<F>getRow(int i)
    
public  FgetZero()
     Returns the value of the non-set elements for this sparse matrix.
public  SparseMatrix<F>inverse()
    
public  SparseMatrix<F>minus(Matrix<F> that)
    
static  SparseMatrix<F>newInstance(int n, F zero, boolean transposed)
    
public  SparseMatrix<F>opposite()
    
public  SparseMatrix<F>plus(Matrix<F> that)
    
public  Matrix<F>solve(Matrix<F> y)
    
public  SparseMatrix<F>tensor(Matrix<F> that)
    
public  SparseMatrix<F>times(F k)
    
public  SparseVector<F>times(Vector<F> v)
    
public  SparseMatrix<F>times(Matrix<F> that)
    
public  SparseMatrix<F>transpose()
    
public static  SparseMatrix<F>valueOf(Vector<F> diagonal, F zero)
     Returns the sparse square matrix having the specified diagonal vector.
public static  SparseMatrix<F>valueOf(SparseVector<F>... rows)
     Returns a sparse matrix holding the specified row vectors (column vectors if SparseMatrix.transpose transposed ).
Parameters:
  rows - the row vectors.
public static  SparseMatrix<F>valueOf(List<SparseVector<F>> rows)
     Returns a sparse matrix holding the row vectors from the specified collection (column vectors if SparseMatrix.transpose transposed ).
Parameters:
  rows - the list of row vectors.
public static  SparseMatrix<F>valueOf(Matrix<F> that, F zero)
     Returns a sparse matrix equivalent to the specified matrix but with the zero elements removed using the default object equality comparator.
Parameters:
  that - the matrix to convert.
Parameters:
  zero - the zero element for the sparse vector to return.
public static  SparseMatrix<F>valueOf(Matrix<F> that, F zero, FastComparator<? super F> comparator)
     Returns a sparse matrix equivalent to the specified matrix but with the zero elements removed using the specified object equality comparator.
Parameters:
  that - the matrix to convert.
Parameters:
  zero - the zero element for the sparse vector to return.
Parameters:
  comparator - the comparator used to determinate zero equality.
public  SparseVector<F>vectorization()
    

Field Detail
_n
int _n(Code)
Holds the number of columns n or the number of rows m if transposed.



_rows
final FastTable<SparseVector<F>> _rows(Code)
Holds this matrix rows (or columns when transposed).



_transposed
boolean _transposed(Code)
Indicates if this matrix is transposed (the rows are then the columns).



_zero
F _zero(Code)
Holds the zero.





Method Detail
adjoint
public SparseMatrix<F> adjoint()(Code)



cofactor
public F cofactor(int i, int j)(Code)



copy
public SparseMatrix<F> copy()(Code)



determinant
public F determinant()(Code)



get
public F get(int i, int j)(Code)



getColumn
public SparseVector<F> getColumn(int j)(Code)



getDiagonal
public SparseVector<F> getDiagonal()(Code)



getNumberOfColumns
public int getNumberOfColumns()(Code)



getNumberOfRows
public int getNumberOfRows()(Code)



getRow
public SparseVector<F> getRow(int i)(Code)



getZero
public F getZero()(Code)
Returns the value of the non-set elements for this sparse matrix. the element corresponding to zero.



inverse
public SparseMatrix<F> inverse()(Code)



minus
public SparseMatrix<F> minus(Matrix<F> that)(Code)



newInstance
static SparseMatrix<F> newInstance(int n, F zero, boolean transposed)(Code)



opposite
public SparseMatrix<F> opposite()(Code)



plus
public SparseMatrix<F> plus(Matrix<F> that)(Code)



solve
public Matrix<F> solve(Matrix<F> y)(Code)



tensor
public SparseMatrix<F> tensor(Matrix<F> that)(Code)



times
public SparseMatrix<F> times(F k)(Code)



times
public SparseVector<F> times(Vector<F> v)(Code)



times
public SparseMatrix<F> times(Matrix<F> that)(Code)



transpose
public SparseMatrix<F> transpose()(Code)



valueOf
public static SparseMatrix<F> valueOf(Vector<F> diagonal, F zero)(Code)
Returns the sparse square matrix having the specified diagonal vector. This method is typically used to create an identity matrix. For example:[code] SparseMatrix IDENTITY = Matrix.valueOf( DenseVector.valueOf({Real.ONE, Real.ONE, Real.ONE}), Real.ZERO); [/code]
Parameters:
  diagonal - the diagonal vector.
Parameters:
  zero - value of non-diagonal elements. a square matrix with diagonal on the diagonal andzero elsewhere.



valueOf
public static SparseMatrix<F> valueOf(SparseVector<F>... rows)(Code)
Returns a sparse matrix holding the specified row vectors (column vectors if SparseMatrix.transpose transposed ).
Parameters:
  rows - the row vectors. the matrix having the specified rows.
throws:
  DimensionException - if the rows do not have the same dimension.



valueOf
public static SparseMatrix<F> valueOf(List<SparseVector<F>> rows)(Code)
Returns a sparse matrix holding the row vectors from the specified collection (column vectors if SparseMatrix.transpose transposed ).
Parameters:
  rows - the list of row vectors. the matrix having the specified rows.
throws:
  DimensionException - if the rows do not have the same dimension.



valueOf
public static SparseMatrix<F> valueOf(Matrix<F> that, F zero)(Code)
Returns a sparse matrix equivalent to the specified matrix but with the zero elements removed using the default object equality comparator.
Parameters:
  that - the matrix to convert.
Parameters:
  zero - the zero element for the sparse vector to return. SparseMatrix.valueOf(that, zero, FastComparator.DEFAULT) or a dense matrix holding the same elements



valueOf
public static SparseMatrix<F> valueOf(Matrix<F> that, F zero, FastComparator<? super F> comparator)(Code)
Returns a sparse matrix equivalent to the specified matrix but with the zero elements removed using the specified object equality comparator.
Parameters:
  that - the matrix to convert.
Parameters:
  zero - the zero element for the sparse vector to return.
Parameters:
  comparator - the comparator used to determinate zero equality. that or a dense matrix holding the same elementsas the specified matrix.



vectorization
public SparseVector<F> vectorization()(Code)



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.