/*************************************************************************** * Copyright (c) 2023 Ondsel, Inc. * * * * This file is part of OndselSolver. * * * * See LICENSE file for details about copyright. * ***************************************************************************/ #pragma once #include "corecrt_math_defines.h" #include #include "FullMatrix.ref.h" #include "FullColumn.ref.h" #include "FullRow.ref.h" #include "DiagonalMatrix.ref.h" #include "EulerParameters.ref.h" #include "RowTypeMatrix.h" #include "FullRow.h" // now that refs are resolved, go do the full systems //#include "FullColumn.h" //#include "DiagonalMatrix.h" //#include "EulerParameters.h" namespace MbD { // // FULL MATRIX DOUBLE // class FullMatrixDouble : public RowTypeMatrix> { public: FullMatrixDouble() = default; explicit FullMatrixDouble(int m) : RowTypeMatrix>(m) { } FullMatrixDouble(int m, int n) { for (int i = 0; i < m; i++) { auto row = std::make_shared>(n); this->push_back(row); } } FullMatrixDouble(std::initializer_list> listOfRows) { for (auto& row : listOfRows) { this->push_back(row); } } FullMatrixDouble(std::initializer_list> list2D) { for (auto& rowList : list2D) { auto row = std::make_shared>(rowList); this->push_back(row); } } std::shared_ptr times(double a); std::shared_ptr timesTransposeFullMatrix(std::shared_ptr fullMat); void identity(); static std::shared_ptr identitysptr(int n); double sumOfSquares() override; std::shared_ptr transposeTimesFullMatrix(std::shared_ptr fullMat); std::shared_ptr timesFullMatrix(std::shared_ptr fullMat); std::shared_ptr transpose(); std::shared_ptr negated(); std::shared_ptr plusFullMatrix(std::shared_ptr fullMat); static std::shared_ptr rotatex(double angle); static std::shared_ptr rotatey(double angle); static std::shared_ptr rotatez(double angle); static std::shared_ptr rotatexrotDot(double angle, double angledot); static std::shared_ptr rotateyrotDot(double angle, double angledot); static std::shared_ptr rotatezrotDot(double angle, double angledot); static std::shared_ptr rotatexrotDotrotDDot(double angle, double angleDot, double angleDDot); static std::shared_ptr rotateyrotDotrotDDot(double angle, double angleDot, double angleDDot); static std::shared_ptr rotatezrotDotrotDDot(double angle, double angleDot, double angleDDot); static std::shared_ptr tildeMatrix(FColDsptr col); void zeroSelf() override; FColsptr column(int j); void atiput(int i, FRowsptr fullRow) override; void atijput(int i, int j, double value); std::shared_ptr copy(); double maxMagnitude() override; FullMatrixDouble operator+(const FullMatrixDouble fullMat); std::shared_ptr minusFullMatrix(std::shared_ptr fullMat); FColsptr transposeTimesFullColumn(FColsptr fullCol); void symLowerWithUpper(); void atijputFullColumn(int i1, int j1, FColsptr fullCol); void atijplusFullRow(int i, int j, FRowsptr fullRow); void atijplusNumber(int i, int j, double value); void atijminusNumber(int i, int j, double value); void magnifySelf(double factor); std::shared_ptr> asEulerParameters(); FColsptr bryantAngles(); double trace(); bool isDiagonal(); bool isDiagonalToWithin(double ratio); std::shared_ptr asDiagonalMatrix(); void conditionSelfWithTol(double tol); std::ostream& printOn(std::ostream& s) const override; FColsptr timesFullColumn(FColsptr fullCol); FColsptr timesFullColumn(FullColumn* fullCol); }; // // FULL MATRIX FULL MATRIX DOUBLE // class FullMatrixFullMatrixDouble : public RowTypeMatrix> { public: FullMatrixFullMatrixDouble() = default; explicit FullMatrixFullMatrixDouble(int m) : RowTypeMatrix>(m) { } FullMatrixFullMatrixDouble(int m, int n) { for (int i = 0; i < m; i++) { auto row = std::make_shared>(n); this->push_back(row); } } double maxMagnitude() override; void zeroSelf() override; std::shared_ptr times(double a); // std::shared_ptr timesTransposeFullMatrix(std::shared_ptr fullMat); double sumOfSquares() override; void identity(); static std::shared_ptr identitysptr(int n); }; // // FULL MATRIX FULL COLUMN DOUBLE // class FullMatrixFullColumnDouble : public RowTypeMatrix> { public: FullMatrixFullColumnDouble() = default; explicit FullMatrixFullColumnDouble(int m) : RowTypeMatrix>(m) { } FullMatrixFullColumnDouble(int m, int n) { for (int i = 0; i < m; i++) { auto row = std::make_shared>(n); this->push_back(row); } } double maxMagnitude() override; void zeroSelf() override; double sumOfSquares() override; void symLowerWithUpper(); std::shared_ptr times(double a); }; }