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) {
771 template <EigenMatrixLike LHS>
792 template <SleipnirMatrixLike<Scalar> LHS, ScalarLike RHS>
813 template <SleipnirMatrixLike<Scalar> LHS>
850 template <EigenMatrixLike LHS, SleipnirMatrixLike<Scalar> RHS>
852 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
872 template <SleipnirMatrixLike<Scalar> LHS, EigenMatrixLike RHS>
874 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
894 template <SleipnirMatrixLike<Scalar> LHS, SleipnirMatrixLike<Scalar> RHS>
896 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
938 slp_assert(
rows() == 1 &&
cols() == 1);
956 template <EigenMatrixLike LHS, SleipnirMatrixLike<Scalar> RHS>
958 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
978 template <SleipnirMatrixLike<Scalar> LHS, EigenMatrixLike RHS>
980 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
1000 template <SleipnirMatrixLike<Scalar> LHS, SleipnirMatrixLike<Scalar> RHS>
1002 slp_assert(
lhs.rows() ==
rhs.rows() &&
lhs.cols() ==
rhs.cols());
1044 slp_assert(
rows() == 1 &&
cols() == 1);
1078 slp_assert(
rows() == 1 &&
cols() == 1);
1079 return (*
this)[0, 0];
1104 int rows()
const {
return m_rows; }
1111 int cols()
const {
return m_cols; }
1135 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
value() {
1136 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
result{
rows(),
1168#ifndef DOXYGEN_SHOULD_SKIP_THIS
1184 constexpr iterator& operator++() noexcept {
1189 constexpr iterator operator++(
int)
noexcept {
1190 iterator retval = *
this;
1195 constexpr iterator& operator--() noexcept {
1200 constexpr iterator operator--(
int)
noexcept {
1201 iterator retval = *
this;
1206 constexpr bool operator==(
const iterator&)
const noexcept =
default;
1208 constexpr reference operator*() const noexcept {
return *m_it; }
1211 gch::small_vector<Variable<Scalar>>::iterator m_it;
1214 class const_iterator {
1216 using iterator_category = std::bidirectional_iterator_tag;
1217 using value_type = Variable<Scalar>;
1218 using difference_type = std::ptrdiff_t;
1219 using pointer = Variable<Scalar>*;
1220 using const_reference =
const Variable<Scalar>&;
1222 constexpr const_iterator() noexcept = default;
1224 explicit constexpr const_iterator(
1225 gch::small_vector<Variable<Scalar>>::const_iterator it) noexcept
1228 constexpr const_iterator& operator++() noexcept {
1233 constexpr const_iterator operator++(
int)
noexcept {
1234 const_iterator retval = *
this;
1239 constexpr const_iterator& operator--() noexcept {
1244 constexpr const_iterator operator--(
int)
noexcept {
1245 const_iterator retval = *
this;
1250 constexpr bool operator==(
const const_iterator&)
const noexcept =
default;
1252 constexpr const_reference operator*() const noexcept {
return *m_it; }
1255 gch::small_vector<Variable<Scalar>>::const_iterator m_it;
1258 using reverse_iterator = std::reverse_iterator<iterator>;
1259 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
1360 size_t size()
const {
return m_storage.size(); }
1397 gch::small_vector<Variable<Scalar>> m_storage;
1402template <
typename Derived>
1403VariableMatrix(
const Eigen::MatrixBase<Derived>&)
1404 -> VariableMatrix<typename Derived::Scalar>;
1406template <
typename Derived>
1407VariableMatrix(
const Eigen::DiagonalBase<Derived>&)
1408 -> VariableMatrix<typename Derived::Scalar>;
1418template <
typename Scalar>
1419VariableMatrix<Scalar> cwise_reduce(
1420 const VariableMatrix<Scalar>& lhs,
const VariableMatrix<Scalar>& rhs,
1421 function_ref<Variable<Scalar>(
const Variable<Scalar>& x,
1422 const Variable<Scalar>& y)>
1424 slp_assert(lhs.rows() == rhs.rows() && lhs.cols() == rhs.cols());
1426 VariableMatrix<Scalar> result{detail::empty, lhs.rows(), lhs.cols()};
1428 for (
int row = 0; row < lhs.rows(); ++row) {
1429 for (
int col = 0; col < lhs.cols(); ++col) {
1430 result[row, col] = binary_op(lhs[row, col], rhs[row, col]);
1448template <
typename Scalar>
1449VariableMatrix<Scalar> block(
1450 std::initializer_list<std::initializer_list<VariableMatrix<Scalar>>> list) {
1454 for (
const auto& row : list) {
1455 if (row.size() > 0) {
1456 rows += row.
begin()->rows();
1460 int latest_cols = 0;
1461 for (
const auto& elem : row) {
1463 slp_assert(row.begin()->rows() == elem.rows());
1465 latest_cols += elem.cols();
1473 slp_assert(cols == latest_cols);
1477 VariableMatrix<Scalar> result{detail::empty, rows, cols};
1480 for (
const auto& row : list) {
1482 for (
const auto& elem : row) {
1483 result.block(row_offset, col_offset, elem.rows(), elem.cols()) = elem;
1484 col_offset += elem.cols();
1486 if (row.size() > 0) {
1487 row_offset += row.begin()->rows();
1507template <
typename Scalar>
1508VariableMatrix<Scalar> block(
1509 const std::vector<std::vector<VariableMatrix<Scalar>>>& list) {
1513 for (
const auto& row : list) {
1514 if (row.size() > 0) {
1515 rows += row.
begin()->rows();
1519 int latest_cols = 0;
1520 for (
const auto& elem : row) {
1522 slp_assert(row.begin()->rows() == elem.rows());
1524 latest_cols += elem.cols();
1532 slp_assert(cols == latest_cols);
1536 VariableMatrix<Scalar> result{detail::empty, rows, cols};
1539 for (
const auto& row : list) {
1541 for (
const auto& elem : row) {
1542 result.block(row_offset, col_offset, elem.rows(), elem.cols()) = elem;
1543 col_offset += elem.cols();
1545 if (row.size() > 0) {
1546 row_offset += row.begin()->rows();
1561template <
typename Scalar>
1562VariableMatrix<Scalar> solve(
const VariableMatrix<Scalar>& A,
1563 const VariableMatrix<Scalar>& B) {
1565 slp_assert(A.rows() == B.rows());
1567 if (A.rows() == 1 && A.cols() == 1) {
1569 return B[0, 0] / A[0, 0];
1570 }
else if (A.rows() == 2 && A.cols() == 2) {
1576 const auto& a = A[0, 0];
1577 const auto& b = A[0, 1];
1578 const auto& c = A[1, 0];
1579 const auto& d = A[1, 1];
1581 VariableMatrix adj_A{{d, -b}, {-c, a}};
1582 auto det_A = a * d - b * c;
1583 return adj_A / det_A * B;
1584 }
else if (A.rows() == 3 && A.cols() == 3) {
1596 const auto& a = A[0, 0];
1597 const auto& b = A[0, 1];
1598 const auto& c = A[0, 2];
1599 const auto& d = A[1, 0];
1600 const auto& e = A[1, 1];
1601 const auto& f = A[1, 2];
1602 const auto& g = A[2, 0];
1603 const auto& h = A[2, 1];
1604 const auto& i = A[2, 2];
1625 auto adj_A00 = ei - fh;
1626 auto adj_A10 = fg - di;
1627 auto adj_A20 = dh - eg;
1629 VariableMatrix adj_A{{adj_A00, ch - bi, bf - ce},
1630 {adj_A10, ai - cg, cd - af},
1631 {adj_A20, bg - ah, ae - bd}};
1632 auto det_A = a * adj_A00 + b * adj_A10 + c * adj_A20;
1633 return adj_A / det_A * B;
1634 }
else if (A.rows() == 4 && A.cols() == 4) {
1644 const auto& a = A[0, 0];
1645 const auto& b = A[0, 1];
1646 const auto& c = A[0, 2];
1647 const auto& d = A[0, 3];
1648 const auto& e = A[1, 0];
1649 const auto& f = A[1, 1];
1650 const auto& g = A[1, 2];
1651 const auto& h = A[1, 3];
1652 const auto& i = A[2, 0];
1653 const auto& j = A[2, 1];
1654 const auto& k = A[2, 2];
1655 const auto& l = A[2, 3];
1656 const auto& m = A[3, 0];
1657 const auto& n = A[3, 1];
1658 const auto& o = A[3, 2];
1659 const auto& p = A[3, 3];
1661 auto afk = a * f * k;
1662 auto afl = a * f * l;
1663 auto afo = a * f * o;
1664 auto afp = a * f * p;
1665 auto agj = a * g * j;
1666 auto agl = a * g * l;
1667 auto agn = a * g * n;
1668 auto agp = a * g * p;
1669 auto ahj = a * h * j;
1670 auto ahk = a * h * k;
1671 auto ahn = a * h * n;
1672 auto aho = a * h * o;
1673 auto ajo = a * j * o;
1674 auto ajp = a * j * p;
1675 auto akn = a * k * n;
1676 auto akp = a * k * p;
1677 auto aln = a * l * n;
1678 auto alo = a * l * o;
1679 auto bek = b * e * k;
1680 auto bel = b * e * l;
1681 auto beo = b * e * o;
1682 auto bep = b * e * p;
1683 auto bgi = b * g * i;
1684 auto bgl = b * g * l;
1685 auto bgm = b * g * m;
1686 auto bgp = b * g * p;
1687 auto bhi = b * h * i;
1688 auto bhk = b * h * k;
1689 auto bhm = b * h * m;
1690 auto bho = b * h * o;
1691 auto bio = b * i * o;
1692 auto bip = b * i * p;
1693 auto bjp = b * j * p;
1694 auto bkm = b * k * m;
1695 auto bkp = b * k * p;
1696 auto blm = b * l * m;
1697 auto blo = b * l * o;
1698 auto cej = c * e * j;
1699 auto cel = c * e * l;
1700 auto cen = c * e * n;
1701 auto cep = c * e * p;
1702 auto cfi = c * f * i;
1703 auto cfl = c * f * l;
1704 auto cfm = c * f * m;
1705 auto cfp = c * f * p;
1706 auto chi = c * h * i;
1707 auto chj = c * h * j;
1708 auto chm = c * h * m;
1709 auto chn = c * h * n;
1710 auto cin = c * i * n;
1711 auto cip = c * i * p;
1712 auto cjm = c * j * m;
1713 auto cjp = c * j * p;
1714 auto clm = c * l * m;
1715 auto cln = c * l * n;
1716 auto dej = d * e * j;
1717 auto dek = d * e * k;
1718 auto den = d * e * n;
1719 auto deo = d * e * o;
1720 auto dfi = d * f * i;
1721 auto dfk = d * f * k;
1722 auto dfm = d * f * m;
1723 auto dfo = d * f * o;
1724 auto dgi = d * g * i;
1725 auto dgj = d * g * j;
1726 auto dgm = d * g * m;
1727 auto dgn = d * g * n;
1728 auto din = d * i * n;
1729 auto dio = d * i * o;
1730 auto djm = d * j * m;
1731 auto djo = d * j * o;
1732 auto dkm = d * k * m;
1733 auto dkn = d * k * n;
1734 auto ejo = e * j * o;
1735 auto ejp = e * j * p;
1736 auto ekn = e * k * n;
1737 auto ekp = e * k * p;
1738 auto eln = e * l * n;
1739 auto elo = e * l * o;
1740 auto fio = f * i * o;
1741 auto fip = f * i * p;
1742 auto fkm = f * k * m;
1743 auto fkp = f * k * p;
1744 auto flm = f * l * m;
1745 auto flo = f * l * o;
1746 auto gin = g * i * n;
1747 auto gip = g * i * p;
1748 auto gjm = g * j * m;
1749 auto gjp = g * j * p;
1750 auto glm = g * l * m;
1751 auto gln = g * l * n;
1752 auto hin = h * i * n;
1753 auto hio = h * i * o;
1754 auto hjm = h * j * m;
1755 auto hjo = h * j * o;
1756 auto hkm = h * k * m;
1757 auto hkn = h * k * n;
1759 auto adj_A00 = fkp - flo - gjp + gln + hjo - hkn;
1760 auto adj_A01 = -bkp + blo + cjp - cln - djo + dkn;
1761 auto adj_A02 = bgp - bho - cfp + chn + dfo - dgn;
1762 auto adj_A03 = -bgl + bhk + cfl - chj - dfk + dgj;
1763 auto adj_A10 = -ekp + elo + gip - glm - hio + hkm;
1764 auto adj_A11 = akp - alo - cip + clm + dio - dkm;
1765 auto adj_A12 = -agp + aho + cep - chm - deo + dgm;
1766 auto adj_A13 = agl - ahk - cel + chi + dek - dgi;
1767 auto adj_A20 = ejp - eln - fip + flm + hin - hjm;
1768 auto adj_A21 = -ajp + aln + bip - blm - din + djm;
1769 auto adj_A22 = afp - ahn - bep + bhm + den - dfm;
1770 auto adj_A23 = -afl + ahj + bel - bhi - dej + dfi;
1771 auto adj_A30 = -ejo + ekn + fio - fkm - gin + gjm;
1773 auto adj_A31 = ajo - akn - bio + bkm + cin - cjm;
1774 auto adj_A32 = -afo + agn + beo - bgm - cen + cfm;
1775 auto adj_A33 = afk - agj - bek + bgi + cej - cfi;
1777 VariableMatrix adj_A{{adj_A00, adj_A01, adj_A02, adj_A03},
1778 {adj_A10, adj_A11, adj_A12, adj_A13},
1779 {adj_A20, adj_A21, adj_A22, adj_A23},
1780 {adj_A30, adj_A31, adj_A32, adj_A33}};
1781 auto det_A = a * adj_A00 + b * adj_A10 + c * adj_A20 + d * adj_A30;
1782 return adj_A / det_A * B;
1785 Eigen::Matrix<Variable<Scalar>, Eigen::Dynamic, Eigen::Dynamic>;
1787 MatrixXv eigen_A{A.rows(), A.cols()};
1788 for (
int row = 0; row < A.rows(); ++row) {
1789 for (
int col = 0; col < A.cols(); ++col) {
1790 eigen_A(row, col) = A[row, col];
1794 MatrixXv eigen_B{B.rows(), B.cols()};
1795 for (
int row = 0; row < B.rows(); ++row) {
1796 for (
int col = 0; col < B.cols(); ++col) {
1797 eigen_B(row, col) = B[row, col];
1801 MatrixXv eigen_X = eigen_A.householderQr().solve(eigen_B);
1803 VariableMatrix<Scalar> X{detail::empty, A.cols(), B.cols()};
1804 for (
int row = 0; row < X.rows(); ++row) {
1805 for (
int col = 0; col < X.cols(); ++col) {
1806 X[row, col] = eigen_X(row, col);
1814extern template SLEIPNIR_DLLEXPORT VariableMatrix<double> solve(
1815 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:1342
VariableMatrix(std::initializer_list< std::initializer_list< Variable< Scalar > > > list)
Definition variable_matrix.hpp:87
const_reverse_iterator crend() const
Definition variable_matrix.hpp:1351
Scalar_ Scalar
Definition variable_matrix.hpp:40
iterator end()
Definition variable_matrix.hpp:1275
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:1360
static VariableMatrix< Scalar > zero(int rows, int cols)
Definition variable_matrix.hpp:1369
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:1021
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:957
VariableMatrix & operator-=(const ScalarLike auto &rhs)
Definition variable_matrix.hpp:1043
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:754
Scalar value(int index)
Definition variable_matrix.hpp:1128
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:1296
const_iterator begin() const
Definition variable_matrix.hpp:1282
const_iterator cend() const
Definition variable_matrix.hpp:1303
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > value()
Definition variable_matrix.hpp:1135
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:772
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:937
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:1120
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:1386
VariableMatrix & operator+=(const MatrixLike auto &rhs)
Definition variable_matrix.hpp:915
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:1060
VariableMatrix< Scalar > T() const
Definition variable_matrix.hpp:1087
VariableMatrix< Scalar > cwise_transform(function_ref< Variable< Scalar >(const Variable< Scalar > &x)> unary_op) const
Definition variable_matrix.hpp:1154
friend VariableMatrix< Scalar > operator*(const LHS &lhs, const RHS &rhs)
Definition variable_matrix.hpp:576
const_reverse_iterator rbegin() const
Definition variable_matrix.hpp:1324
VariableMatrix(const Variable< Scalar > &variable)
Definition variable_matrix.hpp:210
reverse_iterator rend()
Definition variable_matrix.hpp:1317
VariableMatrix(const VariableBlock< const VariableMatrix > &values)
Definition variable_matrix.hpp:246
int rows() const
Definition variable_matrix.hpp:1104
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:1333
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:1289
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:1268
const VariableBlock< const VariableMatrix > segment(int offset, int length) const
Definition variable_matrix.hpp:517
reverse_iterator rbegin()
Definition variable_matrix.hpp:1310
VariableBlock< VariableMatrix > row(int row)
Definition variable_matrix.hpp:531
friend VariableMatrix< Scalar > operator+(const LHS &lhs, const RHS &rhs)
Definition variable_matrix.hpp:851
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:833
const Variable< Scalar > & operator[](int index) const
Definition variable_matrix.hpp:384
int cols() const
Definition variable_matrix.hpp:1111
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