systemSolver->runBasicKinematic();

This commit is contained in:
Aik-Siong Koh
2023-06-11 07:15:20 -06:00
parent d848450907
commit 3b08cd72df
182 changed files with 2789 additions and 535 deletions

View File

@@ -12,33 +12,37 @@ namespace MbD {
{
public:
Array() {}
Array(size_t count) : std::vector<T>(count) {}
Array(size_t count, const T& value) : std::vector<T>(count, value) {}
Array(std::vector<T> vec) : std::vector<T>(vec) {}
Array(int count) : std::vector<T>(count) {}
Array(int count, const T& value) : std::vector<T>(count, value) {}
Array(std::vector<T>::iterator begin, std::vector<T>::iterator end) : std::vector<T>(begin, end) {}
Array(std::initializer_list<T> list) : std::vector<T>{ list } {}
void copyFrom(std::shared_ptr<Array<T>> x);
virtual void zeroSelf() = 0;
virtual double sumOfSquares() = 0;
double rootMeanSquare();
virtual size_t numberOfElements() = 0;
virtual int numberOfElements() = 0;
void swapRows(int i, int ii);
};
template<typename T>
inline void Array<T>::copyFrom(std::shared_ptr<Array<T>> x)
{
for (size_t i = 0; i < x->size(); i++) {
for (int i = 0; i < x->size(); i++) {
this->at(i) = x->at(i);
}
}
//template <>
//inline void Array<double>::zeroSelf() {
// for (size_t i = 0; i < this->size(); i++) {
// this->at(i) = 0.0;;
// }
//}
template<typename T>
inline double Array<T>::rootMeanSquare()
{
return std::sqrt(this->sumOfSquares() / this->numberOfElements());
}
template<typename T>
inline void Array<T>::swapRows(int i, int ii)
{
auto temp = this->at(i);
this->at(i) = this->at(ii);
this->at(ii) = temp;
}
using ListD = std::initializer_list<double>;
using ListListD = std::initializer_list<std::initializer_list<double>>;
using ListListPairD = std::initializer_list<std::initializer_list<std::initializer_list<double>>>;