Skip to content

Commit

Permalink
Merge pull request #73 from beomki-yeo/jacobian-transformation
Browse files Browse the repository at this point in the history
Roll back to v0.13.0 and Remove coordinates
  • Loading branch information
beomki-yeo authored Sep 22, 2022
2 parents 051693b + d2b766c commit d02455f
Show file tree
Hide file tree
Showing 63 changed files with 1,365 additions and 2,757 deletions.
64 changes: 35 additions & 29 deletions frontend/array_cmath/include/algebra/array_cmath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,34 @@

#pragma once

// Operators include(s).
#include "algebra/math/cmath_operators.hpp"

// Project include(s).
#include "algebra/math/cmath.hpp"
#include "algebra/storage/array.hpp"

/// @name Operators on @c algebra::array::storage_type
/// @{

using algebra::cmath::operator*;
using algebra::cmath::operator-;
using algebra::cmath::operator+;

/// @}

namespace algebra {

namespace getter {

/// @name Getter functions on @c algebra::array::storage_type
/// @{

using cmath::eta;
using cmath::norm;
using cmath::perp;
using cmath::phi;
using cmath::theta;

/// @}

/// Function extracting a slice from a matrix
template <std::size_t SIZE, std::size_t ROWS, std::size_t COLS,
typename scalar_t>
Expand All @@ -38,20 +55,26 @@ using cmath::element;

} // namespace getter

using size_type = array::size_type;
namespace vector {

template <typename T, size_type N>
using array_type = array::storage_type<T, N>;
/// @name Vector functions on @c algebra::array::storage_type
/// @{

namespace vector {
using cmath::cross;
using cmath::dot;
using cmath::normalize;

template <typename scalar_t>
using actor = cmath::vector::actor<size_type, array_type, scalar_t>;
/// @}

} // namespace vector

namespace matrix {

using size_type = array::size_type;

template <typename T, size_type N>
using array_type = array::storage_type<T, N>;

template <typename T, size_type ROWS, size_type COLS>
using matrix_type = array::matrix_type<T, ROWS, COLS>;

Expand Down Expand Up @@ -127,27 +150,10 @@ namespace array {
/// @{

template <typename T>
using transform3_matrix_actor =
matrix::actor<T, matrix::determinant::preset0<T>,
matrix::inverse::preset0<T>>;
template <typename T>
using transform3_vector_actor = vector::actor<T>;

template <typename T>
using transform3 =
cmath::transform3<transform3_matrix_actor<T>, transform3_vector_actor<T>>;
template <typename T>
using cartesian2 = cmath::coordinate::cartesian2<transform3<T>>;
template <typename T>
using cartesian3 = cmath::coordinate::cartesian3<transform3<T>>;
template <typename T>
using polar2 = cmath::coordinate::polar2<transform3<T>>;
template <typename T>
using cylindrical2 = cmath::coordinate::cylindrical2<transform3<T>>;
template <typename T>
using cylindrical3 = cmath::coordinate::cylindrical3<transform3<T>>;
using transform3_actor = matrix::actor<T, matrix::determinant::preset0<T>,
matrix::inverse::preset0<T>>;
template <typename T>
using line2 = cmath::coordinate::line2<transform3<T>>;
using transform3 = cmath::transform3<transform3_actor<T>>;

/// @}

Expand Down
44 changes: 24 additions & 20 deletions frontend/eigen_cmath/include/algebra/eigen_cmath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ namespace algebra {

namespace getter {

/// @name Getter functions on @c algebra::eigen::storage_type
/// @{

using eigen::math::eta;
using eigen::math::norm;
using eigen::math::perp;
using eigen::math::phi;
using eigen::math::theta;

/// @}

/// Function extracting a slice from the matrix used by
/// @c algebra::eigen::transform3
template <unsigned int SIZE, typename derived_type>
Expand All @@ -44,18 +55,24 @@ using eigen::math::element;

} // namespace getter

using size_type = eigen::size_type;
template <typename T, size_type N>
using array_type = eigen::storage_type<T, N>;

namespace vector {

using actor = eigen::vector::actor;
/// @name Vector functions on @c algebra::eigen::storage_type
/// @{

using eigen::math::cross;
using eigen::math::dot;
using eigen::math::normalize;

/// @}

} // namespace vector

namespace matrix {

using size_type = eigen::size_type;
template <typename T, size_type N>
using array_type = eigen::storage_type<T, N>;
template <typename T, size_type ROWS, size_type COLS>
using matrix_type = eigen::matrix_type<T, ROWS, COLS>;
using element_getter = eigen::math::element_getter;
Expand Down Expand Up @@ -126,25 +143,12 @@ namespace eigen {
/// @{

template <typename T>
using transform3_matrix_actor =
using transform3_actor =
algebra::matrix::actor<T, algebra::matrix::determinant::preset0<T>,
algebra::matrix::inverse::preset0<T>>;

template <typename T>
using transform3 =
cmath::transform3<transform3_matrix_actor<T>, algebra::vector::actor>;
template <typename T>
using cartesian2 = cmath::coordinate::cartesian2<transform3<T>>;
template <typename T>
using cartesian3 = cmath::coordinate::cartesian3<transform3<T>>;
template <typename T>
using polar2 = cmath::coordinate::polar2<transform3<T>>;
template <typename T>
using cylindrical2 = cmath::coordinate::cylindrical2<transform3<T>>;
template <typename T>
using cylindrical3 = cmath::coordinate::cylindrical3<transform3<T>>;
template <typename T>
using line2 = cmath::coordinate::line2<transform3<T>>;
using transform3 = cmath::transform3<transform3_actor<T>>;

/// @}

Expand Down
40 changes: 21 additions & 19 deletions frontend/eigen_eigen/include/algebra/eigen_eigen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

// Project include(s).
#include "algebra/math/cmath.hpp"
#include "algebra/math/eigen.hpp"
#include "algebra/storage/eigen.hpp"

Expand All @@ -22,6 +23,17 @@ namespace algebra {

namespace getter {

/// @name Getter functions on @c algebra::eigen::storage_type
/// @{

using eigen::math::eta;
using eigen::math::norm;
using eigen::math::perp;
using eigen::math::phi;
using eigen::math::theta;

/// @}

/// Function extracting a slice from the matrix used by
/// @c algebra::eigen::transform3
template <unsigned int SIZE, typename derived_type>
Expand All @@ -42,7 +54,14 @@ using eigen::math::element;

namespace vector {

using actor = eigen::vector::actor;
/// @name Vector functions on @c algebra::eigen::storage_type
/// @{

using eigen::math::cross;
using eigen::math::dot;
using eigen::math::normalize;

/// @}

} // namespace vector

Expand All @@ -55,25 +74,8 @@ using actor = eigen::matrix::actor<scalar_t>;

namespace eigen {

/// @name Eigen based transforms on @c algebra::eigen::storage_type
/// @{

template <typename T>
using transform3 = math::transform3<T, algebra::vector::actor>;
template <typename T>
using cartesian2 = eigen::coordinate::cartesian2<transform3<T>>;
template <typename T>
using cartesian3 = eigen::coordinate::cartesian3<transform3<T>>;
template <typename T>
using polar2 = eigen::coordinate::polar2<transform3<T>>;
template <typename T>
using cylindrical2 = eigen::coordinate::cylindrical2<transform3<T>>;
template <typename T>
using cylindrical3 = eigen::coordinate::cylindrical3<transform3<T>>;
template <typename T>
using line2 = eigen::coordinate::line2<transform3<T>>;

/// @}
using transform3 = math::transform3<T, matrix::actor<T>>;

} // namespace eigen

Expand Down
49 changes: 24 additions & 25 deletions frontend/smatrix_cmath/include/algebra/smatrix_cmath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
namespace algebra {
namespace getter {

/// @name Getter functions on @c algebra::smatrix::storage_type
/// @{

using smatrix::math::eta;
using smatrix::math::norm;
using smatrix::math::perp;
using smatrix::math::phi;
using smatrix::math::theta;

/// @}

/// Function extracting a slice from the matrix used by
/// @c algebra::smatrix::transform3
template <unsigned int SIZE, unsigned int ROWS, unsigned int COLS,
Expand All @@ -38,19 +49,24 @@ using smatrix::math::element;

} // namespace getter

using size_type = smatrix::size_type;
template <typename T, size_type N>
using array_type = smatrix::storage_type<T, N>;

namespace vector {

template <typename scalar_t>
using actor = smatrix::vector::actor<scalar_t>;
/// @name Vector functions on @c algebra::smatrix::storage_type
/// @{

using smatrix::math::cross;
using smatrix::math::dot;
using smatrix::math::normalize;

/// @}

} // namespace vector

namespace matrix {

using size_type = smatrix::size_type;
template <typename T, size_type N>
using array_type = smatrix::storage_type<T, N>;
template <typename T, size_type ROWS, size_type COLS>
using matrix_type = smatrix::matrix_type<T, ROWS, COLS>;
template <typename scalar_t>
Expand Down Expand Up @@ -124,28 +140,11 @@ namespace smatrix {
/// @{

template <typename T>
using transform3_matrix_actor =
using transform3_actor =
algebra::matrix::actor<T, algebra::matrix::determinant::preset0<T>,
algebra::matrix::inverse::preset0<T>>;

template <typename T>
using transform3_vector_actor = algebra::vector::actor<T>;

template <typename T>
using transform3 =
cmath::transform3<transform3_matrix_actor<T>, transform3_vector_actor<T>>;
template <typename T>
using cartesian2 = cmath::coordinate::cartesian2<transform3<T>>;
template <typename T>
using cartesian3 = cmath::coordinate::cartesian3<transform3<T>>;
template <typename T>
using polar2 = cmath::coordinate::polar2<transform3<T>>;
template <typename T>
using cylindrical2 = cmath::coordinate::cylindrical2<transform3<T>>;
template <typename T>
using cylindrical3 = cmath::coordinate::cylindrical3<transform3<T>>;
template <typename T>
using line2 = cmath::coordinate::line2<transform3<T>>;
using transform3 = cmath::transform3<transform3_actor<T>>;

/// @}

Expand Down
35 changes: 20 additions & 15 deletions frontend/smatrix_smatrix/include/algebra/smatrix_smatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ namespace algebra {

namespace getter {

/// @name Getter functions on @c algebra::smatrix::storage_type
/// @{

using smatrix::math::eta;
using smatrix::math::norm;
using smatrix::math::perp;
using smatrix::math::phi;
using smatrix::math::theta;

/// @}

/// Function extracting a slice from the matrix used by
/// @c algebra::smatrix::transform3
template <unsigned int SIZE, unsigned int ROWS, unsigned int COLS,
Expand All @@ -37,8 +48,14 @@ using smatrix::math::element;

namespace vector {

template <typename scalar_t>
using actor = smatrix::vector::actor<scalar_t>;
/// @name Vector functions on @c algebra::smatrix::storage_type
/// @{

using smatrix::math::cross;
using smatrix::math::dot;
using smatrix::math::normalize;

/// @}

} // namespace vector

Expand All @@ -55,19 +72,7 @@ namespace smatrix {
/// @{

template <typename T>
using transform3 = math::transform3<T, algebra::vector::actor<T>>;
template <typename T>
using cartesian2 = smatrix::coordinate::cartesian2<transform3<T>>;
template <typename T>
using cartesian3 = smatrix::coordinate::cartesian3<transform3<T>>;
template <typename T>
using polar2 = smatrix::coordinate::polar2<transform3<T>>;
template <typename T>
using cylindrical2 = smatrix::coordinate::cylindrical2<transform3<T>>;
template <typename T>
using cylindrical3 = smatrix::coordinate::cylindrical3<transform3<T>>;
template <typename T>
using line2 = smatrix::coordinate::line2<transform3<T>>;
using transform3 = math::transform3<T, matrix::actor<T>>;

/// @}

Expand Down
Loading

0 comments on commit d02455f

Please sign in to comment.