FEJDMath
Class SkyLine

java.lang.Object
  extended byFEJDMath.SkyLine

public class SkyLine
extends java.lang.Object

Uses to implement the skyline storage method for matrices, ie in a column, the zero elements above the first non zero element are not stored in the matrix. A pointer vector is used to point to the diagonal elements


Field Summary
private  java.util.ArrayList K
          The coefficients of the matrix
private  int[] Lk
          The pointer vector
private  int size
          The size of the matrix
 
Constructor Summary
SkyLine(int n)
           
 
Method Summary
 void computeLLT(SkyLine S)
          Modifies the argument S so it contains the upper part of the decomposition of the current matrix
 double get(int i, int j)
          Returns the coefficient (i,j) of the matrix (1 based as usual in math)
private  int getIndice(int i, int j)
          Returns the index in the vector of the preceding diagonal element
 int getSize()
          Returns the size of shape the matrix
 int getVectorSize()
          Returns the size of the matrix
 double[] linSolve(double[] v)
          Returns x the solution of the following problem : this * x = v
 void set(int i, int j, double v)
          Sets the value of the coefficient (i,j) of the matrix to v (1 based as usual in math)
private  double[] solveTinf(double[] f)
          Returns the solution of the following problem : this * sol = f with this considered as lower-triangular (but still stored the same way)
private  double[] solveTsup(double[] f)
          Returns the solution of the following problem : this * sol = f with this considered as upper-triangular
 java.lang.String toString()
          Returns the matrix in its usual mathematical format (can be very long for large matrices)
 java.lang.String toString2()
          Returns the items contained in the pointer and those contained in the ArrayList, for debugging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

size

private int size
The size of the matrix


K

private java.util.ArrayList K
The coefficients of the matrix


Lk

private int[] Lk
The pointer vector

Constructor Detail

SkyLine

public SkyLine(int n)
Parameters:
n - size of the new skyline matrix
Method Detail

linSolve

public double[] linSolve(double[] v)
Returns x the solution of the following problem : this * x = v


getSize

public int getSize()
Returns the size of shape the matrix


getVectorSize

public int getVectorSize()
Returns the size of the matrix


get

public double get(int i,
                  int j)
Returns the coefficient (i,j) of the matrix (1 based as usual in math)


set

public void set(int i,
                int j,
                double v)
Sets the value of the coefficient (i,j) of the matrix to v (1 based as usual in math)


getIndice

private int getIndice(int i,
                      int j)
Returns the index in the vector of the preceding diagonal element


toString

public java.lang.String toString()
Returns the matrix in its usual mathematical format (can be very long for large matrices)


toString2

public java.lang.String toString2()
Returns the items contained in the pointer and those contained in the ArrayList, for debugging


computeLLT

public void computeLLT(SkyLine S)
Modifies the argument S so it contains the upper part of the decomposition of the current matrix


solveTsup

private double[] solveTsup(double[] f)
Returns the solution of the following problem : this * sol = f with this considered as upper-triangular


solveTinf

private double[] solveTinf(double[] f)
Returns the solution of the following problem : this * sol = f with this considered as lower-triangular (but still stored the same way)