26template<
int R=RowsAtCompileTime,
int C=ColsAtCompileTime>
29 return const_cast<Scalar&
>(
static_cast<const Matrix<Scalar,R,C>&
>(*this).operator()(i,j));
42template<
int R=RowsAtCompileTime,
int C=ColsAtCompileTime>
45 assert_release(i >= 0 && i < this->rows() && j >= 0 && j < this->cols());
47 if constexpr(!IsVectorOrRow<R,C>)
64inline auto&
init(
const Scalar& x)
66 for(Index i = 0 ; i < this->size() ; i++)
67 *(this->data()+i) = x;
77template<
typename U_,
int R_,
int C_>
86 if(this->size() != x.size())
89 if constexpr(std::is_same_v<Scalar,codac2::Interval> && std::is_same_v<U_,codac2::Interval>)
92 return this->
is_empty() && x.is_empty();
95 if(this->rows() != x.rows() || this->cols() != x.cols())
98 for(Index i = 0 ; i < this->size() ; i++)
99 if(*(this->data()+i) != *(x.data()+i))
bool operator==(const Matrix< U_, R_, C_ > &x) const
Compares this matrix with another matrix for equality.
Definition codac2_Matrix_addons_Base.h:78
Scalar & operator()(Index i, Index j)
Accesses a matrix element (modifiable) by its row and column indices.
Definition codac2_Matrix_addons_Base.h:27
Matrix(const Matrix< double, R, C > &lb, const Matrix< double, R, C > &ub)
Constructs an interval matrix from lower and upper bound matrices.
Definition codac2_Matrix_addons_IntervalMatrixBase.h:50
auto & init()
Initializes all elements of the matrix with default intervals.
Definition codac2_Matrix_addons_IntervalMatrixBase.h:113
bool is_empty() const
Checks whether the interval matrix is empty.
Definition codac2_MatrixBase_addons_IntervalMatrixBase.h:56