jsat.linear
Class RowColumnOps
- java.lang.Object
-
- jsat.linear.RowColumnOps
-
public class RowColumnOps extends java.lang.ObjectA collection of mutable Row and Column operations that can be performed on matrices.
-
-
Constructor Summary
Constructors Constructor and Description RowColumnOps()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidaddCol(Matrix A, int j, double c)Updates the values of column j in the given matrix to be A[:,j] = A[:,j]+ cstatic voidaddCol(Matrix A, int j, int start, int to, double c)Updates the values of column j in the given matrix to be A[:,j] = A[:,j]+ cstatic voidaddDiag(Matrix A, int start, int to, double c)Updates the values along the main diagonal of the matrix by adding a constant to themstatic voidaddMultCol(Matrix A, int j, int start, int to, double t, double[] c)Updates the values of column j in the given matrix to be A[:,j] = A[:,j]+c[:]*t.
The Matrix A and array c do not need to have the same dimensions, so long as they both have indices in the given range.static voidaddMultCol(Matrix A, int j, int start, int to, double t, Vec c)Updates the values of column j in the given matrix to be A[:,j] = A[:,j]+c[:]*t.
The Matrix A and vector c do not need to have the same dimensions, so long as they both have indices in the given range.static voidaddMultRow(Matrix A, int i, int start, int to, double t, double[] c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:]+c[:]*t.
The Matrix A and array c do not need to have the same dimensions, so long as they both have indices in the given range.static voidaddMultRow(Matrix A, int i, int start, int to, double t, Vec c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:]+c[:]*t.
The Matrix A and array c do not need to have the same dimensions, so long as they both have indices in the given range.static voidaddRow(Matrix A, int i, double c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:]+ cstatic voidaddRow(Matrix A, int i, int start, int to, double c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:]+ cstatic voiddivCol(Matrix A, int j, double c)Updates the values of column j in the given matrix to be A[:,j] = A[:,j]/cstatic voiddivCol(Matrix A, int j, int start, int to, double c)Updates the values of column j in the given matrix to be A[:,j] = A[:,j]/cstatic voiddivCol(Matrix A, int j, int start, int to, double[] c)Updates the values of column j in the given matrix to be A[:,j] = A[:,j]/c[j].
The Matrix A and array c do not need to have the same dimensions, so long as they both have indices in the given range.static voiddivCol(Matrix A, int j, int start, int to, Vec c)Updates the values of column j in the given matrix to be A[:,j] = A[:,j]/c[j].
The Matrix A and vector c do not need to have the same dimensions, so long as they both have indices in the given range.static voiddivRow(Matrix A, int i, double c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:] / cstatic voiddivRow(Matrix A, int i, int start, int to, double c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:] / cstatic voidfillCol(Matrix A, int j, int from, int to, double val)Fills the values in a column of the matrixstatic voidfillRow(Matrix A, int i, int from, int to, double val)Fills the values in a row of the matrixstatic voidmultCol(Matrix A, int j, double c)Updates the values of column j in the given matrix to be A[:,j] = A[:,j]* cstatic voidmultCol(Matrix A, int j, int start, int to, double c)Updates the values of column j in the given matrix to be A[:,j] = A[:,j]* cstatic voidmultRow(Matrix A, int i, double c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:] * cstatic voidmultRow(Matrix A, int i, double[] c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:] .* c[i]static voidmultRow(Matrix A, int i, int start, int to, double c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:] * cstatic voidmultRow(Matrix A, int i, int start, int to, double[] c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:] .* c[i] The Matrix A and array c do not need to have the same dimensions, so long as they both have indices in the given range.static voidmultRow(Matrix A, int i, int start, int to, Vec c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:] .* c[i] The Matrix A and vector c do not need to have the same dimensions, so long as they both have indices in the given range.static voidmultRow(Matrix A, int i, Vec c)Updates the values of row i in the given matrix to be A[i,:] = A[i,:] .* c[i] The Matrix A and vector c do not need to have the same dimensions, so long as they both have indices in the given range.static voidswapCol(Matrix A, int j, int k)Swaps the columns j and k in the given matrix.static voidswapCol(Matrix A, int j, int k, int start, int to)Swaps the columns j and k in the given matrix.static voidswapRow(Matrix A, int j, int k)Swaps the columns j and k in the given matrix.static voidswapRow(Matrix A, int j, int k, int start, int to)Swaps the rows j and k in the given matrix.
-
-
-
Method Detail
-
addDiag
public static void addDiag(Matrix A, int start, int to, double c)
Updates the values along the main diagonal of the matrix by adding a constant to them- Parameters:
A- the matrix to perform the update onstart- the first index of the diagonals to update (inclusive)to- the last index of the diagonals to update (exclusive)c- the constant to add to the diagonal
-
addRow
public static void addRow(Matrix A, int i, int start, int to, double c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:]+ c- Parameters:
A- the matrix to perform he update oni- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)c- the constant to add to each element
-
addRow
public static void addRow(Matrix A, int i, double c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:]+ c- Parameters:
A- the matrix to perform he update oni- the row to updatec- the constant to add to each element
-
multRow
public static void multRow(Matrix A, int i, int start, int to, double c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:] * c- Parameters:
A- the matrix to perform he update oni- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)c- the constant to multiply each element by
-
multRow
public static void multRow(Matrix A, int i, double c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:] * c- Parameters:
A- the matrix to perform he update oni- the row to updatec- the constant to multiply each element by
-
multRow
public static void multRow(Matrix A, int i, int start, int to, Vec c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:] .* c[i] The Matrix A and vector c do not need to have the same dimensions, so long as they both have indices in the given range.- Parameters:
A- the matrix to perform he update oni- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)c- the vector of values to multiple the elements of A by
-
multRow
public static void multRow(Matrix A, int i, Vec c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:] .* c[i] The Matrix A and vector c do not need to have the same dimensions, so long as they both have indices in the given range.- Parameters:
A- the matrix to perform he update oni- the row to updatec- the vector of values to multiple the elements of A by
-
multRow
public static void multRow(Matrix A, int i, int start, int to, double[] c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:] .* c[i] The Matrix A and array c do not need to have the same dimensions, so long as they both have indices in the given range.- Parameters:
A- the matrix to perform he update oni- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)c- the array of values to multiple the elements of A by
-
multRow
public static void multRow(Matrix A, int i, double[] c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:] .* c[i]- Parameters:
A- the matrix to perform he update oni- the row to updatec- the array of values to multiple the elements of A by
-
divRow
public static void divRow(Matrix A, int i, int start, int to, double c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:] / c- Parameters:
A- the matrix to perform he update oni- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)c- the constant to divide each element by
-
divRow
public static void divRow(Matrix A, int i, double c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:] / c- Parameters:
A- the matrix to perform he update oni- the row to updatec- the constant to divide each element by
-
addCol
public static void addCol(Matrix A, int j, int start, int to, double c)
Updates the values of column j in the given matrix to be A[:,j] = A[:,j]+ c- Parameters:
A- the matrix to perform he update onj- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)c- the constant to add to each element
-
addCol
public static void addCol(Matrix A, int j, double c)
Updates the values of column j in the given matrix to be A[:,j] = A[:,j]+ c- Parameters:
A- the matrix to perform he update onj- the row to updatec- the constant to add to each element
-
multCol
public static void multCol(Matrix A, int j, int start, int to, double c)
Updates the values of column j in the given matrix to be A[:,j] = A[:,j]* c- Parameters:
A- the matrix to perform he update onj- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)c- the constant to multiply each element by
-
multCol
public static void multCol(Matrix A, int j, double c)
Updates the values of column j in the given matrix to be A[:,j] = A[:,j]* c- Parameters:
A- the matrix to perform he update onj- the row to updatec- the constant to multiply each element by
-
divCol
public static void divCol(Matrix A, int j, int start, int to, double c)
Updates the values of column j in the given matrix to be A[:,j] = A[:,j]/c- Parameters:
A- the matrix to perform he update onj- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)c- the constant to divide each element by
-
divCol
public static void divCol(Matrix A, int j, double c)
Updates the values of column j in the given matrix to be A[:,j] = A[:,j]/c- Parameters:
A- the matrix to perform he update onj- the row to updatec- the constant to divide each element by
-
divCol
public static void divCol(Matrix A, int j, int start, int to, Vec c)
Updates the values of column j in the given matrix to be A[:,j] = A[:,j]/c[j].
The Matrix A and vector c do not need to have the same dimensions, so long as they both have indices in the given range.- Parameters:
A- the matrix to perform he update onj- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)c- the vector of values to pairwise divide the elements of A by
-
divCol
public static void divCol(Matrix A, int j, int start, int to, double[] c)
Updates the values of column j in the given matrix to be A[:,j] = A[:,j]/c[j].
The Matrix A and array c do not need to have the same dimensions, so long as they both have indices in the given range.- Parameters:
A- the matrix to perform he update onj- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)c- the array of values to pairwise divide the elements of A by
-
addMultRow
public static void addMultRow(Matrix A, int i, int start, int to, double t, double[] c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:]+c[:]*t.
The Matrix A and array c do not need to have the same dimensions, so long as they both have indices in the given range.- Parameters:
A- the matrix to perform he update oni- the row to updatestart- the first index of the column to update from (inclusive)to- the last index of the column to update (exclusive)t- the constant to multiply all elements of c byc- the array of values to pairwise multiply by t before adding to the elements of A
-
addMultRow
public static void addMultRow(Matrix A, int i, int start, int to, double t, Vec c)
Updates the values of row i in the given matrix to be A[i,:] = A[i,:]+c[:]*t.
The Matrix A and array c do not need to have the same dimensions, so long as they both have indices in the given range.- Parameters:
A- the matrix to perform he update oni- the row to updatestart- the first index of the column to update from (inclusive)to- the last index of the column to update (exclusive)t- the constant to multiply all elements of c byc- the array of values to pairwise multiply by t before adding to the elements of A
-
addMultCol
public static void addMultCol(Matrix A, int j, int start, int to, double t, double[] c)
Updates the values of column j in the given matrix to be A[:,j] = A[:,j]+c[:]*t.
The Matrix A and array c do not need to have the same dimensions, so long as they both have indices in the given range.- Parameters:
A- the matrix to perform he update onj- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)t- the constant to multiply all elements of c byc- the array of values to pairwise multiply by t before adding to the elements of A
-
addMultCol
public static void addMultCol(Matrix A, int j, int start, int to, double t, Vec c)
Updates the values of column j in the given matrix to be A[:,j] = A[:,j]+c[:]*t.
The Matrix A and vector c do not need to have the same dimensions, so long as they both have indices in the given range.- Parameters:
A- the matrix to perform he update onj- the row to updatestart- the first index of the row to update from (inclusive)to- the last index of the row to update (exclusive)t- the constant to multiply all elements of c byc- the vector of values to pairwise multiply by t before adding to the elements of A
-
swapCol
public static void swapCol(Matrix A, int j, int k, int start, int to)
Swaps the columns j and k in the given matrix.- Parameters:
A- the matrix to perform he update onj- the first column to swapk- the second column to swapstart- the first row that will be included in the swap (inclusive)to- the last row to be included in the swap (exclusive)
-
swapCol
public static void swapCol(Matrix A, int j, int k)
Swaps the columns j and k in the given matrix.- Parameters:
A- the matrix to perform he update onj- the first column to swapk- the second column to swap
-
swapRow
public static void swapRow(Matrix A, int j, int k, int start, int to)
Swaps the rows j and k in the given matrix.- Parameters:
A- the matrix to perform he update onj- the first row to swapk- the second row to swapstart- the first column that will be included in the swap (inclusive)to- the last column to be included in the swap (exclusive)
-
swapRow
public static void swapRow(Matrix A, int j, int k)
Swaps the columns j and k in the given matrix.- Parameters:
A- the matrix to perform he update onj- the first column to swapk- the second column to swap
-
fillRow
public static void fillRow(Matrix A, int i, int from, int to, double val)
Fills the values in a row of the matrix- Parameters:
A- the matrix in questioni- the row of the matrixfrom- the first column index to fill (inclusive)to- the last column index to fill (exclusive)val- the value to fill into the matrix
-
fillCol
public static void fillCol(Matrix A, int j, int from, int to, double val)
Fills the values in a column of the matrix- Parameters:
A- the matrix in questionj- the column of the matrixfrom- the first row index to fill (inclusive)to- the last row index to fill (exclusive)val- the value to fill into the matrix
-
-
DataMelt 3.0 © DataMelt by jWork.ORG