From ae7ab0c29bb3de213debfd8cfd67dc8dbf89c7db Mon Sep 17 00:00:00 2001 From: John Dupuy Date: Thu, 2 Nov 2023 18:12:13 -0500 Subject: [PATCH] Added reference headers and moved some code. --- CMakeLists.txt | 23 +- OndselSolver/DiagonalMatrix.h | 7 +- OndselSolver/DiagonalMatrix.ref.h | 11 + OndselSolver/EulerParameters.cpp | 289 +++++++++++++++++++++++ OndselSolver/EulerParameters.h | 292 +----------------------- OndselSolver/EulerParameters.ref.h | 6 + OndselSolver/FullColumn.h | 22 +- OndselSolver/FullColumn.ref.h | 11 + OndselSolver/FullMatrix.cpp | 209 +++++++++++++++++ OndselSolver/FullMatrix.h | 239 +------------------ OndselSolver/FullMatrix.ref.h | 20 ++ OndselSolver/FullRow.cpp | 3 +- OndselSolver/FullRow.h | 15 +- OndselSolver/FullRow.ref.h | 14 ++ OndselSolver/RowTypeMatrix.cpp | 10 + OndselSolver/RowTypeMatrix.h | 11 +- OndselSolver/StableBackwardDifference.h | 1 + 17 files changed, 610 insertions(+), 573 deletions(-) create mode 100644 OndselSolver/DiagonalMatrix.ref.h create mode 100644 OndselSolver/EulerParameters.ref.h create mode 100644 OndselSolver/FullColumn.ref.h create mode 100644 OndselSolver/FullMatrix.ref.h create mode 100644 OndselSolver/FullRow.ref.h diff --git a/CMakeLists.txt b/CMakeLists.txt index fca0a81..c7ce907 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,12 @@ include(GNUInstallDirs) add_library(OndselSolver STATIC) set(ONDSELSOLVER_SRC + OndselSolver/Array.cpp + OndselSolver/FullVector.cpp + OndselSolver/RowTypeMatrix.cpp + OndselSolver/FullColumn.cpp + OndselSolver/FullMatrix.cpp + OndselSolver/FullRow.cpp OndselSolver/Abs.cpp OndselSolver/AbsConstraint.cpp OndselSolver/AccICKineNewtonRaphson.cpp @@ -25,7 +31,6 @@ set(ONDSELSOLVER_SRC OndselSolver/ArcSine.cpp OndselSolver/ArcTan.cpp OndselSolver/ArcTan2.cpp - OndselSolver/Array.cpp OndselSolver/ASMTAnimationParameters.cpp OndselSolver/ASMTAssembly.cpp OndselSolver/ASMTConstantGravity.cpp @@ -146,11 +151,7 @@ set(ONDSELSOLVER_SRC OndselSolver/FixedJoint.cpp OndselSolver/ForceTorqueData.cpp OndselSolver/ForceTorqueItem.cpp - OndselSolver/FullColumn.cpp - OndselSolver/FullMatrix.cpp OndselSolver/FullMotion.cpp - OndselSolver/FullRow.cpp - OndselSolver/FullVector.cpp OndselSolver/Function.cpp OndselSolver/FunctionFromData.cpp OndselSolver/FunctionWithManyArgs.cpp @@ -248,7 +249,6 @@ set(ONDSELSOLVER_SRC OndselSolver/RedundantConstraint.cpp OndselSolver/RevCylJoint.cpp OndselSolver/RevoluteJoint.cpp - OndselSolver/RowTypeMatrix.cpp OndselSolver/ScalarNewtonRaphson.cpp OndselSolver/ScrewConstraintIJ.cpp OndselSolver/ScrewConstraintIqcJc.cpp @@ -296,6 +296,12 @@ set(ONDSELSOLVER_SRC ) set(ONDSELSOLVER_HEADERS + OndselSolver/Array.h + OndselSolver/FullVector.h + OndselSolver/RowTypeMatrix.h + OndselSolver/FullRow.h + OndselSolver/FullColumn.h + OndselSolver/FullMatrix.h OndselSolver/Abs.h OndselSolver/AbsConstraint.h OndselSolver/AccICKineNewtonRaphson.h @@ -312,7 +318,6 @@ set(ONDSELSOLVER_HEADERS OndselSolver/ArcSine.h OndselSolver/ArcTan.h OndselSolver/ArcTan2.h - OndselSolver/Array.h OndselSolver/ASMTAnimationParameters.h OndselSolver/ASMTAssembly.h OndselSolver/ASMTConstantGravity.h @@ -435,11 +440,8 @@ set(ONDSELSOLVER_HEADERS OndselSolver/FixedJoint.h OndselSolver/ForceTorqueData.h OndselSolver/ForceTorqueItem.h - OndselSolver/FullColumn.h - OndselSolver/FullMatrix.h OndselSolver/FullMotion.h OndselSolver/FullRow.h - OndselSolver/FullVector.h OndselSolver/Function.h OndselSolver/FunctionFromData.h OndselSolver/FunctionWithManyArgs.h @@ -538,7 +540,6 @@ set(ONDSELSOLVER_HEADERS OndselSolver/resource.h OndselSolver/RevCylJoint.h OndselSolver/RevoluteJoint.h - OndselSolver/RowTypeMatrix.h OndselSolver/ScalarNewtonRaphson.h OndselSolver/ScrewConstraintIJ.h OndselSolver/ScrewConstraintIqcJc.h diff --git a/OndselSolver/DiagonalMatrix.h b/OndselSolver/DiagonalMatrix.h index 69c0c28..13010c3 100644 --- a/OndselSolver/DiagonalMatrix.h +++ b/OndselSolver/DiagonalMatrix.h @@ -8,17 +8,12 @@ #pragma once +#include "DiagonalMatrix.ref.h" #include "Array.h" #include "FullColumn.h" #include "FullMatrix.h" namespace MbD { - template - class DiagonalMatrix; - template - using DiagMatsptr = std::shared_ptr>; - using DiagMatDsptr = std::shared_ptr>; - template class DiagonalMatrix : public Array { diff --git a/OndselSolver/DiagonalMatrix.ref.h b/OndselSolver/DiagonalMatrix.ref.h new file mode 100644 index 0000000..ea01948 --- /dev/null +++ b/OndselSolver/DiagonalMatrix.ref.h @@ -0,0 +1,11 @@ +#pragma once + +#include + +namespace MbD { + template + class DiagonalMatrix; + template + using DiagMatsptr = std::shared_ptr>; + using DiagMatDsptr = std::shared_ptr>; +} \ No newline at end of file diff --git a/OndselSolver/EulerParameters.cpp b/OndselSolver/EulerParameters.cpp index a9cf51f..31b5672 100644 --- a/OndselSolver/EulerParameters.cpp +++ b/OndselSolver/EulerParameters.cpp @@ -9,3 +9,292 @@ #include "EulerParameters.h" using namespace MbD; +template<> +inline FMatFColDsptr EulerParameters::ppApEpEtimesColumn(FColDsptr col) +{ + double a2c0 = 2 * col->at(0); + double a2c1 = 2 * col->at(1); + double a2c2 = 2 * col->at(2); + double m2c0 = 0 - a2c0; + double m2c1 = 0 - a2c1; + double m2c2 = 0 - a2c2; + auto col00 = std::make_shared>(ListD{ a2c0, m2c1, m2c2 }); + auto col01 = std::make_shared>(ListD{ a2c1, a2c0, 0 }); + auto col02 = std::make_shared>(ListD{ a2c2, 0, a2c0 }); + auto col03 = std::make_shared>(ListD{ 0, m2c2, a2c1 }); + auto col11 = std::make_shared>(ListD{ m2c0, a2c1, m2c2 }); + auto col12 = std::make_shared>(ListD{ 0, a2c2, a2c1 }); + auto col13 = std::make_shared>(ListD{ a2c2, 0, m2c0 }); + auto col22 = std::make_shared>(ListD{ m2c0, m2c1, a2c2 }); + auto col23 = std::make_shared>(ListD{ m2c1, a2c0, 0 }); + auto col33 = std::make_shared>(ListD{ a2c0, a2c1, a2c2 }); + auto answer = std::make_shared>(4, 4); + auto& row0 = answer->at(0); + row0->at(0) = col00; + row0->at(1) = col01; + row0->at(2) = col02; + row0->at(3) = col03; + auto& row1 = answer->at(1); + row1->at(0) = col01; + row1->at(1) = col11; + row1->at(2) = col12; + row1->at(3) = col13; + auto& row2 = answer->at(2); + row2->at(0) = col02; + row2->at(1) = col12; + row2->at(2) = col22; + row2->at(3) = col23; + auto& row3 = answer->at(3); + row3->at(0) = col03; + row3->at(1) = col13; + row3->at(2) = col23; + row3->at(3) = col33; + return answer; +} + +template<> +inline FMatDsptr EulerParameters::pCpEtimesColumn(FColDsptr col) +{ + //"col size = 4." + auto c0 = col->at(0); + auto c1 = col->at(1); + auto c2 = col->at(2); + auto mc0 = -c0; + auto mc1 = -c1; + auto mc2 = -c2; + auto mc3 = -col->at(3); + auto answer = std::make_shared>(3, 4); + auto& row0 = answer->at(0); + auto& row1 = answer->at(1); + auto& row2 = answer->at(2); + row0->atiput(0, mc3); + row0->atiput(1, mc2); + row0->atiput(2, c1); + row0->atiput(3, c0); + row1->atiput(0, c2); + row1->atiput(1, mc3); + row1->atiput(2, mc0); + row1->atiput(3, c1); + row2->atiput(0, mc1); + row2->atiput(1, c0); + row2->atiput(2, mc3); + row2->atiput(3, c2); + return answer; +} + +template +inline FMatDsptr EulerParameters::pCTpEtimesColumn(FColDsptr col) +{ + //"col size = 3." + auto c0 = col->at(0); + auto c1 = col->at(1); + auto c2 = col->at(2); + auto mc0 = -c0; + auto mc1 = -c1; + auto mc2 = -c2; + auto answer = std::make_shared>(4, 4); + auto& row0 = answer->at(0); + auto& row1 = answer->at(1); + auto& row2 = answer->at(2); + auto& row3 = answer->at(3); + row0->atiput(0, 0.0); + row0->atiput(1, c2); + row0->atiput(2, mc1); + row0->atiput(3, c0); + row1->atiput(0, mc2); + row1->atiput(1, 0.0); + row1->atiput(2, c0); + row1->atiput(3, c1); + row2->atiput(0, c1); + row2->atiput(1, mc0); + row2->atiput(2, 0.0); + row2->atiput(3, c2); + row3->atiput(0, mc0); + row3->atiput(1, mc1); + row3->atiput(2, mc2); + row3->atiput(3, 0.0); + return answer; +} + +template<> +inline FMatFMatDsptr EulerParameters::ppApEpEtimesMatrix(FMatDsptr mat) +{ + FRowDsptr a2m0 = mat->at(0)->times(2.0); + FRowDsptr a2m1 = mat->at(1)->times(2.0); + FRowDsptr a2m2 = mat->at(2)->times(2.0); + FRowDsptr m2m0 = a2m0->negated(); + FRowDsptr m2m1 = a2m1->negated(); + FRowDsptr m2m2 = a2m2->negated(); + FRowDsptr zero = std::make_shared>(3, 0.0); + auto mat00 = std::make_shared>(ListFRD{ a2m0, m2m1, m2m2 }); + auto mat01 = std::make_shared>(ListFRD{ a2m1, a2m0, zero }); + auto mat02 = std::make_shared>(ListFRD{ a2m2, zero, a2m0 }); + auto mat03 = std::make_shared>(ListFRD{ zero, m2m2, a2m1 }); + auto mat11 = std::make_shared>(ListFRD{ m2m0, a2m1, m2m2 }); + auto mat12 = std::make_shared>(ListFRD{ zero, a2m2, a2m1 }); + auto mat13 = std::make_shared>(ListFRD{ a2m2, zero, m2m0 }); + auto mat22 = std::make_shared>(ListFRD{ m2m0, m2m1, a2m2 }); + auto mat23 = std::make_shared>(ListFRD{ m2m1, a2m0, zero }); + auto mat33 = std::make_shared>(ListFRD{ a2m0, a2m1, a2m2 }); + auto answer = std::make_shared>(4, 4); + auto& row0 = answer->at(0); + row0->at(0) = mat00; + row0->at(1) = mat01; + row0->at(2) = mat02; + row0->at(3) = mat03; + auto& row1 = answer->at(1); + row1->at(0) = mat01; + row1->at(1) = mat11; + row1->at(2) = mat12; + row1->at(3) = mat13; + auto& row2 = answer->at(2); + row2->at(0) = mat02; + row2->at(1) = mat12; + row2->at(2) = mat22; + row2->at(3) = mat23; + auto& row3 = answer->at(3); + row3->at(0) = mat03; + row3->at(1) = mat13; + row3->at(2) = mat23; + row3->at(3) = mat33; + return answer; +} + +template<> +inline void EulerParameters::initialize() +{ + aA = FullMatrix::identitysptr(3); + aB = std::make_shared>(3, 4); + aC = std::make_shared>(3, 4); + pApE = std::make_shared>(4); + for (int i = 0; i < 4; i++) + { + pApE->at(i) = std::make_shared>(3, 3); + } +} +template +inline void EulerParameters::calc() +{ + this->calcABC(); + this->calcpApE(); +} +template<> +inline void EulerParameters::calcABC() +{ + double aE0 = this->at(0); + double aE1 = this->at(1); + double aE2 = this->at(2); + double aE3 = this->at(3); + double mE0 = -aE0; + double mE1 = -aE1; + double mE2 = -aE2; + FRowDsptr aBi; + aBi = aB->at(0); + aBi->at(0) = aE3; + aBi->at(1) = mE2; + aBi->at(2) = aE1; + aBi->at(3) = mE0; + aBi = aB->at(1); + aBi->at(0) = aE2; + aBi->at(1) = aE3; + aBi->at(2) = mE0; + aBi->at(3) = mE1; + aBi = aB->at(2); + aBi->at(0) = mE1; + aBi->at(1) = aE0; + aBi->at(2) = aE3; + aBi->at(3) = mE2; + FRowDsptr aCi; + aCi = aC->at(0); + aCi->at(0) = aE3; + aCi->at(1) = aE2; + aCi->at(2) = mE1; + aCi->at(3) = mE0; + aCi = aC->at(1); + aCi->at(0) = mE2; + aCi->at(1) = aE3; + aCi->at(2) = aE0; + aCi->at(3) = mE1; + aCi = aC->at(2); + aCi->at(0) = aE1; + aCi->at(1) = mE0; + aCi->at(2) = aE3; + aCi->at(3) = mE2; + + aA = aB->timesTransposeFullMatrix(aC); +} +template<> +inline void EulerParameters::calcpApE() +{ + double a2E0 = 2.0 * (this->at(0)); + double a2E1 = 2.0 * (this->at(1)); + double a2E2 = 2.0 * (this->at(2)); + double a2E3 = 2.0 * (this->at(3)); + double m2E0 = -a2E0; + double m2E1 = -a2E1; + double m2E2 = -a2E2; + double m2E3 = -a2E3; + FMatDsptr pApEk; + pApEk = pApE->at(0); + FRowDsptr pAipEk; + pAipEk = pApEk->at(0); + pAipEk->at(0) = a2E0; + pAipEk->at(1) = a2E1; + pAipEk->at(2) = a2E2; + pAipEk = pApEk->at(1); + pAipEk->at(0) = a2E1; + pAipEk->at(1) = m2E0; + pAipEk->at(2) = m2E3; + pAipEk = pApEk->at(2); + pAipEk->at(0) = a2E2; + pAipEk->at(1) = a2E3; + pAipEk->at(2) = m2E0; + // + pApEk = pApE->at(1); + pAipEk = pApEk->at(0); + pAipEk->at(0) = m2E1; + pAipEk->at(1) = a2E0; + pAipEk->at(2) = a2E3; + pAipEk = pApEk->at(1); + pAipEk->at(0) = a2E0; + pAipEk->at(1) = a2E1; + pAipEk->at(2) = a2E2; + pAipEk = pApEk->at(2); + pAipEk->at(0) = m2E3; + pAipEk->at(1) = a2E2; + pAipEk->at(2) = m2E1; + // + pApEk = pApE->at(2); + pAipEk = pApEk->at(0); + pAipEk->at(0) = m2E2; + pAipEk->at(1) = m2E3; + pAipEk->at(2) = a2E0; + pAipEk = pApEk->at(1); + pAipEk->at(0) = a2E3; + pAipEk->at(1) = m2E2; + pAipEk->at(2) = a2E1; + pAipEk = pApEk->at(2); + pAipEk->at(0) = a2E0; + pAipEk->at(1) = a2E1; + pAipEk->at(2) = a2E2; + // + pApEk = pApE->at(3); + pAipEk = pApEk->at(0); + pAipEk->at(0) = a2E3; + pAipEk->at(1) = m2E2; + pAipEk->at(2) = a2E1; + pAipEk = pApEk->at(1); + pAipEk->at(0) = a2E2; + pAipEk->at(1) = a2E3; + pAipEk->at(2) = m2E0; + pAipEk = pApEk->at(2); + pAipEk->at(0) = m2E1; + pAipEk->at(1) = a2E0; + pAipEk->at(2) = a2E3; +} +template +inline void EulerParameters::conditionSelf() +{ + EulerArray::conditionSelf(); + this->normalizeSelf(); +} diff --git a/OndselSolver/EulerParameters.h b/OndselSolver/EulerParameters.h index 94ff274..887ed5d 100644 --- a/OndselSolver/EulerParameters.h +++ b/OndselSolver/EulerParameters.h @@ -8,6 +8,7 @@ #pragma once +#include "EulerParameters.ref.h" #include "EulerArray.h" #include "FullColumn.h" #include "FullMatrix.h" @@ -57,295 +58,4 @@ namespace MbD { FMatDsptr aC; FColFMatDsptr pApE; }; - - template<> - inline FMatFColDsptr EulerParameters::ppApEpEtimesColumn(FColDsptr col) - { - double a2c0 = 2 * col->at(0); - double a2c1 = 2 * col->at(1); - double a2c2 = 2 * col->at(2); - double m2c0 = 0 - a2c0; - double m2c1 = 0 - a2c1; - double m2c2 = 0 - a2c2; - auto col00 = std::make_shared>(ListD{ a2c0, m2c1, m2c2 }); - auto col01 = std::make_shared>(ListD{ a2c1, a2c0, 0 }); - auto col02 = std::make_shared>(ListD{ a2c2, 0, a2c0 }); - auto col03 = std::make_shared>(ListD{ 0, m2c2, a2c1 }); - auto col11 = std::make_shared>(ListD{ m2c0, a2c1, m2c2 }); - auto col12 = std::make_shared>(ListD{ 0, a2c2, a2c1 }); - auto col13 = std::make_shared>(ListD{ a2c2, 0, m2c0 }); - auto col22 = std::make_shared>(ListD{ m2c0, m2c1, a2c2 }); - auto col23 = std::make_shared>(ListD{ m2c1, a2c0, 0 }); - auto col33 = std::make_shared>(ListD{ a2c0, a2c1, a2c2 }); - auto answer = std::make_shared>(4, 4); - auto& row0 = answer->at(0); - row0->at(0) = col00; - row0->at(1) = col01; - row0->at(2) = col02; - row0->at(3) = col03; - auto& row1 = answer->at(1); - row1->at(0) = col01; - row1->at(1) = col11; - row1->at(2) = col12; - row1->at(3) = col13; - auto& row2 = answer->at(2); - row2->at(0) = col02; - row2->at(1) = col12; - row2->at(2) = col22; - row2->at(3) = col23; - auto& row3 = answer->at(3); - row3->at(0) = col03; - row3->at(1) = col13; - row3->at(2) = col23; - row3->at(3) = col33; - return answer; - } - - template<> - inline FMatDsptr EulerParameters::pCpEtimesColumn(FColDsptr col) - { - //"col size = 4." - auto c0 = col->at(0); - auto c1 = col->at(1); - auto c2 = col->at(2); - auto mc0 = -c0; - auto mc1 = -c1; - auto mc2 = -c2; - auto mc3 = -col->at(3); - auto answer = std::make_shared>(3, 4); - auto& row0 = answer->at(0); - auto& row1 = answer->at(1); - auto& row2 = answer->at(2); - row0->atiput(0, mc3); - row0->atiput(1, mc2); - row0->atiput(2, c1); - row0->atiput(3, c0); - row1->atiput(0, c2); - row1->atiput(1, mc3); - row1->atiput(2, mc0); - row1->atiput(3, c1); - row2->atiput(0, mc1); - row2->atiput(1, c0); - row2->atiput(2, mc3); - row2->atiput(3, c2); - return answer; - } - - template - inline FMatDsptr EulerParameters::pCTpEtimesColumn(FColDsptr col) - { - //"col size = 3." - auto c0 = col->at(0); - auto c1 = col->at(1); - auto c2 = col->at(2); - auto mc0 = -c0; - auto mc1 = -c1; - auto mc2 = -c2; - auto answer = std::make_shared>(4, 4); - auto& row0 = answer->at(0); - auto& row1 = answer->at(1); - auto& row2 = answer->at(2); - auto& row3 = answer->at(3); - row0->atiput(0, 0.0); - row0->atiput(1, c2); - row0->atiput(2, mc1); - row0->atiput(3, c0); - row1->atiput(0, mc2); - row1->atiput(1, 0.0); - row1->atiput(2, c0); - row1->atiput(3, c1); - row2->atiput(0, c1); - row2->atiput(1, mc0); - row2->atiput(2, 0.0); - row2->atiput(3, c2); - row3->atiput(0, mc0); - row3->atiput(1, mc1); - row3->atiput(2, mc2); - row3->atiput(3, 0.0); - return answer; - } - - template<> - inline FMatFMatDsptr EulerParameters::ppApEpEtimesMatrix(FMatDsptr mat) - { - FRowDsptr a2m0 = mat->at(0)->times(2.0); - FRowDsptr a2m1 = mat->at(1)->times(2.0); - FRowDsptr a2m2 = mat->at(2)->times(2.0); - FRowDsptr m2m0 = a2m0->negated(); - FRowDsptr m2m1 = a2m1->negated(); - FRowDsptr m2m2 = a2m2->negated(); - FRowDsptr zero = std::make_shared>(3, 0.0); - auto mat00 = std::make_shared>(ListFRD{ a2m0, m2m1, m2m2 }); - auto mat01 = std::make_shared>(ListFRD{ a2m1, a2m0, zero }); - auto mat02 = std::make_shared>(ListFRD{ a2m2, zero, a2m0 }); - auto mat03 = std::make_shared>(ListFRD{ zero, m2m2, a2m1 }); - auto mat11 = std::make_shared>(ListFRD{ m2m0, a2m1, m2m2 }); - auto mat12 = std::make_shared>(ListFRD{ zero, a2m2, a2m1 }); - auto mat13 = std::make_shared>(ListFRD{ a2m2, zero, m2m0 }); - auto mat22 = std::make_shared>(ListFRD{ m2m0, m2m1, a2m2 }); - auto mat23 = std::make_shared>(ListFRD{ m2m1, a2m0, zero }); - auto mat33 = std::make_shared>(ListFRD{ a2m0, a2m1, a2m2 }); - auto answer = std::make_shared>(4, 4); - auto& row0 = answer->at(0); - row0->at(0) = mat00; - row0->at(1) = mat01; - row0->at(2) = mat02; - row0->at(3) = mat03; - auto& row1 = answer->at(1); - row1->at(0) = mat01; - row1->at(1) = mat11; - row1->at(2) = mat12; - row1->at(3) = mat13; - auto& row2 = answer->at(2); - row2->at(0) = mat02; - row2->at(1) = mat12; - row2->at(2) = mat22; - row2->at(3) = mat23; - auto& row3 = answer->at(3); - row3->at(0) = mat03; - row3->at(1) = mat13; - row3->at(2) = mat23; - row3->at(3) = mat33; - return answer; - } - - template<> - inline void EulerParameters::initialize() - { - aA = FullMatrix::identitysptr(3); - aB = std::make_shared>(3, 4); - aC = std::make_shared>(3, 4); - pApE = std::make_shared>(4); - for (int i = 0; i < 4; i++) - { - pApE->at(i) = std::make_shared>(3, 3); - } - } - template - inline void EulerParameters::calc() - { - this->calcABC(); - this->calcpApE(); - } - template<> - inline void EulerParameters::calcABC() - { - double aE0 = this->at(0); - double aE1 = this->at(1); - double aE2 = this->at(2); - double aE3 = this->at(3); - double mE0 = -aE0; - double mE1 = -aE1; - double mE2 = -aE2; - FRowDsptr aBi; - aBi = aB->at(0); - aBi->at(0) = aE3; - aBi->at(1) = mE2; - aBi->at(2) = aE1; - aBi->at(3) = mE0; - aBi = aB->at(1); - aBi->at(0) = aE2; - aBi->at(1) = aE3; - aBi->at(2) = mE0; - aBi->at(3) = mE1; - aBi = aB->at(2); - aBi->at(0) = mE1; - aBi->at(1) = aE0; - aBi->at(2) = aE3; - aBi->at(3) = mE2; - FRowDsptr aCi; - aCi = aC->at(0); - aCi->at(0) = aE3; - aCi->at(1) = aE2; - aCi->at(2) = mE1; - aCi->at(3) = mE0; - aCi = aC->at(1); - aCi->at(0) = mE2; - aCi->at(1) = aE3; - aCi->at(2) = aE0; - aCi->at(3) = mE1; - aCi = aC->at(2); - aCi->at(0) = aE1; - aCi->at(1) = mE0; - aCi->at(2) = aE3; - aCi->at(3) = mE2; - - aA = aB->timesTransposeFullMatrix(aC); - } - template<> - inline void EulerParameters::calcpApE() - { - double a2E0 = 2.0 * (this->at(0)); - double a2E1 = 2.0 * (this->at(1)); - double a2E2 = 2.0 * (this->at(2)); - double a2E3 = 2.0 * (this->at(3)); - double m2E0 = -a2E0; - double m2E1 = -a2E1; - double m2E2 = -a2E2; - double m2E3 = -a2E3; - FMatDsptr pApEk; - pApEk = pApE->at(0); - FRowDsptr pAipEk; - pAipEk = pApEk->at(0); - pAipEk->at(0) = a2E0; - pAipEk->at(1) = a2E1; - pAipEk->at(2) = a2E2; - pAipEk = pApEk->at(1); - pAipEk->at(0) = a2E1; - pAipEk->at(1) = m2E0; - pAipEk->at(2) = m2E3; - pAipEk = pApEk->at(2); - pAipEk->at(0) = a2E2; - pAipEk->at(1) = a2E3; - pAipEk->at(2) = m2E0; - // - pApEk = pApE->at(1); - pAipEk = pApEk->at(0); - pAipEk->at(0) = m2E1; - pAipEk->at(1) = a2E0; - pAipEk->at(2) = a2E3; - pAipEk = pApEk->at(1); - pAipEk->at(0) = a2E0; - pAipEk->at(1) = a2E1; - pAipEk->at(2) = a2E2; - pAipEk = pApEk->at(2); - pAipEk->at(0) = m2E3; - pAipEk->at(1) = a2E2; - pAipEk->at(2) = m2E1; - // - pApEk = pApE->at(2); - pAipEk = pApEk->at(0); - pAipEk->at(0) = m2E2; - pAipEk->at(1) = m2E3; - pAipEk->at(2) = a2E0; - pAipEk = pApEk->at(1); - pAipEk->at(0) = a2E3; - pAipEk->at(1) = m2E2; - pAipEk->at(2) = a2E1; - pAipEk = pApEk->at(2); - pAipEk->at(0) = a2E0; - pAipEk->at(1) = a2E1; - pAipEk->at(2) = a2E2; - // - pApEk = pApE->at(3); - pAipEk = pApEk->at(0); - pAipEk->at(0) = a2E3; - pAipEk->at(1) = m2E2; - pAipEk->at(2) = a2E1; - pAipEk = pApEk->at(1); - pAipEk->at(0) = a2E2; - pAipEk->at(1) = a2E3; - pAipEk->at(2) = m2E0; - pAipEk = pApEk->at(2); - pAipEk->at(0) = m2E1; - pAipEk->at(1) = a2E0; - pAipEk->at(2) = a2E3; - } - template - inline void EulerParameters::conditionSelf() - { - EulerArray::conditionSelf(); - this->normalizeSelf(); - } } - diff --git a/OndselSolver/EulerParameters.ref.h b/OndselSolver/EulerParameters.ref.h new file mode 100644 index 0000000..ca14f54 --- /dev/null +++ b/OndselSolver/EulerParameters.ref.h @@ -0,0 +1,6 @@ +#pragma once + +namespace MbD { + template + class EulerParameters; +} diff --git a/OndselSolver/FullColumn.h b/OndselSolver/FullColumn.h index b72b006..4f495bb 100644 --- a/OndselSolver/FullColumn.h +++ b/OndselSolver/FullColumn.h @@ -12,17 +12,21 @@ #include #include "FullVector.h" +#include "FullColumn.ref.h" +#include "FullRow.ref.h" +#include "FullColumn.h" +#include "FullRow.h" namespace MbD { - template - class FullColumn; - using FColDsptr = std::shared_ptr>; - template - using FColsptr = std::shared_ptr>; - template - class FullRow; - template - using FRowsptr = std::shared_ptr>; +// template +// class FullColumn; +// using FColDsptr = std::shared_ptr>; +// template +// using FColsptr = std::shared_ptr>; +// template +// class FullRow; +// template +// using FRowsptr = std::shared_ptr>; class Symbolic; template diff --git a/OndselSolver/FullColumn.ref.h b/OndselSolver/FullColumn.ref.h new file mode 100644 index 0000000..7673a9c --- /dev/null +++ b/OndselSolver/FullColumn.ref.h @@ -0,0 +1,11 @@ +#pragma once + +namespace MbD { + template + class FullColumn; + + using FColDsptr = std::shared_ptr>; + + template + using FColsptr = std::shared_ptr>; +} diff --git a/OndselSolver/FullMatrix.cpp b/OndselSolver/FullMatrix.cpp index 0c870f8..efae947 100644 --- a/OndselSolver/FullMatrix.cpp +++ b/OndselSolver/FullMatrix.cpp @@ -7,9 +7,218 @@ ***************************************************************************/ #include "FullMatrix.h" +#include "FullColumn.h" +#include "FullRow.h" +#include "DiagonalMatrix.h" +#include "EulerParameters.h" using namespace MbD; +template +inline FMatsptr FullMatrix::rotatex(T the) +{ + auto sthe = std::sin(the); + auto cthe = std::cos(the); + auto rotMat = std::make_shared>(3, 3); + auto row0 = rotMat->at(0); + row0->atiput(0, 1.0); + row0->atiput(1, 0.0); + row0->atiput(2, 0.0); + auto row1 = rotMat->at(1); + row1->atiput(0, 0.0); + row1->atiput(1, cthe); + row1->atiput(2, -sthe); + auto row2 = rotMat->at(2); + row2->atiput(0, 0.0); + row2->atiput(1, sthe); + row2->atiput(2, cthe); + return rotMat; +} +template +inline FMatsptr FullMatrix::rotatey(T the) +{ + auto sthe = std::sin(the); + auto cthe = std::cos(the); + auto rotMat = std::make_shared>(3, 3); + auto row0 = rotMat->at(0); + row0->atiput(0, cthe); + row0->atiput(1, 0.0); + row0->atiput(2, sthe); + auto row1 = rotMat->at(1); + row1->atiput(0, 0.0); + row1->atiput(1, 1.0); + row1->atiput(2, 0.0); + auto row2 = rotMat->at(2); + row2->atiput(0, -sthe); + row2->atiput(1, 0.0); + row2->atiput(2, cthe); + return rotMat; +} +template +inline FMatsptr FullMatrix::rotatez(T the) +{ + auto sthe = std::sin(the); + auto cthe = std::cos(the); + auto rotMat = std::make_shared>(3, 3); + auto row0 = rotMat->at(0); + row0->atiput(0, cthe); + row0->atiput(1, -sthe); + row0->atiput(2, 0.0); + auto row1 = rotMat->at(1); + row1->atiput(0, sthe); + row1->atiput(1, cthe); + row1->atiput(2, 0.0); + auto row2 = rotMat->at(2); + row2->atiput(0, 0.0); + row2->atiput(1, 0.0); + row2->atiput(2, 1.0); + return rotMat; +} +template +inline FMatsptr FullMatrix::rotatexrotDot(T the, T thedot) +{ + auto sthe = std::sin(the); + auto cthe = std::cos(the); + auto sthedot = cthe * thedot; + auto cthedot = -sthe * thedot; + auto rotMat = std::make_shared>(3, 3); + auto row0 = rotMat->at(0); + row0->atiput(0, 0.0); + row0->atiput(1, 0.0); + row0->atiput(2, 0.0); + auto row1 = rotMat->at(1); + row1->atiput(0, 0.0); + row1->atiput(1, cthedot); + row1->atiput(2, -sthedot); + auto row2 = rotMat->at(2); + row2->atiput(0, 0.0); + row2->atiput(1, sthedot); + row2->atiput(2, cthedot); + return rotMat; +} +template +inline FMatsptr FullMatrix::rotateyrotDot(T the, T thedot) +{ + auto sthe = std::sin(the); + auto cthe = std::cos(the); + auto sthedot = cthe * thedot; + auto cthedot = -sthe * thedot; + auto rotMat = std::make_shared>(3, 3); + auto row0 = rotMat->at(0); + row0->atiput(0, cthedot); + row0->atiput(1, 0.0); + row0->atiput(2, sthedot); + auto row1 = rotMat->at(1); + row1->atiput(0, 0.0); + row1->atiput(1, 0.0); + row1->atiput(2, 0.0); + auto row2 = rotMat->at(2); + row2->atiput(0, -sthedot); + row2->atiput(1, 0.0); + row2->atiput(2, cthedot); + return rotMat; +} +template +inline FMatsptr FullMatrix::rotatezrotDot(T the, T thedot) +{ + auto sthe = std::sin(the); + auto cthe = std::cos(the); + auto sthedot = cthe * thedot; + auto cthedot = -sthe * thedot; + auto rotMat = std::make_shared>(3, 3); + auto row0 = rotMat->at(0); + row0->atiput(0, cthedot); + row0->atiput(1, -sthedot); + row0->atiput(2, 0.0); + auto row1 = rotMat->at(1); + row1->atiput(0, sthedot); + row1->atiput(1, cthedot); + row1->atiput(2, 0.0); + auto row2 = rotMat->at(2); + row2->atiput(0, 0.0); + row2->atiput(1, 0.0); + row2->atiput(2, 0.0); + return rotMat; +} +template +inline FMatsptr FullMatrix::rotatexrotDotrotDDot(T the, T thedot, T theddot) +{ + auto sthe = std::sin(the); + auto cthe = std::cos(the); + auto sthedot = cthe * thedot; + auto cthedot = -sthe * thedot; + auto stheddot = cthedot * thedot + (cthe * theddot); + auto ctheddot = -(sthedot * thedot) - (sthe * theddot); + auto rotMat = std::make_shared>(3, 3); + auto row0 = rotMat->at(0); + row0->atiput(0, 0.0); + row0->atiput(1, 0.0); + row0->atiput(2, 0.0); + auto row1 = rotMat->at(1); + row1->atiput(0, 0.0); + row1->atiput(1, ctheddot); + row1->atiput(2, -stheddot); + auto row2 = rotMat->at(2); + row2->atiput(0, 0.0); + row2->atiput(1, stheddot); + row2->atiput(2, ctheddot); + return rotMat; +} +template +inline FMatsptr FullMatrix::rotateyrotDotrotDDot(T the, T thedot, T theddot) +{ + auto sthe = std::sin(the); + auto cthe = std::cos(the); + auto sthedot = cthe * thedot; + auto cthedot = -sthe * thedot; + auto stheddot = cthedot * thedot + (cthe * theddot); + auto ctheddot = -(sthedot * thedot) - (sthe * theddot); + auto rotMat = std::make_shared>(3, 3); + auto row0 = rotMat->at(0); + row0->atiput(0, ctheddot); + row0->atiput(1, 0.0); + row0->atiput(2, stheddot); + auto row1 = rotMat->at(1); + row1->atiput(0, 0.0); + row1->atiput(1, 0.0); + row1->atiput(2, 0.0); + auto row2 = rotMat->at(2); + row2->atiput(0, -stheddot); + row2->atiput(1, 0.0); + row2->atiput(2, ctheddot); + return rotMat; +} +template +inline FMatsptr FullMatrix::rotatezrotDotrotDDot(T the, T thedot, T theddot) +{ + auto sthe = std::sin(the); + auto cthe = std::cos(the); + auto sthedot = cthe * thedot; + auto cthedot = -sthe * thedot; + auto stheddot = cthedot * thedot + (cthe * theddot); + auto ctheddot = -(sthedot * thedot) - (sthe * theddot); + auto rotMat = std::make_shared>(3, 3); + auto row0 = rotMat->at(0); + row0->atiput(0, ctheddot); + row0->atiput(1, -stheddot); + row0->atiput(2, 0.0); + auto row1 = rotMat->at(1); + row1->atiput(0, stheddot); + row1->atiput(1, ctheddot); + row1->atiput(2, 0.0); + auto row2 = rotMat->at(2); + row2->atiput(0, 0.0); + row2->atiput(1, 0.0); + row2->atiput(2, 0.0); + return rotMat; +} +template +inline FMatsptr FullMatrix::identitysptr(int n) +{ + auto mat = std::make_shared>(n, n); + mat->identity(); + return mat; +} template inline FMatsptr FullMatrix::tildeMatrix(FColDsptr col) { diff --git a/OndselSolver/FullMatrix.h b/OndselSolver/FullMatrix.h index bdc71c2..3ce6dca 100644 --- a/OndselSolver/FullMatrix.h +++ b/OndselSolver/FullMatrix.h @@ -11,38 +11,14 @@ #include "corecrt_math_defines.h" #include -#include "FullRow.h" +#include "FullMatrix.ref.h" +#include "FullColumn.ref.h" +#include "FullRow.ref.h" +#include "DiagonalMatrix.ref.h" +#include "EulerParameters.ref.h" #include "RowTypeMatrix.h" -#include "FullColumn.h" namespace MbD { - template - class FullMatrix; - - using FMatDsptr = std::shared_ptr>; - - template - using FMatsptr = std::shared_ptr>; - - template - class FullColumn; - using FColDsptr = std::shared_ptr>; - - template - class FullRow; - - template - class RowTypeMatrix; - - template - class EulerParameters; - - template - class DiagonalMatrix; - - using FMatFColDsptr = std::shared_ptr>; - using FMatFMatDsptr = std::shared_ptr>; - using FColFMatDsptr = std::shared_ptr>; template class FullMatrix : public RowTypeMatrix> @@ -118,210 +94,5 @@ namespace MbD { std::ostream& printOn(std::ostream& s) const override; }; - template - inline FMatsptr FullMatrix::rotatex(T the) - { - auto sthe = std::sin(the); - auto cthe = std::cos(the); - auto rotMat = std::make_shared>(3, 3); - auto row0 = rotMat->at(0); - row0->atiput(0, 1.0); - row0->atiput(1, 0.0); - row0->atiput(2, 0.0); - auto row1 = rotMat->at(1); - row1->atiput(0, 0.0); - row1->atiput(1, cthe); - row1->atiput(2, -sthe); - auto row2 = rotMat->at(2); - row2->atiput(0, 0.0); - row2->atiput(1, sthe); - row2->atiput(2, cthe); - return rotMat; - } - template - inline FMatsptr FullMatrix::rotatey(T the) - { - auto sthe = std::sin(the); - auto cthe = std::cos(the); - auto rotMat = std::make_shared>(3, 3); - auto row0 = rotMat->at(0); - row0->atiput(0, cthe); - row0->atiput(1, 0.0); - row0->atiput(2, sthe); - auto row1 = rotMat->at(1); - row1->atiput(0, 0.0); - row1->atiput(1, 1.0); - row1->atiput(2, 0.0); - auto row2 = rotMat->at(2); - row2->atiput(0, -sthe); - row2->atiput(1, 0.0); - row2->atiput(2, cthe); - return rotMat; - } - template - inline FMatsptr FullMatrix::rotatez(T the) - { - auto sthe = std::sin(the); - auto cthe = std::cos(the); - auto rotMat = std::make_shared>(3, 3); - auto row0 = rotMat->at(0); - row0->atiput(0, cthe); - row0->atiput(1, -sthe); - row0->atiput(2, 0.0); - auto row1 = rotMat->at(1); - row1->atiput(0, sthe); - row1->atiput(1, cthe); - row1->atiput(2, 0.0); - auto row2 = rotMat->at(2); - row2->atiput(0, 0.0); - row2->atiput(1, 0.0); - row2->atiput(2, 1.0); - return rotMat; - } - template - inline FMatsptr FullMatrix::rotatexrotDot(T the, T thedot) - { - auto sthe = std::sin(the); - auto cthe = std::cos(the); - auto sthedot = cthe * thedot; - auto cthedot = -sthe * thedot; - auto rotMat = std::make_shared>(3, 3); - auto row0 = rotMat->at(0); - row0->atiput(0, 0.0); - row0->atiput(1, 0.0); - row0->atiput(2, 0.0); - auto row1 = rotMat->at(1); - row1->atiput(0, 0.0); - row1->atiput(1, cthedot); - row1->atiput(2, -sthedot); - auto row2 = rotMat->at(2); - row2->atiput(0, 0.0); - row2->atiput(1, sthedot); - row2->atiput(2, cthedot); - return rotMat; - } - template - inline FMatsptr FullMatrix::rotateyrotDot(T the, T thedot) - { - auto sthe = std::sin(the); - auto cthe = std::cos(the); - auto sthedot = cthe * thedot; - auto cthedot = -sthe * thedot; - auto rotMat = std::make_shared>(3, 3); - auto row0 = rotMat->at(0); - row0->atiput(0, cthedot); - row0->atiput(1, 0.0); - row0->atiput(2, sthedot); - auto row1 = rotMat->at(1); - row1->atiput(0, 0.0); - row1->atiput(1, 0.0); - row1->atiput(2, 0.0); - auto row2 = rotMat->at(2); - row2->atiput(0, -sthedot); - row2->atiput(1, 0.0); - row2->atiput(2, cthedot); - return rotMat; - } - template - inline FMatsptr FullMatrix::rotatezrotDot(T the, T thedot) - { - auto sthe = std::sin(the); - auto cthe = std::cos(the); - auto sthedot = cthe * thedot; - auto cthedot = -sthe * thedot; - auto rotMat = std::make_shared>(3, 3); - auto row0 = rotMat->at(0); - row0->atiput(0, cthedot); - row0->atiput(1, -sthedot); - row0->atiput(2, 0.0); - auto row1 = rotMat->at(1); - row1->atiput(0, sthedot); - row1->atiput(1, cthedot); - row1->atiput(2, 0.0); - auto row2 = rotMat->at(2); - row2->atiput(0, 0.0); - row2->atiput(1, 0.0); - row2->atiput(2, 0.0); - return rotMat; - } - template - inline FMatsptr FullMatrix::rotatexrotDotrotDDot(T the, T thedot, T theddot) - { - auto sthe = std::sin(the); - auto cthe = std::cos(the); - auto sthedot = cthe * thedot; - auto cthedot = -sthe * thedot; - auto stheddot = cthedot * thedot + (cthe * theddot); - auto ctheddot = -(sthedot * thedot) - (sthe * theddot); - auto rotMat = std::make_shared>(3, 3); - auto row0 = rotMat->at(0); - row0->atiput(0, 0.0); - row0->atiput(1, 0.0); - row0->atiput(2, 0.0); - auto row1 = rotMat->at(1); - row1->atiput(0, 0.0); - row1->atiput(1, ctheddot); - row1->atiput(2, -stheddot); - auto row2 = rotMat->at(2); - row2->atiput(0, 0.0); - row2->atiput(1, stheddot); - row2->atiput(2, ctheddot); - return rotMat; - } - template - inline FMatsptr FullMatrix::rotateyrotDotrotDDot(T the, T thedot, T theddot) - { - auto sthe = std::sin(the); - auto cthe = std::cos(the); - auto sthedot = cthe * thedot; - auto cthedot = -sthe * thedot; - auto stheddot = cthedot * thedot + (cthe * theddot); - auto ctheddot = -(sthedot * thedot) - (sthe * theddot); - auto rotMat = std::make_shared>(3, 3); - auto row0 = rotMat->at(0); - row0->atiput(0, ctheddot); - row0->atiput(1, 0.0); - row0->atiput(2, stheddot); - auto row1 = rotMat->at(1); - row1->atiput(0, 0.0); - row1->atiput(1, 0.0); - row1->atiput(2, 0.0); - auto row2 = rotMat->at(2); - row2->atiput(0, -stheddot); - row2->atiput(1, 0.0); - row2->atiput(2, ctheddot); - return rotMat; - } - template - inline FMatsptr FullMatrix::rotatezrotDotrotDDot(T the, T thedot, T theddot) - { - auto sthe = std::sin(the); - auto cthe = std::cos(the); - auto sthedot = cthe * thedot; - auto cthedot = -sthe * thedot; - auto stheddot = cthedot * thedot + (cthe * theddot); - auto ctheddot = -(sthedot * thedot) - (sthe * theddot); - auto rotMat = std::make_shared>(3, 3); - auto row0 = rotMat->at(0); - row0->atiput(0, ctheddot); - row0->atiput(1, -stheddot); - row0->atiput(2, 0.0); - auto row1 = rotMat->at(1); - row1->atiput(0, stheddot); - row1->atiput(1, ctheddot); - row1->atiput(2, 0.0); - auto row2 = rotMat->at(2); - row2->atiput(0, 0.0); - row2->atiput(1, 0.0); - row2->atiput(2, 0.0); - return rotMat; - } - template - inline FMatsptr FullMatrix::identitysptr(int n) - { - auto mat = std::make_shared>(n, n); - mat->identity(); - return mat; - } } diff --git a/OndselSolver/FullMatrix.ref.h b/OndselSolver/FullMatrix.ref.h new file mode 100644 index 0000000..be8b046 --- /dev/null +++ b/OndselSolver/FullMatrix.ref.h @@ -0,0 +1,20 @@ +#pragma once + +#include "FullColumn.ref.h" + +namespace MbD { + template + class FullMatrix; + + using FMatDsptr = std::shared_ptr>; + + template + using FMatsptr = std::shared_ptr>; + + using FMatFColDsptr = std::shared_ptr>; + using FMatFMatDsptr = std::shared_ptr>; + + using FColFMatDsptr = std::shared_ptr>; +} + + diff --git a/OndselSolver/FullRow.cpp b/OndselSolver/FullRow.cpp index 15cf73b..af1b4d5 100644 --- a/OndselSolver/FullRow.cpp +++ b/OndselSolver/FullRow.cpp @@ -7,6 +7,7 @@ ***************************************************************************/ #include "FullRow.h" +#include "FullMatrix.h" using namespace MbD; @@ -15,7 +16,7 @@ FMatsptr FullRow::transposeTimesFullRow(FRowsptr fullRow) { //"a*b = a(i)b(j)" auto nrow = (int)this->size(); - auto answer = std::make_shared>(nrow); + auto answer = std::make_shared>(nrow); for (int i = 0; i < nrow; i++) { answer->atiput(i, fullRow->times(this->at(i))); diff --git a/OndselSolver/FullRow.h b/OndselSolver/FullRow.h index 59bd6c9..540e1d5 100644 --- a/OndselSolver/FullRow.h +++ b/OndselSolver/FullRow.h @@ -9,21 +9,10 @@ #pragma once #include "FullVector.h" -#include "FullMatrix.h" +#include "FullMatrix.ref.h" +#include "FullRow.ref.h" namespace MbD { - template - class FullRow; - template - using FRowsptr = std::shared_ptr>; - using FRowDsptr = std::shared_ptr>; - template - class FullColumn; - template - using FColsptr = std::shared_ptr>; - using ListFRD = std::initializer_list; - template - class FullMatrix; template class FullRow : public FullVector diff --git a/OndselSolver/FullRow.ref.h b/OndselSolver/FullRow.ref.h new file mode 100644 index 0000000..f9e6ca8 --- /dev/null +++ b/OndselSolver/FullRow.ref.h @@ -0,0 +1,14 @@ +#pragma once + +#include "FullColumn.ref.h" + +namespace MbD { + template + class FullRow; + + template + using FRowsptr = std::shared_ptr>; + using FRowDsptr = std::shared_ptr>; + + using ListFRD = std::initializer_list; +} \ No newline at end of file diff --git a/OndselSolver/RowTypeMatrix.cpp b/OndselSolver/RowTypeMatrix.cpp index c607e8e..33821e2 100644 --- a/OndselSolver/RowTypeMatrix.cpp +++ b/OndselSolver/RowTypeMatrix.cpp @@ -9,3 +9,13 @@ #include "RowTypeMatrix.h" using namespace MbD; + +template +int RowTypeMatrix::nrow() { + return (int) this->size(); +} + +template +int RowTypeMatrix::ncol() { + return this->at(0)->numberOfElements(); +} diff --git a/OndselSolver/RowTypeMatrix.h b/OndselSolver/RowTypeMatrix.h index 9e0efd5..2a7fb8c 100644 --- a/OndselSolver/RowTypeMatrix.h +++ b/OndselSolver/RowTypeMatrix.h @@ -9,7 +9,7 @@ #pragma once #include "Array.h" -#include "FullRow.h" +#include "FullRow.ref.h" namespace MbD { @@ -24,13 +24,8 @@ namespace MbD { virtual void zeroSelf() override = 0; //double maxMagnitude() override; int numberOfElements() override; - - int nrow() { - return (int) this->size(); - } - int ncol() { - return this->at(0)->numberOfElements(); - } + int nrow(); + int ncol(); }; template diff --git a/OndselSolver/StableBackwardDifference.h b/OndselSolver/StableBackwardDifference.h index 4393e88..2e6ad1a 100644 --- a/OndselSolver/StableBackwardDifference.h +++ b/OndselSolver/StableBackwardDifference.h @@ -8,6 +8,7 @@ #pragma once +#include "FullRow.h" #include "LinearMultiStepMethod.h" namespace MbD {