/*************************************************************************** * 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" namespace MbD { template class FullMatrix : public RowTypeMatrix> { public: FullMatrix() {} FullMatrix(int m) : RowTypeMatrix>(m) { } FullMatrix(int m, int n) { for (int i = 0; i < m; i++) { auto row = std::make_shared>(n); this->push_back(row); } } FullMatrix(std::initializer_list> listOfRows) { for (auto& row : listOfRows) { this->push_back(row); } } FullMatrix(std::initializer_list> list2D) { for (auto& rowList : list2D) { auto row = std::make_shared>(rowList); this->push_back(row); } } static FMatsptr rotatex(T angle); static FMatsptr rotatey(T angle); static FMatsptr rotatez(T angle); static FMatsptr rotatexrotDot(T angle, T angledot); static FMatsptr rotateyrotDot(T angle, T angledot); static FMatsptr rotatezrotDot(T angle, T angledot); static FMatsptr rotatexrotDotrotDDot(T angle, T angleDot, T angleDDot); static FMatsptr rotateyrotDotrotDDot(T angle, T angleDot, T angleDDot); static FMatsptr rotatezrotDotrotDDot(T angle, T angleDot, T angleDDot); static FMatsptr identitysptr(int n); static FMatsptr tildeMatrix(FColDsptr col); void identity(); FColsptr column(int j); FColsptr timesFullColumn(FColsptr fullCol); FColsptr timesFullColumn(FullColumn* fullCol); FMatsptr timesFullMatrix(FMatsptr fullMat); FMatsptr timesTransposeFullMatrix(FMatsptr fullMat); FMatsptr times(T a); FMatsptr transposeTimesFullMatrix(FMatsptr fullMat); FMatsptr plusFullMatrix(FMatsptr fullMat); FMatsptr minusFullMatrix(FMatsptr fullMat); FMatsptr transpose(); FMatsptr negated(); void symLowerWithUpper(); void atiput(int i, FRowsptr fullRow) override; void atijput(int i, int j, T value); void atijputFullColumn(int i, int j, FColsptr fullCol); void atijplusFullRow(int i, int j, FRowsptr fullRow); void atijplusNumber(int i, int j, T value); void atijminusNumber(int i, int j, T value); double sumOfSquares() override; void zeroSelf() override; FMatsptr copy(); FullMatrix operator+(const FullMatrix fullMat); FColsptr transposeTimesFullColumn(const FColsptr fullCol); void magnifySelf(T factor); std::shared_ptr> asEulerParameters(); T trace(); double maxMagnitude() override; FColsptr bryantAngles(); bool isDiagonal(); bool isDiagonalToWithin(double ratio); std::shared_ptr> asDiagonalMatrix(); void conditionSelfWithTol(double tol); std::ostream& printOn(std::ostream& s) const override; }; }