final Vector parameters) parameters.assertDimensionalityEquals(this.getNumRows() * getNumColumns()); final int numRows = this.getNumRows(); final int numColumns = this.getNumColumns(); for (int i = 0; i < numRows; ++i)
final Vector parameters) parameters.assertDimensionalityEquals(this.getNumRows() * getNumColumns()); final int numRows = this.getNumRows(); final int numColumns = this.getNumColumns(); for (int i = 0; i < numRows; ++i)
final Vector parameters) parameters.assertDimensionalityEquals(this.getNumRows() * getNumColumns()); final int numRows = this.getNumRows(); final int numColumns = this.getNumColumns(); for (int i = 0; i < numRows; ++i)
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. */ @Override public final void plusEquals( final DiagonalMatrix other) { this.assertSameDimensions(other); if (!isCompressed()) { compress(); } // Count the number of new values to add. int nnz = getNumNonZeroWhenCombinedWith(getZeroToNMinusOneArray( other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.OR); // Now start up the values for the sum matrix double[] newVals = new double[nnz]; int[] newFirstIdxsForRows = new int[firstIndicesForRows.length]; int[] newColIdxs = new int[nnz]; // Now do the logic for adding plusEqualsScaled(newColIdxs, newFirstIdxsForRows, newVals, other, 1); // Now store the new values in me values = newVals; columnIndices = newColIdxs; firstIndicesForRows = newFirstIdxsForRows; }
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. */ @Override public final void minusEquals( final DiagonalMatrix other) { this.assertSameDimensions(other); if (!isCompressed()) { compress(); } // Count the number of new values to add. int nnz = getNumNonZeroWhenCombinedWith(getZeroToNMinusOneArray( other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.OR); // Initialize the new matrix storage double[] newVals = new double[nnz]; int[] newFirstIdxsForRows = new int[firstIndicesForRows.length]; int[] newColIdxs = new int[nnz]; // Actually do the computation plusEqualsScaled(newColIdxs, newFirstIdxsForRows, newVals, other, -1); // Store the results values = newVals; columnIndices = newColIdxs; firstIndicesForRows = newFirstIdxsForRows; }
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. */ @Override public final void plusEquals( final DiagonalMatrix other) { this.assertSameDimensions(other); if (!isCompressed()) { compress(); } // Count the number of new values to add. int nnz = getNumNonZeroWhenCombinedWith(getZeroToNMinusOneArray( other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.OR); // Now start up the values for the sum matrix double[] newVals = new double[nnz]; int[] newFirstIdxsForRows = new int[firstIndicesForRows.length]; int[] newColIdxs = new int[nnz]; // Now do the logic for adding plusEqualsScaled(newColIdxs, newFirstIdxsForRows, newVals, other, 1); // Now store the new values in me values = newVals; columnIndices = newColIdxs; firstIndicesForRows = newFirstIdxsForRows; }
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. */ @Override public void scaledPlusEquals( final DiagonalMatrix other, final double scaleFactor) { this.assertSameDimensions(other); if (!isCompressed()) { compress(); } // Count the number of new values to add. int nnz = getNumNonZeroWhenCombinedWith(getZeroToNMinusOneArray( other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.OR); // Now start up the values for the sum matrix double[] newVals = new double[nnz]; int[] newFirstIdxsForRows = new int[firstIndicesForRows.length]; int[] newColIdxs = new int[nnz]; // Now do the logic for adding plusEqualsScaled(newColIdxs, newFirstIdxsForRows, newVals, other, 1); // Now store the new values in me values = newVals; columnIndices = newColIdxs; firstIndicesForRows = newFirstIdxsForRows; }
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. */ @Override public void scaledPlusEquals( final DiagonalMatrix other, final double scaleFactor) { this.assertSameDimensions(other); if (!isCompressed()) { compress(); } // Count the number of new values to add. int nnz = getNumNonZeroWhenCombinedWith(getZeroToNMinusOneArray( other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.OR); // Now start up the values for the sum matrix double[] newVals = new double[nnz]; int[] newFirstIdxsForRows = new int[firstIndicesForRows.length]; int[] newColIdxs = new int[nnz]; // Now do the logic for adding plusEqualsScaled(newColIdxs, newFirstIdxsForRows, newVals, other, 1); // Now store the new values in me values = newVals; columnIndices = newColIdxs; firstIndicesForRows = newFirstIdxsForRows; }
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. */ @Override public final void plusEquals( final DiagonalMatrix other) { this.assertSameDimensions(other); if (!isCompressed()) { compress(); } // Count the number of new values to add. int nnz = getNumNonZeroWhenCombinedWith(getZeroToNMinusOneArray( other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.OR); // Now start up the values for the sum matrix double[] newVals = new double[nnz]; int[] newFirstIdxsForRows = new int[firstIndicesForRows.length]; int[] newColIdxs = new int[nnz]; // Now do the logic for adding plusEqualsScaled(newColIdxs, newFirstIdxsForRows, newVals, other, 1); // Now store the new values in me values = newVals; columnIndices = newColIdxs; firstIndicesForRows = newFirstIdxsForRows; }
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. */ @Override public final void minusEquals( final DiagonalMatrix other) { this.assertSameDimensions(other); if (!isCompressed()) { compress(); } // Count the number of new values to add. int nnz = getNumNonZeroWhenCombinedWith(getZeroToNMinusOneArray( other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.OR); // Initialize the new matrix storage double[] newVals = new double[nnz]; int[] newFirstIdxsForRows = new int[firstIndicesForRows.length]; int[] newColIdxs = new int[nnz]; // Actually do the computation plusEqualsScaled(newColIdxs, newFirstIdxsForRows, newVals, other, -1); // Store the results values = newVals; columnIndices = newColIdxs; firstIndicesForRows = newFirstIdxsForRows; }
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. */ @Override public final void minusEquals( final DiagonalMatrix other) { this.assertSameDimensions(other); if (!isCompressed()) { compress(); } // Count the number of new values to add. int nnz = getNumNonZeroWhenCombinedWith(getZeroToNMinusOneArray( other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.OR); // Initialize the new matrix storage double[] newVals = new double[nnz]; int[] newFirstIdxsForRows = new int[firstIndicesForRows.length]; int[] newColIdxs = new int[nnz]; // Actually do the computation plusEqualsScaled(newColIdxs, newFirstIdxsForRows, newVals, other, -1); // Store the results values = newVals; columnIndices = newColIdxs; firstIndicesForRows = newFirstIdxsForRows; }
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. */ @Override public void scaledPlusEquals( final DiagonalMatrix other, final double scaleFactor) { this.assertSameDimensions(other); if (!isCompressed()) { compress(); } // Count the number of new values to add. int nnz = getNumNonZeroWhenCombinedWith(getZeroToNMinusOneArray( other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.OR); // Now start up the values for the sum matrix double[] newVals = new double[nnz]; int[] newFirstIdxsForRows = new int[firstIndicesForRows.length]; int[] newColIdxs = new int[nnz]; // Now do the logic for adding plusEqualsScaled(newColIdxs, newFirstIdxsForRows, newVals, other, 1); // Now store the new values in me values = newVals; columnIndices = newColIdxs; firstIndicesForRows = newFirstIdxsForRows; }
other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.AND);
other.getNumRows()), getZeroToNMinusOneArray(other.getNumRows() + 1), Combiner.AND);
final int numRows = this.getNumRows(); final int numColumns = this.getNumColumns(); for (int i = 0; i < numRows; ++i)
final int numRows = this.getNumRows(); final int numColumns = this.getNumColumns(); for (int i = 0; i < numRows; ++i)
final int numRows = this.getNumRows(); final int numColumns = this.getNumColumns(); for (int i = 0; i < numRows; ++i)
this.numRows = d.getNumRows(); int nnz = 0; for (int i = 0; i < this.numRows; ++i)
this.numRows = d.getNumRows(); int nnz = 0; for (int i = 0; i < this.numRows; ++i)
this.numRows = d.getNumRows(); int nnz = 0; for (int i = 0; i < this.numRows; ++i)