Results 1 to 4 of 4

Thread: When do we use Matrix class in java

  1. #1
    Join Date
    Feb 2009
    Posts
    62

    When do we use Matrix class in java

    I am reading about the Matrix class in java, but not sure about its concept, and therefore can anyone tell me when do we use Matrix class in java programming, second requirement is to how to read from the Matrix at the same time and the last requirement is to set the alignment to the records.

    Thanks for your help

  2. #2
    Join Date
    Feb 2008
    Posts
    129

    Re: How Matrix class used in java

    JAMA is also known as Java Matrix and it is basic linear algebra package for Java.The Java Matrix Class provides the fundamental operations of numerical linear algebra. Various constructors create Matrices from two dimensional arrays of double precision floating point numbers. Various "gets" and "sets" provide access to submatrices and matrix elements. Several methods implement basic matrix arithmetic, including matrix addition and multiplication, matrix norms, and element-by-element array operations. Five fundamental matrix decompositions, which consist of pairs or triples of matrices, permutation vectors, and the like, produce results in five decomposition classes.

  3. #3
    Join Date
    Jan 2009
    Posts
    150

    Re: When do we use Matrix class in java

    Following are the rules that we need to follow while applying Matrix in Java.

    Rule 1 : The matrix text file values (contents of the file) should be space/tab limited
    For exa- 3 1 -5 -3 4

    Rule 2 : The matrix text file should contain only integers
    exa- 14,27,1

    Rule 3 : The file should start and end with the matrix values, should not have anything else.

    3 4 1 -4 -8
    1 4 -2 7 -1

  4. #4
    Join Date
    Feb 2009
    Posts
    117

    Re: When do we use Matrix class in java

    Example of Use. The following simple example solves a 3x3 linear system Ax=b and computes the
    norm of the residual.

    double[][] array = {{1.,2.,3},{4.,5.,6.},{7.,8.,10.}};
    Matrix A = new Matrix(array);
    Matrix b = Matrix.random(3,1);
    Matrix x = A.solve(b);
    Matrix Residual = A.times(x).minus(b);
    double rnorm = Residual.normInf();

Similar Threads

  1. Replies: 4
    Last Post: 25-09-2010, 05:11 PM
  2. Converting java class to java bean class
    By Ucchal in forum Software Development
    Replies: 6
    Last Post: 09-08-2010, 10:24 AM
  3. What is the use of Frame class in java?
    By Truster in forum Software Development
    Replies: 5
    Last Post: 25-02-2010, 11:16 AM
  4. What does anonymous class mean in java?
    By Khan Baba in forum Software Development
    Replies: 5
    Last Post: 01-02-2010, 02:49 PM
  5. Java Programming Language Basics: Reflection Basics and Class Class
    By mayuri_gunjan in forum Guides & Tutorials
    Replies: 6
    Last Post: 29-08-2005, 12:04 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,544,581.32570 seconds with 17 queries