LazyExpr#
-
template<typename Op, typename Lhs, typename Rhs>
class BinaryExpr<Op, Lhs, Rhs, std::enable_if_t<std::is_arithmetic<Rhs>::value>>#
-
template<typename Op, typename Lhs, typename Rhs>
class BinaryExpr<Op, Lhs, Rhs, std::enable_if_t<std::is_arithmetic<Lhs>::value>>#
-
namespace lm#
-
template<typename Op, typename Lhs, typename Rhs, typename = void>
class BinaryExpr# - #include <LazyExpr.hpp>
Template functor for binary expressions. Contains an abstract representation of binary ops and an API for recursively calling eval via
operator()
overload.- Template Parameters:
Op – Operator type specified in
LazyOps.hpp
Lhs – Left hand side of the expr.
Rhs – Righ hand side of the expr.
-
template<typename Op, typename T, std::size_t Rows1, std::size_t Cols1, std::size_t Rows2, std::size_t Cols2>
class BinaryExpr<Op, Matrix<T, Rows1, Cols1>, Matrix<T, Rows2, Cols2>>#
- template<typename Op, typename Lhs, typename Rhs> value > >
- template<typename Op, typename Lhs, typename Rhs> value > >
Public Functions
-
inline BinaryExpr(const Lhs &lhs, const Rhs &rhs)
-
inline auto operator()(std::size_t i, std::size_t j) const noexcept
-
inline auto rows() const -> std::pair<std::size_t, std::size_t>
-
inline auto cols() const -> std::pair<std::size_t, std::size_t>
Private Members
-
Lhs lhs
-
Rhs rhs
-
Op op
-
inline BinaryExpr(const Lhs &lhs, const Rhs &rhs)
-
template<typename Op, typename Expr>
class UnaryExpr# - #include <LazyExpr.hpp>
Template functor for unary expressions. Contains an abstract representation of unary ops and an API for recursively calling eval via
operator()
overload.- Template Parameters:
Op – Operator type specified in
LazyOps.hpp
Expr – Unary expression
-
template<typename Lhs, typename Rhs>
class MatMulExpr# - #include <LazyExpr.hpp>
Template functor for matrix multiplication expressions. Contains an operator() for evaluating the expression lazily. Works with
matmul(Expr, Expr)
types to represent MatMulExpr<Ops,Ops> computation *.- Template Parameters:
Lhs – Left hand side of the expr.
Rhs – Right hand side of the expr.
-
template<typename Op, typename Lhs, typename Rhs, typename = void>
LazyMatrix#
-
namespace lm
-
template<typename T, std::size_t Rows, std::size_t Cols>
class Matrix# Public Types
Public Functions
-
inline Matrix()#
-
inline constexpr auto rows() const -> std::size_t#
-
inline constexpr auto cols() const -> std::size_t#
-
inline constexpr auto cbegin() const -> const_iterator#
-
inline constexpr auto cend() const -> const_iterator#
-
inline Matrix()#
-
template<typename T, std::size_t Rows, std::size_t Cols>
LazyOps#
-
namespace lm
Functions
-
template<typename T, std::size_t Row, std::size_t Col>
constexpr auto operator==(const Matrix<T, Row, Col> &lhs, const Matrix<T, Row, Col> &rhs) -> bool#
-
template<typename T, std::size_t Row, std::size_t Col>
constexpr auto operator!=(const Matrix<T, Row, Col> &lhs, const Matrix<T, Row, Col> &rhs) -> bool#
-
template<typename Lhs, typename Rhs>
constexpr auto operator+(const Lhs &lhs, const Rhs &rhs) -> BinaryExpr<std::plus<>, Lhs, Rhs>#
-
template<typename Lhs, typename Rhs>
constexpr auto operator-(const Lhs &lhs, const Rhs &rhs) -> BinaryExpr<std::minus<>, Lhs, Rhs>#
-
template<typename Lhs, typename Rhs>
constexpr auto operator*(const Lhs &lhs, const Rhs &rhs) -> BinaryExpr<std::multiplies<>, Lhs, Rhs>#
-
template<typename Lhs, typename Rhs>
constexpr auto operator/(const Lhs &lhs, const Rhs &rhs) -> BinaryExpr<std::divides<>, Lhs, Rhs>#
-
template<typename Lhs, typename Rhs>
constexpr auto matmul(const Lhs &lhs, const Rhs &rhs) -> MatMulExpr<Lhs, Rhs>#
-
template<typename Lhs, typename Rhs>
constexpr auto operator%(const Lhs &lhs, const Rhs &rhs) -> BinaryExpr<ModOp, Lhs, Rhs>#
-
template<typename Lhs, typename Rhs, typename = typename std::enable_if_t<std::is_arithmetic_v<Rhs>>>
constexpr auto pow(const Lhs &lhs, const Rhs &rhs) -> BinaryExpr<PowOp, Lhs, Rhs>#
-
struct ModOp#
-
struct PowOp#
-
struct LogOp#
-
struct Log10Op#
-
struct Log2Op#
-
struct ExpOp#
-
struct Exp2Op#
-
struct SqrtOp#
-
struct CbrtOp#
-
struct SinOp#
-
struct CosOp#
-
struct TanOp#
-
struct ASinOp#
-
struct ACosOp#
-
struct ATanOp#
-
struct SinhOp#
-
struct CoshOp#
-
struct TanhOp#
-
struct ASinhOp#
-
struct ACoshOp#
-
struct ATanhOp#
-
struct ToDeg#
-
struct ToRad#
-
struct ErfOp#
-
struct ErfcOp#
-
struct TGammaOp#
-
struct LGammaOp#
-
struct CeilOp#
-
struct FloorOp#
-
template<typename T, std::size_t Row, std::size_t Col>
Utils#
-
namespace lm
Functions
-
template<typename T, std::size_t Row, std::size_t Col, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
auto make_matrix(std::reference_wrapper<std::mt19937> prng) -> Matrix<T, Row, Col># Returns a random matrix given by prng. This implements an
std::array
base and aligns the matrix in memory.- Template Parameters:
T – Type of the matrix; constrained to types supported by prng.
Row – Specifies the size of the row.
Col – Specifies the size of col.
- Parameters:
prng – function wrapper for prng, defaults to
std::mt19937
- Returns:
Matrix<T, Row, Col>
random matrix described by prng.
-
template<typename T, std::size_t Row, std::size_t Col, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
auto make_vmatrix(std::reference_wrapper<std::mt19937> prng) -> Matrix<T, Row, Col># Returns a random matrix given by prng. This implements
std::vector
base to hold for larger size matrices that goes beyond the stack limit ofstd::array
.- Template Parameters:
T – Type of the matrix; constrained to types supported by prng.
Row – Specifies the size of the row.
Col – Specifies the size of col.
- Parameters:
prng – function wrapper for prng, defaults to
std::mt19937
- Returns:
Matrix<T, Row, Col>
random matrix described by prng.
-
template<typename T, std::size_t Row, std::size_t Col>
auto operator<<(std::ostream &os, const lm::Matrix<T, Row, Col> &matrix) -> std::ostream&# Operator overload to display the matrix in
std::cout
.- Template Parameters:
T – Type of the matrix.
Row – Specifies the size of the row.
Col – Specifies the size of the col.
- Parameters:
os –
std::ostream
that records the buffer to be printed.matrix – matrix to be registered in the output buffer.
- Returns:
std::ostream&
reference output buffer
-
template<typename T, std::size_t Row>
auto operator<<(std::ostream &os, const std::array<T, Row> &v) -> std::ostream&# Operator overload to display the vector of type
std::array
.- Template Parameters:
T – Type of the vector
Row – Specifies the size of the row.
- Parameters:
os –
std::ostream
that records the buffer to be printed.v – vector to be registered in the output buffer
- Returns:
std::ostream&
reference to the output buffer
-
class Timer#
- #include <Utils.hpp>
Serves as a simple timer utility used for benchmarking performance.
-
template<typename T, std::size_t Row, std::size_t Col, typename = std::enable_if_t<std::is_arithmetic_v<T>>>