public class TwoDmatrix
extends java.lang.Object
This is a basic class to incorporate all the fundamentals to execute vector computations
| Constructor and Description |
|---|
TwoDmatrix() |
| Modifier and Type | Method and Description |
|---|---|
TwoDmatrix |
add2ddoubledata(double[][] data_matrix)
This method performs simple matrices' addition given that all size checks are passed
|
TwoDmatrix |
add2dmatrix(TwoDmatrix data_matrix)
This method performs simple matrices' addition given that all size checks are passed
|
double[][] |
add2dmatrixForDouble(TwoDmatrix data_matrix)
This method adds a matrix with a another matrix and returns the sum as double array [][]
|
double[][] |
add2DoubleForDouble(double[][] data_matrix)
This method adds a matrix with a another double array [][] and returns the sum as double array [][]
|
void |
create2dmatrxi(double[][] matrixnew)
Feed data to the matrix
|
void |
create2dmatrxisingle(double[] matrixnewsingle)
Feed data to the matrix from a single double array
|
void |
EqualMultiplyLamda(double lamda)
This method ,multiplies all entries of the principal matrix by a lamda factor.
|
void |
EqualsAddmatrix(double[][] data_matrix)
This method takes the first matrix and adds a double array [][]
|
void |
EqualsAddmatrix(TwoDmatrix data_matrix)
This method takes the first matrix and adds another matrix
|
void |
EqualsSubmatrix(double[][] data_matrix)
This method takes the first matrix and subtracts a double array [][]
|
void |
EqualsSubmatrix(TwoDmatrix data_matrix)
This method takes the first matrix and subtracts another matrix
|
int |
GetColumnDimension()
A simple getter method for the column dimension
|
double |
GetDataPoint(int row,
int col)
This method is used to extract specific data points from the matrix by requesting a specific column and specific row.
|
double[][] |
GetDoubleArray()
This method returns all the data in the matrix as a double array.
|
int |
GetRowDimension()
A simple getter method for the row dimension
|
double[] |
GetSingleColumn(int col)
returns a full column of the data matrix
|
double[] |
GetSingleRow(int row)
returns a full row of the data matrix
|
TwoDmatrix |
multiply(double[][] data_matrix)
this will be the basic multiplication method where a double array needs to be provided.
|
TwoDmatrix |
multiply(TwoDmatrix data_matrix)
this will be the basic multiplication method.
|
void |
MultiplyEqual(double[] data_matrix)
this will be the basic multiplication method where a single double array [] needs to be provided and the result will be set on the initial matrix.
|
void |
MultiplyEqual(double[][] data_matrix)
this will be the basic multiplication method where a double array [][] needs to be provided and the result will be set on the initial matrix.
|
void |
MultiplyEqual(TwoDmatrix data_matrix)
this will be the basic multiplication method where a TwoDmatrix needs to be provided and the result will be set on the initial matrix.
|
TwoDmatrix |
multiplylamdamatrix(double lamda)
This method ,multiplies all entries of a matrix by a lamda factor and returns a new matrix.
|
double[][] |
multiplylamddouble(double lamda)
This method ,multiplies all entries of a matrix by a lamda factor and returns a new double [][].
|
double[][] |
multiplywithdouble(double[][] data_matrix)
this will be the basic multiplication method where a double array needs to be provided and the result will also be a double array [][].
|
double[][] |
multiplywithdouble(TwoDmatrix data_matrix)
this will be the basic multiplication method where a TwoDmatrix needs to be provided and the result will also be a double array [][].
|
void |
setDataPoint(int row,
int col,
double value)
This method's purpose in to set a double value in the matrix's given entry.
|
void |
setDimension(int row_size,
int col_size)
|
TwoDmatrix |
sub2ddoubledata(double[][] data_matrix)
This method performs simple matrices' Subtraction given that all size checks are passed
|
TwoDmatrix |
sub2dmatrix(TwoDmatrix data_matrix)
This method performs simple matrices' Subtraction given that all size checks are passed
|
double[][] |
sub2dmatrixForDouble(TwoDmatrix data_matrix)
This method subtracts a matrix with a another matrix and returns the sum as double array [][]
|
double[][] |
sub2DoubleForDouble(double[][] data_matrix)
This method subtracts a matrix with a another double array [][] and returns the sum as double array [][]
|
void |
TransposeIt()
This method transposes the principal matrix
|
TwoDmatrix |
transposematrix()
This method transposes the principal matrix and returns a new TwoDmatrix
|
double[][] |
transposematrixdouble()
This method transposes the principal matrix and returns a new TwoDmatrix
|
public void create2dmatrxi(double[][] matrixnew)
Feed data to the matrix
matrixnew - : The new double array meant to fill the entries of the 2dmatrixpublic void create2dmatrxisingle(double[] matrixnewsingle)
Feed data to the matrix from a single double array
matrixnewsingle - : The new double array meant to fill the entries of the 2dmatrixpublic double GetDataPoint(int row,
int col)
This method is used to extract specific data points from the matrix by requesting a specific column and specific row.
row - : The row data pointcol - : the column data pointpublic void setDataPoint(int row,
int col,
double value)
This method's purpose in to set a double value in the matrix's given entry.
row - : The Row to add the new double value;col - : The Column to add the new double value;value - : The new double value to be added;public void setDimension(int row_size,
int col_size)
row_size - : The given Row Dimensioncol_size - : The given Column Dimensionpublic int GetRowDimension()
public int GetColumnDimension()
public double[][] GetDoubleArray()
This method returns all the data in the matrix as a double array.
public double[] GetSingleRow(int row)
returns a full row of the data matrix
row - : the Row to be provided as a double array []public double[] GetSingleColumn(int col)
returns a full column of the data matrix
col - : the Row to be provided as a double array []public TwoDmatrix add2ddoubledata(double[][] data_matrix)
This method performs simple matrices' addition given that all size checks are passed
data_matrix - : the new data to addpublic TwoDmatrix add2dmatrix(TwoDmatrix data_matrix)
This method performs simple matrices' addition given that all size checks are passed
data_matrix - : the new data to add as a matrixpublic double[][] add2dmatrixForDouble(TwoDmatrix data_matrix)
This method adds a matrix with a another matrix and returns the sum as double array [][]
data_matrix - : the matrix to be addedpublic double[][] add2DoubleForDouble(double[][] data_matrix)
This method adds a matrix with a another double array [][] and returns the sum as double array [][]
data_matrix - : the matrix to be addedpublic void EqualsAddmatrix(TwoDmatrix data_matrix)
This method takes the first matrix and adds another matrix
data_matrix - : the matrix to be addedpublic void EqualsAddmatrix(double[][] data_matrix)
This method takes the first matrix and adds a double array [][]
data_matrix - : the double array to be addedpublic TwoDmatrix sub2ddoubledata(double[][] data_matrix)
This method performs simple matrices' Subtraction given that all size checks are passed
data_matrix - : the new data to addpublic TwoDmatrix sub2dmatrix(TwoDmatrix data_matrix)
This method performs simple matrices' Subtraction given that all size checks are passed
data_matrix - : the new data to add as a matrixpublic double[][] sub2dmatrixForDouble(TwoDmatrix data_matrix)
This method subtracts a matrix with a another matrix and returns the sum as double array [][]
data_matrix - : the matrix to be addedpublic double[][] sub2DoubleForDouble(double[][] data_matrix)
This method subtracts a matrix with a another double array [][] and returns the sum as double array [][]
data_matrix - : the matrix to be addedpublic void EqualsSubmatrix(TwoDmatrix data_matrix)
This method takes the first matrix and subtracts another matrix
data_matrix - : the matrix to be addedpublic void EqualsSubmatrix(double[][] data_matrix)
This method takes the first matrix and subtracts a double array [][]
data_matrix - : the double array to be addedpublic TwoDmatrix multiply(TwoDmatrix data_matrix)
this will be the basic multiplication method.
data_matrix - : a TwoDmatrix that needs to be compatible with the primary onepublic TwoDmatrix multiply(double[][] data_matrix)
this will be the basic multiplication method where a double array needs to be provided.
data_matrix - : a double array [rows][columns] that needs to be compatible with the primary onepublic double[][] multiplywithdouble(double[][] data_matrix)
this will be the basic multiplication method where a double array needs to be provided and the result will also be a double array [][].
data_matrix - : a double array [rows][columns] that needs to be compatible with the primary onepublic double[][] multiplywithdouble(TwoDmatrix data_matrix)
this will be the basic multiplication method where a TwoDmatrix needs to be provided and the result will also be a double array [][].
data_matrix - : a TwoDmatrix that needs to be compatible with the primary onepublic void MultiplyEqual(TwoDmatrix data_matrix)
this will be the basic multiplication method where a TwoDmatrix needs to be provided and the result will be set on the initial matrix.
data_matrix - : a TwoDmatrix that needs to be compatible with the primary onepublic void MultiplyEqual(double[][] data_matrix)
this will be the basic multiplication method where a double array [][] needs to be provided and the result will be set on the initial matrix.
data_matrix - : a TwoDmatrix that needs to be compatible with the primary onepublic void MultiplyEqual(double[] data_matrix)
this will be the basic multiplication method where a single double array [] needs to be provided and the result will be set on the initial matrix.
data_matrix - : a TwoDmatrix that needs to be compatible with the primary onepublic TwoDmatrix multiplylamdamatrix(double lamda)
This method ,multiplies all entries of a matrix by a lamda factor and returns a new matrix.
lamda - : the double factor.public double[][] multiplylamddouble(double lamda)
This method ,multiplies all entries of a matrix by a lamda factor and returns a new double [][].
lamda - : the double factor.public void EqualMultiplyLamda(double lamda)
This method ,multiplies all entries of the principal matrix by a lamda factor.
lamda - : the double factor.public TwoDmatrix transposematrix()
This method transposes the principal matrix and returns a new TwoDmatrix
public double[][] transposematrixdouble()
This method transposes the principal matrix and returns a new TwoDmatrix
public void TransposeIt()
This method transposes the principal matrix