Class AbstractMatrix

java.lang.Object
com.powsybl.math.AbstractMathNative
com.powsybl.math.matrix.AbstractMatrix
All Implemented Interfaces:
Matrix
Direct Known Subclasses:
DenseMatrix, SparseMatrix

public abstract class AbstractMatrix extends AbstractMathNative implements Matrix
Abstract class for matrix that provides an implementation for common methods.
Author:
Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
  • Constructor Details

    • AbstractMatrix

      public AbstractMatrix()
  • Method Details

    • getValueCount

      public abstract int getValueCount()
      Get value count.
      Returns:
      the value count
    • checkBounds

      protected void checkBounds(int i, int j)
      Check that row i and column j are in matrix bounds.
      Parameters:
      i - row index
      j - column index
    • copy

      public Matrix copy(MatrixFactory factory)
      Copy this matrix using another implementation. This method is not allowed to return this.
      Specified by:
      copy in interface Matrix
      Parameters:
      factory - a matrix factory to create the copy.
      Returns:
      a copy of the matrix
    • add

      public Matrix add(Matrix other)
      Description copied from interface: Matrix
      Addition the matrix with another one (this + other). The resulting matrix has the same implementation as this matrix.
      Specified by:
      add in interface Matrix
      Parameters:
      other - the other matrix
      Returns:
      the result of the addition of this matrix and the other one
    • times

      public Matrix times(Matrix other)
      Description copied from interface: Matrix
      Multiply the matrix by another one. The resulting matrix has the same implementation as this matrix.
      Specified by:
      times in interface Matrix
      Parameters:
      other - the other matrix
      Returns:
      the result of the multiplication of this matrix by the other one