Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[linalg] improve documentation #360

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions linalg/eigen/fcarouge/linalg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ For more information, please refer to <https://unlicense.org> */
//! @file
//! @brief Linear algebra facade for Eigen3 third party implementation.
//!
//! @details Standardizes matrix, vectors, and algebraic values type names for
//! the library usage.
//! @details Matrix, vectors, and named algebraic values.
//!
//! @note The Eigen3 linear algebra is not constexpr-compatible.
//! @note The Eigen3 linear algebra is not constexpr-compatible as of July 2023.

#include "fcarouge/utility.hpp"

Expand Down
16 changes: 7 additions & 9 deletions linalg/lazy/fcarouge/linalg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org> */

#ifndef FCAROUGE_LINALG_LAZY_HPP
#define FCAROUGE_LINALG_LAZY_HPP
#ifndef FCAROUGE_LINALG_HPP
#define FCAROUGE_LINALG_HPP

//! @file
//! @brief Linear algebra facade for a coroutine-based lazy implementation.
//! @brief Linear algebra coroutine-based lazy implementation.
//!
//! @details Standardizes matrix, vectors, and algebraic values type names for
//! the library usage.
//! @details Matrix, vectors, and named algebraic values.
//!
//! @note Idea from:
//! https://gieseanw.wordpress.com/2019/10/20/we-dont-need-no-stinking-expression-templates/
Expand All @@ -60,7 +59,6 @@ For more information, please refer to <https://unlicense.org> */
#include <utility>

namespace fcarouge {

// Semantic? Guarantees? to_generator? std::ranges::to overload? make_generator?
// Overloads for C-array?
// Need one copy, avoid any extra?
Expand Down Expand Up @@ -323,7 +321,7 @@ auto make_zero_generator{[]() -> std::generator<Type> {

//! @name Algebraic Named Values
//! @{
//! @brief The identity matrix.
//! @brief The identity matrix lazy specialization.
template <typename Type, auto Row, auto Column>
auto identity_v<matrix<Type, Row, Column>>{[](auto... args) {
matrix<Type, Row, Column, true> m{
Expand All @@ -335,7 +333,7 @@ auto identity_v<matrix<Type, Row, Column>>{[](auto... args) {
}
}};

//! @brief The zero matrix.
//! @brief The zero matrix lazy specialization.
template <typename Type, auto Row, auto Column>
auto zero_v<matrix<Type, Row, Column>>{[](auto... args) {
matrix<Type, Row, Column, true> m{make_zero_generator<Type, Row, Column>()};
Expand Down Expand Up @@ -414,4 +412,4 @@ operator+(matrix<Type, Row, Column> lhs, matrix<Type, Row, Column> rhs) {
}
} // namespace fcarouge

#endif // FCAROUGE_LINALG_LAZY_HPP
#endif // FCAROUGE_LINALG_HPP
9 changes: 7 additions & 2 deletions linalg/naive/fcarouge/linalg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ For more information, please refer to <https://unlicense.org> */
#ifndef FCAROUGE_LINALG_HPP
#define FCAROUGE_LINALG_HPP

//! @file
//! @brief Linear algebra array-based naive implementation.
//!
//! @details Matrix, vectors, and named algebraic values.

#include "fcarouge/utility.hpp"

#include <initializer_list>
Expand Down Expand Up @@ -166,7 +171,7 @@ matrix(const Type (&)[Row]) -> matrix<Type, Row, 1>; // column_vector

//! @name Algebraic Named Values
//! @{
//! @brief Identity
//! @brief The identity matrix naive specialization.
template <typename Type>
inline constexpr Type identity_v<matrix<Type, 1, 1>>{1.0};

Expand All @@ -189,7 +194,7 @@ inline constexpr matrix<Type, Row, Column>
return result;
}()};

//! @brief Zero
//! @brief The zero matrix naive specialization.
template <typename Type> inline constexpr Type zero_v<matrix<Type, 1, 1>>{};

template <typename Type, auto Row, auto Column>
Expand Down