7#include <initializer_list>
15#include <gch/small_vector.hpp>
17#include "sleipnir/autodiff/sleipnir_base.hpp"
18#include "sleipnir/autodiff/slice.hpp"
19#include "sleipnir/autodiff/variable.hpp"
20#include "sleipnir/autodiff/variable_block.hpp"
21#include "sleipnir/util/assert.hpp"
22#include "sleipnir/util/concepts.hpp"
23#include "sleipnir/util/empty.hpp"
24#include "sleipnir/util/function_ref.hpp"
25#include "sleipnir/util/symbol_exports.hpp"
34template <
typename Scalar_>
63 for (
int index = 0; index <
rows *
cols; ++index) {
64 m_storage.emplace_back();
77 for (
int index = 0; index <
rows *
cols; ++index) {
78 m_storage.emplace_back(
nullptr);
92 if (
list.size() > 0) {
93 m_cols =
list.begin()->size();
99 slp_assert(
static_cast<int>(
row.size()) == m_cols);
104 std::ranges::copy(
row, std::back_inserter(m_storage));
118 m_rows =
list.size();
120 if (
list.size() > 0) {
121 m_cols =
list.begin()->size();
127 slp_assert(
static_cast<int>(
row.size()) == m_cols);
132 std::ranges::copy(
row, std::back_inserter(m_storage));
146 m_rows =
list.size();
148 if (
list.size() > 0) {
149 m_cols =
list.begin()->size();
155 slp_assert(
static_cast<int>(
row.size()) == m_cols);
160 std::ranges::copy(
row, std::back_inserter(m_storage));
169 template <
typename Derived>
187 template <
typename Derived>
196 m_storage.emplace_back(
values.diagonal()[
row]);
198 m_storage.emplace_back(
Scalar(0));
221 m_storage.emplace_back(std::move(
variable));
295 template <
typename Derived>
317 slp_assert(
rows() == 1 &&
cols() == 1);
319 (*this)[0, 0] =
value;
329 template <
typename Derived>
330 requires std::same_as<typename Derived::Scalar, Scalar>
374 slp_assert(index >= 0 && index <
rows() *
cols());
375 return m_storage[index];
385 slp_assert(index >= 0 && index <
rows() *
cols());
386 return m_storage[index];
504 slp_assert(
cols() == 1);
519 slp_assert(
cols() == 1);
575 template <EigenMatrixLike LHS, SleipnirMatrixLike<Scalar> RHS>
577 slp_assert(
lhs.cols() ==
rhs.rows());
581 for (
int i = 0;
i <
lhs.rows(); ++
i) {
582 for (
int j = 0;
j <
rhs.cols(); ++
j) {
584 for (
int k = 0;
k <
lhs.cols(); ++
k) {
600 template <SleipnirMatrixLike<Scalar> LHS, EigenMatrixLike RHS>
602 slp_assert(
lhs.cols() ==
rhs.rows());
606 for (
int i = 0;
i <
lhs.rows(); ++
i) {
607 for (
int j = 0;
j <
rhs.cols(); ++
j) {
609 for (
int k = 0;
k <
lhs.cols(); ++
k) {
625 template <SleipnirMatrixLike<Scalar> LHS, SleipnirMatrixLike<Scalar> RHS>
627 slp_assert(
lhs.cols() ==
rhs.rows());
631 for (
int i = 0;
i <
lhs.rows(); ++
i) {
632 for (
int j = 0;
j <
rhs.cols(); ++
j) {
634 for (
int k = 0;
k <
lhs.cols(); ++
k) {
650 template <EigenMatrixLike LHS>
670 template <SleipnirMatrixLike<Scalar> LHS, ScalarLike RHS>
689 template <EigenMatrixLike RHS>
709 template <ScalarLike LHS, SleipnirMatrixLike<Scalar> RHS>
731 for (
int i = 0;
i <
rows(); ++
i) {
732 for (
int j = 0;
j <
rhs.cols(); ++
j) {
734 for (
int k = 0;
k <
cols(); ++
k) {
767 template <EigenMatrixLike LHS>
788 template <SleipnirMatrixLike<Scalar> LHS, ScalarLike RHS>
809 template <SleipnirMatrixLike<Scalar> LHS>
846 template <EigenMatrixLike LHS, SleipnirMatrixLike<Scalar> RHS>
848 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
868 template <SleipnirMatrixLike<Scalar> LHS, EigenMatrixLike RHS>
870 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
890 template <SleipnirMatrixLike<Scalar> LHS, SleipnirMatrixLike<Scalar> RHS>
892 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
930 slp_assert(
rows() == 1 &&
cols() == 1);
948 template <EigenMatrixLike LHS, SleipnirMatrixLike<Scalar> RHS>
950 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
970 template <SleipnirMatrixLike<Scalar> LHS, EigenMatrixLike RHS>
972 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
992 template <SleipnirMatrixLike<Scalar> LHS, SleipnirMatrixLike<Scalar> RHS>
994 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
1032 slp_assert(
rows() == 1 &&
cols() == 1);
1066 slp_assert(
rows() == 1 &&
cols() == 1);
1067 return (*
this)[0, 0];
1092 int rows()
const {
return m_rows; }
1099 int cols()
const {
return m_cols; }
1123 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
value() {
1124 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
result{
rows(),
1156#ifndef DOXYGEN_SHOULD_SKIP_THIS
1172 constexpr iterator& operator++() noexcept {
1177 constexpr iterator operator++(
int)
noexcept {
1178 iterator retval = *
this;
1183 constexpr iterator& operator--() noexcept {
1188 constexpr iterator operator--(
int)
noexcept {
1189 iterator retval = *
this;
1194 constexpr bool operator==(
const iterator&)
const noexcept =
default;
1196 constexpr reference operator*() const noexcept {
return *m_it; }
1199 gch::small_vector<Variable<Scalar>>::iterator m_it;
1202 class const_iterator {
1204 using iterator_category = std::bidirectional_iterator_tag;
1205 using value_type = Variable<Scalar>;
1206 using difference_type = std::ptrdiff_t;
1207 using pointer = Variable<Scalar>*;
1208 using const_reference =
const Variable<Scalar>&;
1210 constexpr const_iterator() noexcept = default;
1212 explicit constexpr const_iterator(
1213 gch::small_vector<Variable<Scalar>>::const_iterator it) noexcept
1216 constexpr const_iterator& operator++() noexcept {
1221 constexpr const_iterator operator++(
int)
noexcept {
1222 const_iterator retval = *
this;
1227 constexpr const_iterator& operator--() noexcept {
1232 constexpr const_iterator operator--(
int)
noexcept {
1233 const_iterator retval = *
this;
1238 constexpr bool operator==(
const const_iterator&)
const noexcept =
default;
1240 constexpr const_reference operator*() const noexcept {
return *m_it; }
1243 gch::small_vector<Variable<Scalar>>::const_iterator m_it;
1246 using reverse_iterator = std::reverse_iterator<iterator>;
1247 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
1348 size_t size()
const {
return m_storage.size(); }
1385 gch::small_vector<Variable<Scalar>> m_storage;
1390template <
typename Derived>
1391VariableMatrix(
const Eigen::MatrixBase<Derived>&)
1392 -> VariableMatrix<typename Derived::Scalar>;
1394template <
typename Derived>
1395VariableMatrix(
const Eigen::DiagonalBase<Derived>&)
1396 -> VariableMatrix<typename Derived::Scalar>;
1406template <
typename Scalar>
1407VariableMatrix<Scalar> cwise_reduce(
1408 const VariableMatrix<Scalar>& lhs,
const VariableMatrix<Scalar>& rhs,
1409 function_ref<Variable<Scalar>(
const Variable<Scalar>& x,
1410 const Variable<Scalar>& y)>
1412 slp_assert(lhs.rows() == rhs.rows() && lhs.cols() == rhs.cols());
1414 VariableMatrix<Scalar> result{detail::empty, lhs.rows(), lhs.cols()};
1416 for (
int row = 0; row < lhs.rows(); ++row) {
1417 for (
int col = 0; col < lhs.cols(); ++col) {
1418 result[row, col] = binary_op(lhs[row, col], rhs[row, col]);
1436template <
typename Scalar>
1437VariableMatrix<Scalar> block(
1438 std::initializer_list<std::initializer_list<VariableMatrix<Scalar>>> list) {
1442 for (
const auto& row : list) {
1443 if (row.size() > 0) {
1444 rows += row.
begin()->rows();
1448 int latest_cols = 0;
1449 for (
const auto& elem : row) {
1451 slp_assert(row.begin()->rows() == elem.rows());
1453 latest_cols += elem.cols();
1461 slp_assert(cols == latest_cols);
1465 VariableMatrix<Scalar> result{detail::empty, rows, cols};
1468 for (
const auto& row : list) {
1470 for (
const auto& elem : row) {
1471 result.block(row_offset, col_offset, elem.rows(), elem.cols()) = elem;
1472 col_offset += elem.cols();
1474 if (row.size() > 0) {
1475 row_offset += row.begin()->rows();
1495template <
typename Scalar>
1496VariableMatrix<Scalar> block(
1497 const std::vector<std::vector<VariableMatrix<Scalar>>>& list) {
1501 for (
const auto& row : list) {
1502 if (row.size() > 0) {
1503 rows += row.
begin()->rows();
1507 int latest_cols = 0;
1508 for (
const auto& elem : row) {
1510 slp_assert(row.begin()->rows() == elem.rows());
1512 latest_cols += elem.cols();
1520 slp_assert(cols == latest_cols);
1524 VariableMatrix<Scalar> result{detail::empty, rows, cols};
1527 for (
const auto& row : list) {
1529 for (
const auto& elem : row) {
1530 result.block(row_offset, col_offset, elem.rows(), elem.cols()) = elem;
1531 col_offset += elem.cols();
1533 if (row.size() > 0) {
1534 row_offset += row.begin()->rows();
1549template <
typename Scalar>
1550VariableMatrix<Scalar> solve(
const VariableMatrix<Scalar>& A,
1551 const VariableMatrix<Scalar>& B) {
1553 slp_assert(A.rows() == B.rows());
1555 if (A.rows() == 1 && A.cols() == 1) {
1557 return B[0, 0] / A[0, 0];
1558 }
else if (A.rows() == 2 && A.cols() == 2) {
1564 const auto& a = A[0, 0];
1565 const auto& b = A[0, 1];
1566 const auto& c = A[1, 0];
1567 const auto& d = A[1, 1];
1569 VariableMatrix adj_A{{d, -b}, {-c, a}};
1570 auto det_A = a * d - b * c;
1571 return adj_A / det_A * B;
1572 }
else if (A.rows() == 3 && A.cols() == 3) {
1584 const auto& a = A[0, 0];
1585 const auto& b = A[0, 1];
1586 const auto& c = A[0, 2];
1587 const auto& d = A[1, 0];
1588 const auto& e = A[1, 1];
1589 const auto& f = A[1, 2];
1590 const auto& g = A[2, 0];
1591 const auto& h = A[2, 1];
1592 const auto& i = A[2, 2];
1613 auto adj_A00 = ei - fh;
1614 auto adj_A10 = fg - di;
1615 auto adj_A20 = dh - eg;
1617 VariableMatrix adj_A{{adj_A00, ch - bi, bf - ce},
1618 {adj_A10, ai - cg, cd - af},
1619 {adj_A20, bg - ah, ae - bd}};
1620 auto det_A = a * adj_A00 + b * adj_A10 + c * adj_A20;
1621 return adj_A / det_A * B;
1622 }
else if (A.rows() == 4 && A.cols() == 4) {
1632 const auto& a = A[0, 0];
1633 const auto& b = A[0, 1];
1634 const auto& c = A[0, 2];
1635 const auto& d = A[0, 3];
1636 const auto& e = A[1, 0];
1637 const auto& f = A[1, 1];
1638 const auto& g = A[1, 2];
1639 const auto& h = A[1, 3];
1640 const auto& i = A[2, 0];
1641 const auto& j = A[2, 1];
1642 const auto& k = A[2, 2];
1643 const auto& l = A[2, 3];
1644 const auto& m = A[3, 0];
1645 const auto& n = A[3, 1];
1646 const auto& o = A[3, 2];
1647 const auto& p = A[3, 3];
1649 auto afk = a * f * k;
1650 auto afl = a * f * l;
1651 auto afo = a * f * o;
1652 auto afp = a * f * p;
1653 auto agj = a * g * j;
1654 auto agl = a * g * l;
1655 auto agn = a * g * n;
1656 auto agp = a * g * p;
1657 auto ahj = a * h * j;
1658 auto ahk = a * h * k;
1659 auto ahn = a * h * n;
1660 auto aho = a * h * o;
1661 auto ajo = a * j * o;
1662 auto ajp = a * j * p;
1663 auto akn = a * k * n;
1664 auto akp = a * k * p;
1665 auto aln = a * l * n;
1666 auto alo = a * l * o;
1667 auto bek = b * e * k;
1668 auto bel = b * e * l;
1669 auto beo = b * e * o;
1670 auto bep = b * e * p;
1671 auto bgi = b * g * i;
1672 auto bgl = b * g * l;
1673 auto bgm = b * g * m;
1674 auto bgp = b * g * p;
1675 auto bhi = b * h * i;
1676 auto bhk = b * h * k;
1677 auto bhm = b * h * m;
1678 auto bho = b * h * o;
1679 auto bio = b * i * o;
1680 auto bip = b * i * p;
1681 auto bjp = b * j * p;
1682 auto bkm = b * k * m;
1683 auto bkp = b * k * p;
1684 auto blm = b * l * m;
1685 auto blo = b * l * o;
1686 auto cej = c * e * j;
1687 auto cel = c * e * l;
1688 auto cen = c * e * n;
1689 auto cep = c * e * p;
1690 auto cfi = c * f * i;
1691 auto cfl = c * f * l;
1692 auto cfm = c * f * m;
1693 auto cfp = c * f * p;
1694 auto chi = c * h * i;
1695 auto chj = c * h * j;
1696 auto chm = c * h * m;
1697 auto chn = c * h * n;
1698 auto cin = c * i * n;
1699 auto cip = c * i * p;
1700 auto cjm = c * j * m;
1701 auto cjp = c * j * p;
1702 auto clm = c * l * m;
1703 auto cln = c * l * n;
1704 auto dej = d * e * j;
1705 auto dek = d * e * k;
1706 auto den = d * e * n;
1707 auto deo = d * e * o;
1708 auto dfi = d * f * i;
1709 auto dfk = d * f * k;
1710 auto dfm = d * f * m;
1711 auto dfo = d * f * o;
1712 auto dgi = d * g * i;
1713 auto dgj = d * g * j;
1714 auto dgm = d * g * m;
1715 auto dgn = d * g * n;
1716 auto din = d * i * n;
1717 auto dio = d * i * o;
1718 auto djm = d * j * m;
1719 auto djo = d * j * o;
1720 auto dkm = d * k * m;
1721 auto dkn = d * k * n;
1722 auto ejo = e * j * o;
1723 auto ejp = e * j * p;
1724 auto ekn = e * k * n;
1725 auto ekp = e * k * p;
1726 auto eln = e * l * n;
1727 auto elo = e * l * o;
1728 auto fio = f * i * o;
1729 auto fip = f * i * p;
1730 auto fkm = f * k * m;
1731 auto fkp = f * k * p;
1732 auto flm = f * l * m;
1733 auto flo = f * l * o;
1734 auto gin = g * i * n;
1735 auto gip = g * i * p;
1736 auto gjm = g * j * m;
1737 auto gjp = g * j * p;
1738 auto glm = g * l * m;
1739 auto gln = g * l * n;
1740 auto hin = h * i * n;
1741 auto hio = h * i * o;
1742 auto hjm = h * j * m;
1743 auto hjo = h * j * o;
1744 auto hkm = h * k * m;
1745 auto hkn = h * k * n;
1747 auto adj_A00 = fkp - flo - gjp + gln + hjo - hkn;
1748 auto adj_A01 = -bkp + blo + cjp - cln - djo + dkn;
1749 auto adj_A02 = bgp - bho - cfp + chn + dfo - dgn;
1750 auto adj_A03 = -bgl + bhk + cfl - chj - dfk + dgj;
1751 auto adj_A10 = -ekp + elo + gip - glm - hio + hkm;
1752 auto adj_A11 = akp - alo - cip + clm + dio - dkm;
1753 auto adj_A12 = -agp + aho + cep - chm - deo + dgm;
1754 auto adj_A13 = agl - ahk - cel + chi + dek - dgi;
1755 auto adj_A20 = ejp - eln - fip + flm + hin - hjm;
1756 auto adj_A21 = -ajp + aln + bip - blm - din + djm;
1757 auto adj_A22 = afp - ahn - bep + bhm + den - dfm;
1758 auto adj_A23 = -afl + ahj + bel - bhi - dej + dfi;
1759 auto adj_A30 = -ejo + ekn + fio - fkm - gin + gjm;
1761 auto adj_A31 = ajo - akn - bio + bkm + cin - cjm;
1762 auto adj_A32 = -afo + agn + beo - bgm - cen + cfm;
1763 auto adj_A33 = afk - agj - bek + bgi + cej - cfi;
1765 VariableMatrix adj_A{{adj_A00, adj_A01, adj_A02, adj_A03},
1766 {adj_A10, adj_A11, adj_A12, adj_A13},
1767 {adj_A20, adj_A21, adj_A22, adj_A23},
1768 {adj_A30, adj_A31, adj_A32, adj_A33}};
1769 auto det_A = a * adj_A00 + b * adj_A10 + c * adj_A20 + d * adj_A30;
1770 return adj_A / det_A * B;
1773 Eigen::Matrix<Variable<Scalar>, Eigen::Dynamic, Eigen::Dynamic>;
1775 MatrixXv eigen_A{A.rows(), A.cols()};
1776 for (
int row = 0; row < A.rows(); ++row) {
1777 for (
int col = 0; col < A.cols(); ++col) {
1778 eigen_A[row, col] = A[row, col];
1782 MatrixXv eigen_B{B.rows(), B.cols()};
1783 for (
int row = 0; row < B.rows(); ++row) {
1784 for (
int col = 0; col < B.cols(); ++col) {
1785 eigen_B[row, col] = B[row, col];
1789 MatrixXv eigen_X = eigen_A.householderQr().solve(eigen_B);
1791 VariableMatrix<Scalar> X{detail::empty, A.cols(), B.cols()};
1792 for (
int row = 0; row < X.rows(); ++row) {
1793 for (
int col = 0; col < X.cols(); ++col) {
1794 X[row, col] = eigen_X[row, col];
1802extern template SLEIPNIR_DLLEXPORT VariableMatrix<double> solve(
1803 const VariableMatrix<double>& A,
const VariableMatrix<double>& B);
Definition intrusive_shared_ptr.hpp:29
Definition sleipnir_base.hpp:11
Definition variable_block.hpp:26
Definition variable_matrix.hpp:35
const_reverse_iterator crbegin() const
Definition variable_matrix.hpp:1330
VariableMatrix(std::initializer_list< std::initializer_list< Variable< Scalar > > > list)
Definition variable_matrix.hpp:87
const_reverse_iterator crend() const
Definition variable_matrix.hpp:1339
Scalar_ Scalar
Definition variable_matrix.hpp:40
iterator end()
Definition variable_matrix.hpp:1263
const Variable< Scalar > & operator[](int row, int col) const
Definition variable_matrix.hpp:361
VariableMatrix(Variable< Scalar > &&variable)
Definition variable_matrix.hpp:220
const VariableBlock< const VariableMatrix > block(int row_offset, int col_offset, int block_rows, int block_cols) const
Definition variable_matrix.hpp:416
size_t size() const
Definition variable_matrix.hpp:1348
static VariableMatrix< Scalar > zero(int rows, int cols)
Definition variable_matrix.hpp:1357
VariableBlock< VariableMatrix > block(int row_offset, int col_offset, int block_rows, int block_cols)
Definition variable_matrix.hpp:398
VariableMatrix(const std::vector< std::vector< Scalar > > &list)
Definition variable_matrix.hpp:116
VariableMatrix & operator=(ScalarLike auto value)
Definition variable_matrix.hpp:316
VariableMatrix & operator-=(const MatrixLike auto &rhs)
Definition variable_matrix.hpp:1013
Variable< Scalar > & operator[](int index)
Definition variable_matrix.hpp:373
VariableMatrix & operator=(const Eigen::MatrixBase< Derived > &values)
Definition variable_matrix.hpp:296
friend VariableMatrix< Scalar > operator-(const LHS &lhs, const RHS &rhs)
Definition variable_matrix.hpp:949
VariableMatrix & operator-=(const ScalarLike auto &rhs)
Definition variable_matrix.hpp:1031
friend VariableMatrix< Scalar > operator*(const Variable< Scalar > &lhs, const RHS &rhs)
Definition variable_matrix.hpp:690
VariableMatrix & operator*=(const ScalarLike auto &rhs)
Definition variable_matrix.hpp:750
Scalar value(int index)
Definition variable_matrix.hpp:1116
VariableMatrix(const VariableBlock< VariableMatrix > &values)
Definition variable_matrix.hpp:230
VariableMatrix(int rows, int cols)
Definition variable_matrix.hpp:61
const_iterator cbegin() const
Definition variable_matrix.hpp:1284
const_iterator begin() const
Definition variable_matrix.hpp:1270
const_iterator cend() const
Definition variable_matrix.hpp:1291
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > value()
Definition variable_matrix.hpp:1123
const VariableBlock< const VariableMatrix > operator[](Slice row_slice, Slice col_slice) const
Definition variable_matrix.hpp:448
friend VariableMatrix< Scalar > operator/(const LHS &lhs, const Variable< Scalar > &rhs)
Definition variable_matrix.hpp:768
VariableMatrix(int rows)
Definition variable_matrix.hpp:53
VariableMatrix(std::span< const Variable< Scalar > > values, int rows, int cols)
Definition variable_matrix.hpp:278
VariableBlock< VariableMatrix > col(int col)
Definition variable_matrix.hpp:553
VariableMatrix(const Eigen::MatrixBase< Derived > &values)
Definition variable_matrix.hpp:171
const VariableBlock< const VariableMatrix > operator[](Slice row_slice, int row_slice_length, Slice col_slice, int col_slice_length) const
Definition variable_matrix.hpp:489
const VariableBlock< const VariableMatrix > col(int col) const
Definition variable_matrix.hpp:564
VariableMatrix & operator+=(const ScalarLike auto &rhs)
Definition variable_matrix.hpp:929
friend VariableMatrix< Scalar > operator*(const LHS &lhs, const Variable< Scalar > &rhs)
Definition variable_matrix.hpp:651
VariableBlock< VariableMatrix > segment(int offset, int length)
Definition variable_matrix.hpp:503
Scalar value(int row, int col)
Definition variable_matrix.hpp:1108
const VariableBlock< const VariableMatrix > row(int row) const
Definition variable_matrix.hpp:542
static VariableMatrix< Scalar > ones(int rows, int cols)
Definition variable_matrix.hpp:1374
VariableMatrix & operator+=(const MatrixLike auto &rhs)
Definition variable_matrix.hpp:911
VariableMatrix(std::span< const Variable< Scalar > > values)
Definition variable_matrix.hpp:261
friend VariableMatrix< Scalar > operator-(const SleipnirMatrixLike< Scalar > auto &lhs)
Definition variable_matrix.hpp:1048
VariableMatrix< Scalar > T() const
Definition variable_matrix.hpp:1075
VariableMatrix< Scalar > cwise_transform(function_ref< Variable< Scalar >(const Variable< Scalar > &x)> unary_op) const
Definition variable_matrix.hpp:1142
friend VariableMatrix< Scalar > operator*(const LHS &lhs, const RHS &rhs)
Definition variable_matrix.hpp:576
const_reverse_iterator rbegin() const
Definition variable_matrix.hpp:1312
VariableMatrix(const Variable< Scalar > &variable)
Definition variable_matrix.hpp:210
reverse_iterator rend()
Definition variable_matrix.hpp:1305
VariableMatrix(const VariableBlock< const VariableMatrix > &values)
Definition variable_matrix.hpp:246
int rows() const
Definition variable_matrix.hpp:1092
VariableMatrix(const Eigen::DiagonalBase< Derived > &values)
Definition variable_matrix.hpp:189
VariableBlock< VariableMatrix > operator[](Slice row_slice, Slice col_slice)
Definition variable_matrix.hpp:434
const_reverse_iterator rend() const
Definition variable_matrix.hpp:1321
VariableMatrix & operator*=(const MatrixLike auto &rhs)
Definition variable_matrix.hpp:728
VariableMatrix(detail::empty_t, int rows, int cols)
Definition variable_matrix.hpp:74
const_iterator end() const
Definition variable_matrix.hpp:1277
void set_value(const Eigen::MatrixBase< Derived > &values)
Definition variable_matrix.hpp:331
Variable< Scalar > & operator[](int row, int col)
Definition variable_matrix.hpp:348
iterator begin()
Definition variable_matrix.hpp:1256
const VariableBlock< const VariableMatrix > segment(int offset, int length) const
Definition variable_matrix.hpp:517
reverse_iterator rbegin()
Definition variable_matrix.hpp:1298
VariableBlock< VariableMatrix > row(int row)
Definition variable_matrix.hpp:531
friend VariableMatrix< Scalar > operator+(const LHS &lhs, const RHS &rhs)
Definition variable_matrix.hpp:847
VariableMatrix(const std::vector< std::vector< Variable< Scalar > > > &list)
Definition variable_matrix.hpp:144
VariableBlock< VariableMatrix > operator[](Slice row_slice, int row_slice_length, Slice col_slice, int col_slice_length)
Definition variable_matrix.hpp:469
VariableMatrix & operator/=(const ScalarLike auto &rhs)
Definition variable_matrix.hpp:829
const Variable< Scalar > & operator[](int index) const
Definition variable_matrix.hpp:384
int cols() const
Definition variable_matrix.hpp:1099
Definition variable.hpp:49
Definition function_ref.hpp:13
Definition concepts.hpp:18
Definition concepts.hpp:24
Definition concepts.hpp:33
Definition concepts.hpp:38