OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Oasis::Matrix Class Reference

A matrix. More...

#include <Oasis/Matrix.hpp>

Inheritance diagram for Oasis::Matrix:
[legend]
Collaboration diagram for Oasis::Matrix:
[legend]

Public Member Functions

 Matrix ()=default
 
 Matrix (const Matrix &other)=default
 
 Matrix (size_t numRows, size_t numCols)
 
 Matrix (size_t numRows, size_t numCols, std::vector< double > &vals)
 
 Matrix (MatrixXXD other)
 
auto Equals (const Expression &other) const -> bool final
 Compares this expression to another expression for equality.
 
auto GetMatrix () const -> MatrixXXD
 Gets the matrix.
 
auto GetRows () const -> size_t
 Gets the number of rows.
 
auto GetCols () const -> size_t
 Gets the number of columns.
 
auto Transpose () const -> std::unique_ptr< Matrix >
 Gets the matrix's transpose.
 
auto Inverse () const -> std::unique_ptr< Matrix >
 Gets the matrix's inverse.
 
auto Integrate (const Expression &integrationVariable) const -> std::unique_ptr< Expression > final
 Attempts to integrate this expression using integration rules.
 
auto Identity () const -> std::unique_ptr< Expression >
 
auto Differentiate (const Expression &) const -> std::unique_ptr< Expression > final
 Tries to differentiate this function.
 
auto operator= (const Matrix &other) -> Matrix &=default
 
- Public Member Functions inherited from Oasis::LeafExpression< Matrix >
auto Copy () const -> std::unique_ptr< Expression > final
 Copies this expression.
 
auto StructurallyEquivalent (const Expression &other) const -> bool final
 Checks whether this expression is structurally equivalent to another expression.
 
auto Substitute (const Expression &, const Expression &) -> std::unique_ptr< Expression > override
 
void Serialize (SerializationVisitor &visitor) const override
 This function serializes the expression object.
 
- Public Member Functions inherited from Oasis::Expression
auto FindZeros () const -> std::vector< std::unique_ptr< Expression > >
 The FindZeros function finds all rational real zeros, and up to 2 irrational/complex zeros of a polynomial.
 
virtual auto GetCategory () const -> uint32_t
 Gets the category of this expression.
 
virtual auto GetType () const -> ExpressionType
 Gets the type of this expression.
 
virtual auto Generalize () const -> std::unique_ptr< Expression >
 Converts this expression to a more general expression.
 
virtual auto IntegrateWithBounds (const Expression &, const Expression &, const Expression &) -> std::unique_ptr< Expression >
 Attempts to integrate this expression using integration rules.
 
template<IExpression T>
bool Is () const
 Gets whether this expression is of a specific type.
 
template<template< typename > typename T>
bool Is () const
 
template<template< typename, typename > typename T>
bool Is () const
 
virtual auto Simplify () const -> std::unique_ptr< Expression >
 Simplifies this expression.
 
virtual ~Expression ()=default
 

Detailed Description

A matrix.

Constructor & Destructor Documentation

◆ Matrix() [1/5]

Oasis::Matrix::Matrix ( )
default

◆ Matrix() [2/5]

Oasis::Matrix::Matrix ( const Matrix & other)
default

◆ Matrix() [3/5]

Oasis::Matrix::Matrix ( size_t numRows,
size_t numCols )

◆ Matrix() [4/5]

Oasis::Matrix::Matrix ( size_t numRows,
size_t numCols,
std::vector< double > & vals )

◆ Matrix() [5/5]

Oasis::Matrix::Matrix ( MatrixXXD other)
explicit

Member Function Documentation

◆ Differentiate()

auto Oasis::Matrix::Differentiate ( const Expression & differentiationVariable) const -> std::unique_ptr<Expression>
finalvirtual

Tries to differentiate this function.

Returns
the differentiated expression.

Reimplemented from Oasis::LeafExpression< Matrix >.

◆ Equals()

auto Oasis::Matrix::Equals ( const Expression & other) const -> bool
finalvirtual

Compares this expression to another expression for equality.

Two expressions are equal if they are structurally equivalent and have the same value. While this method considers the associativity and commutativity of expressions, it does not simplify the expressions before comparing them. For example, Add<Real>(Real(1), Real(2)) and Add<Real>(Real(2), Real(1)) are not equal, despite being structurally equivalent.

Parameters
otherThe other expression.
Returns
Whether the two expressions are equal.

Implements Oasis::Expression.

◆ GetCols()

auto Oasis::Matrix::GetCols ( ) const -> size_t

Gets the number of columns.

Returns
number of columns

◆ GetMatrix()

auto Oasis::Matrix::GetMatrix ( ) const -> MatrixXXD

Gets the matrix.

Returns
The matrix.

◆ GetRows()

auto Oasis::Matrix::GetRows ( ) const -> size_t

Gets the number of rows.

Returns
number of rows

◆ Identity()

auto Oasis::Matrix::Identity ( ) const -> std::unique_ptr<Expression>

◆ Integrate()

auto Oasis::Matrix::Integrate ( const Expression & integrationVariable) const -> std::unique_ptr<Expression>
finalvirtual

Attempts to integrate this expression using integration rules.

Returns
An indefinite integral of the expression added to a constant

Reimplemented from Oasis::LeafExpression< Matrix >.

◆ Inverse()

auto Oasis::Matrix::Inverse ( ) const -> std::unique_ptr<Matrix>

Gets the matrix's inverse.

Returns
Unique pointer to a Matrix

◆ operator=()

auto Oasis::Matrix::operator= ( const Matrix & other) -> Matrix &=default
default

◆ Transpose()

auto Oasis::Matrix::Transpose ( ) const -> std::unique_ptr<Matrix>

Gets the matrix's transpose.

Returns
Unique pointer to a Matrix

The documentation for this class was generated from the following files: