com.java4less.rchart
Class RMatrix

java.lang.Object
  |
  +--com.java4less.rchart.RMatrix

public class RMatrix
extends java.lang.Object

This is a matrix class. It allows operations like add, subtract, multiply, invert and transpose


Constructor Summary
RMatrix(double[][] d)
          constructor
RMatrix(int[][] d)
          constructor, using int[][]
RMatrix(int prows, int pcolumns)
          constructor
 
Method Summary
 RMatrix add(RMatrix m2)
          Return the matrix m = currentMatrix + m2
 double getValue(int r, int c)
          get value
 RMatrix invert()
           
 RMatrix mult(double v)
          Multiply this matrix by the specified value.
 RMatrix mult(RMatrix m2)
          Multiply this Matrix by m2 matrix
 void setValue(int r, int c, double v)
          set value
 RMatrix transpose()
          transpose this matrix
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RMatrix

public RMatrix(double[][] d)
constructor

RMatrix

public RMatrix(int[][] d)
constructor, using int[][]

RMatrix

public RMatrix(int prows,
               int pcolumns)
constructor
Method Detail

add

public RMatrix add(RMatrix m2)
Return the matrix m = currentMatrix + m2

invert

public RMatrix invert()

mult

public RMatrix mult(double v)
Multiply this matrix by the specified value.

setValue

public void setValue(int r,
                     int c,
                     double v)
set value

getValue

public double getValue(int r,
                       int c)
get value

mult

public RMatrix mult(RMatrix m2)
Multiply this Matrix by m2 matrix

transpose

public RMatrix transpose()
transpose this matrix