Divide the row from this column position by this value

@param matrix
the matrix to modify
@param aRow
the row to process
@param fromCol
starting from column
@param value
the value to divide
169076
public static void divideRowBy(Matrix matrix, long aRow, long fromCol, double value) {
		long cols = matrix.getColumnCount();
		for (long col = fromCol; col < cols; col++) {
			matrix.setAsDouble(matrix.getAsDouble(aRow, col) / value, aRow, col);
		}
	}
109927
public static void multCol(Matrix A, int j, double c)
    {
        multCol(A, j, 0, A.rows(), c);
    }
1170117
public static void multRows(double[] diag, int offset, DMatrixSparseCSC A) {
        if( diag.length < A.numRows )
            throw new IllegalArgumentException("Array is too small. "+diag.length+" < "+A.numCols);

        for (int i = 0; i < A.nz_length; i++) {
            A.nz_values[i] *= diag[A.nz_rows[i+offset]];
        }
    }
340962
protected void convertToColumnMajor(ZMatrixRMaj A) {
        for( int x = 0; x < numCols; x++ ) {
            double colQ[] = dataQR[x];
            int indexCol = 0;
            for( int y = 0; y < numRows; y++ ) {
                int index = (y*numCols+x)*2;
                colQ[indexCol++] = A.data[index];
                colQ[indexCol++] = A.data[index+1];
            }
        }
    }
906700
private void justifyRows(final int from, final int to) {
		// Sometimes the DefaultTableModel is subclassed
		// instead of the AbstractTableModel by mistake.
		// Set the number of rows for the case when getRowCount
		// is overridden.
		this.dataVector.setSize(getRowCount());

		for (int i = from; i < to; i++) {
			if (this.dataVector.elementAt(i) == null) {
				this.dataVector.setElementAt(new Vector(), i);
			}
			// ((Vector)dataVector.elementAt(i)).setSize(getColumnCount());
		}
	}
796322
public static void matrixFill(Object[][] matrix, Object val) {
        if (matrix != null) {
            for (int i = 0, n = matrix.length; i < n; i++) {
                if (matrix[i] != null) {
                    for (int j = 0, m = matrix[i].length; j < m; j++) {
                        matrix[i][j] = val;
                    }
                }
            }
        }
    }
680417
public void setRow(RowVector rv, int r) throws MatrixException
    {
        if ((r < 0) || (r >= nRows)) {
            throw new MatrixException(MatrixException.INVALID_INDEX);
        }
        if (nCols != rv.nCols) {
            throw new MatrixException(
                                MatrixException.INVALID_DIMENSIONS);
        }

        for (int c = 0; c < nCols; ++c) {
            this.values[r][c] = rv.values[0][c];
        }
    }
1089916
public static void setMatrix(final double[][] m1, final int[] r, final int[] c, final double[][] m2) {
    for(int i = 0; i < r.length; i++) {
      final double[] row1 = m1[r[i]], row2 = m2[i];
      for(int j = 0; j < c.length; j++) {
        row1[c[j]] = row2[j];
      }
    }
  }
263940
public void copyTo(Matrix other)
    {
        if (this.rows() != other.rows() || this.cols() != other.cols())
            throw new ArithmeticException("Matrices are not of the same dimension");
        for(int i = 0; i < rows(); i++)
            this.getRowView(i).copyTo(other.getRowView(i));
    }
912904
public static void multRow(Matrix A, int i, double[] c)
    {
        if(A.cols() != c.length)
            throw new ArithmeticException("Can not perform row update, length miss match " + A.cols() + " and " + c.length);
        multRow(A, i, 0, c.length, c);
    }
462156
public static DenseMatrix matrix(int nrows, int ncols, double value) {
        if (nlmatrixOnes != null) {
            try {
                return (DenseMatrix) nlmatrixOnes.newInstance(nrows, ncols, value);
            } catch (Exception e) {
                logger.error("Failed to call NLMatrix(int, int, double): {}", e);
            }
        }

        return new JMatrix(nrows, ncols, value);
    }
179082
public static DMatrix2 extractRow( DMatrix2x2 a , int row , DMatrix2 out ) {
        if( out == null) out = new DMatrix2();
        switch( row ) {
            case 0:
                out.a1 = a.a11;
                out.a2 = a.a12;
            break;
            case 1:
                out.a1 = a.a21;
                out.a2 = a.a22;
            break;
            default:
                throw new IllegalArgumentException("Out of bounds row.  row = "+row);
        }
        return out;
    }
977053
public static void addRowTimes(Matrix matrix, long diag, long fromCol, long row, double factor) {
		long cols = matrix.getColumnCount();
		for (long col = fromCol; col < cols; col++) {
			matrix.setAsDouble(
					matrix.getAsDouble(row, col) - factor * matrix.getAsDouble(diag, col), row, col);
		}
	}
941872
public static boolean canSwapCols(Matrix matrix, int col1, int col2, int row1) {
		boolean response = true;
		for (int row = row1 + 1; row < matrix.getRowCount(); ++row) {
			if (0 == matrix.getAsDouble(row, col1)) {
				if (0 != matrix.getAsDouble(row, col2)) {
					response = false;
					break;
				}
			}
		}
		return response;
	}
126725
public static void addRowTimes(double[][] matrix, int diag, int fromCol, int row, double factor) {
		int cols = matrix[0].length;
		double[] d = matrix[diag];
		double[] r = matrix[row];
		for (int col = fromCol; col < cols; col++) {
			r[col] -= factor * d[col];
		}
	}
618588
public static DMatrix4 extractRow( DMatrix4x4 a , int row , DMatrix4 out ) {
        if( out == null) out = new DMatrix4();
        switch( row ) {
            case 0:
                out.a1 = a.a11;
                out.a2 = a.a12;
                out.a3 = a.a13;
                out.a4 = a.a14;
            break;
            case 1:
                out.a1 = a.a21;
                out.a2 = a.a22;
                out.a3 = a.a23;
                out.a4 = a.a24;
            break;
            case 2:
                out.a1 = a.a31;
                out.a2 = a.a32;
                out.a3 = a.a33;
                out.a4 = a.a34;
            break;
            case 3:
                out.a1 = a.a41;
                out.a2 = a.a42;
                out.a3 = a.a43;
                out.a4 = a.a44;
            break;
            default:
                throw new IllegalArgumentException("Out of bounds row.  row = "+row);
        }
        return out;
    }
40140
public static void divideElementsCol(final int blockLength ,
                                         final DSubmatrixD1 Y , final int col , final double val ) {
        final int width = Math.min(blockLength,Y.col1-Y.col0);

        final double dataY[] = Y.original.data;

        for( int i = Y.row0; i < Y.row1; i += blockLength ) {
            int height = Math.min( blockLength , Y.row1 - i );

            int index = i*Y.original.numCols + height*Y.col0 + col;

            if( i == Y.row0 ) {
                index += width*(col+1);

                for( int k = col+1; k < height; k++ , index += width ) {
                    dataY[index] /= val;
                }
            } else {
                int endIndex = index + width*height;
                //for( int k = 0; k < height; k++
                for( ; index != endIndex; index += width ) {
                    dataY[index] /= val;
                }
            }
        }
    }