Skip to content

Latest commit

 

History

History
113 lines (71 loc) · 2.99 KB

comparison_ops.rst

File metadata and controls

113 lines (71 loc) · 2.99 KB

StaticMatrix comparison operators

.. cpp:namespace:: libsemigroups::StaticMatrix<PlusOp, ProdOp, ZeroOp, OneOp, Scalar>

.. cpp:function:: bool operator==(StaticMatrix const& that) const

   Equality operator.

   :param that: matrix for comparison.

   :returns:
    ``true`` if ``*this`` and ``that`` are equal and ``false`` if they are
    not.

   :complexity:
     At worst :math:`O(mn)` where :math:`m` is the number of rows and
     :math:`n` is the number of columns of the matrix.

.. cpp:function:: bool operator==(RowView const& that) const

   Equality operator.

   :param that: the row view for comparison.

   :returns:
     ``true`` if ``*this`` and ``that`` are equal and ``false`` if they are
     not.  In particular, if ``*this`` has more than one row, then ``false``
     is returned.

   :complexity:
     At worst :math:`O(n)` where :math:`n` is the number of columns of the
     matrix.

.. cpp:function:: template <typename T> \
                  bool operator!=(T const& that) const

   Inequality operator.

   :tparam T:
     either :cpp:any:`StaticMatrix` or :cpp:any:`RowView`

   :param that: the matrix or row view for comparison.

   :returns:
     the negation of ``operator==(that)``.

   :complexity:
     see :cpp:any:`operator==`

.. cpp:function:: bool operator<(StaticMatrix const& that) const

   Less than operator.

   This operator defines a total order on the set of matrices of the same type,
   the details of which is implementation specific.

   :param that: the matrix for comparison.

   :returns:
     ``true`` if ``*this`` is less than ``that`` and ``false`` if it is not.

   :complexity:
     At worst :math:`O(mn)` where :math:`m` is
     :cpp:any:`number_of_rows`
     and :math:`n` is :cpp:any:`number_of_cols`

.. cpp:function:: bool operator<(RowView const& that) const

   Less than operator.

   :param that: the row view for comparison.

   :returns:
      ``true`` if ``*this`` is less than ``that``, and ``false``
      otherwise. In particular, if ``*this`` has more than one row, then
      ``false`` is returned.

   :complexity:
     At worst :math:`O(n)` where :math:`n` is
     :cpp:any:`number_of_cols`

.. cpp:function:: bool operator>(StaticMatrix const& that) const

   Greater than operator.

   This operator defines a total order on the set of matrices of the same type,
   the details of which is implementation specific.

   :param that: the matrix for comparison.

   :returns:
     ``true`` if ``*this`` is less than ``that`` and ``false`` if it is not.

   :complexity:
     At worst :math:`O(mn)` where :math:`m` is :cpp:any:`number_of_rows`
     and :math:`m` is :cpp:any:`number_of_cols`