Class FieldDenseMatrix<T>

  • Type Parameters:
    T - Type of the field elements.
    All Implemented Interfaces:
    AnyMatrix

    public final class FieldDenseMatrix<T>
    extends Object
    implements AnyMatrix
    Square matrix whose elements define a Field.
    Since:
    4.0
    • Method Detail

      • create

        public static <T> FieldDenseMatrix<T> create​(org.apache.commons.numbers.field.Field<T> f,
                                                     int r,
                                                     int c)
        Factory method.
        Type Parameters:
        T - Type of the field elements.
        Parameters:
        f - Field.
        r - Number of rows.
        c - Number of columns.
        Returns:
        a new instance.
        Throws:
        IllegalArgumentException - if r <= 0 or c <= 0.
      • zero

        public static <T> FieldDenseMatrix<T> zero​(org.apache.commons.numbers.field.Field<T> f,
                                                   int r,
                                                   int c)
        Factory method.
        Type Parameters:
        T - Type of the field elements.
        Parameters:
        f - Field.
        r - Number of rows.
        c - Number of columns.
        Returns:
        a matrix with elements zet to zero.
        Throws:
        IllegalArgumentException - if r <= 0 or c <= 0.
      • identity

        public static <T> FieldDenseMatrix<T> identity​(org.apache.commons.numbers.field.Field<T> f,
                                                       int n)
        Factory method.
        Type Parameters:
        T - Type of the field elements.
        Parameters:
        f - Field.
        n - Dimension of the matrix.
        Returns:
        the identity matrix.
        Throws:
        IllegalArgumentException - if n <= 0.
      • getField

        public org.apache.commons.numbers.field.Field<TgetField()
        Returns:
        the field associated with the matrix entries.
      • fill

        public FieldDenseMatrix<Tfill​(T value)
        Sets all elements to the given value.
        Parameters:
        value - Value of the elements of the matrix.
        Returns:
        this.
      • get

        public T get​(int i,
                     int j)
        Gets an element.
        Parameters:
        i - Row.
        j - Column.
        Returns:
        the element at (i, j).
      • set

        public void set​(int i,
                        int j,
                        T value)
        Sets an element.
        Parameters:
        i - Row.
        j - Column.
        value - Value.