- Move existing OndselSolver, GNN ML layer, and tooling into GNN/ directory for integration in later phases - Add Create addon scaffold: package.xml, Init.py - Add expression DAG with eval, symbolic diff, simplification - Add parameter table with fixed/free variable tracking - Add quaternion rotation as polynomial Expr trees - Add RigidBody entity (7 DOF: position + unit quaternion) - Add constraint classes: Coincident, DistancePointPoint, Fixed - Add Newton-Raphson solver with symbolic Jacobian + numpy lstsq - Add pre-solve passes: substitution + single-equation - Add DOF counting via Jacobian SVD rank - Add KindredSolver IKCSolver bridge for kcsolve integration - Add 82 unit tests covering all modules Registers as 'kindred' solver via kcsolve.register_solver() when loaded by Create's addon_loader.
59 lines
1.7 KiB
C++
59 lines
1.7 KiB
C++
/***************************************************************************
|
|
* Copyright (c) 2023 Ondsel, Inc. *
|
|
* *
|
|
* This file is part of OndselSolver. *
|
|
* *
|
|
* See LICENSE file for details about copyright. *
|
|
***************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
#include "Array.h"
|
|
|
|
namespace MbD {
|
|
|
|
template<typename T>
|
|
class RowTypeMatrix : public Array<T>
|
|
{
|
|
public:
|
|
RowTypeMatrix() {}
|
|
RowTypeMatrix(size_t m) : Array<T>(m) {}
|
|
RowTypeMatrix(std::initializer_list<T> list) : Array<T>{ list } {}
|
|
void copyFrom(std::shared_ptr<RowTypeMatrix<T>> x);
|
|
virtual void zeroSelf() override = 0;
|
|
//double maxMagnitude() override;
|
|
size_t numberOfElements() override;
|
|
size_t nrow() {
|
|
return this->size();
|
|
}
|
|
size_t ncol() {
|
|
return this->at(0)->numberOfElements();
|
|
}
|
|
};
|
|
|
|
template<typename T>
|
|
inline void RowTypeMatrix<T>::copyFrom(std::shared_ptr<RowTypeMatrix<T>> x)
|
|
{
|
|
for (size_t i = 0; i < x->size(); i++) {
|
|
this->at(i)->copyFrom(x->at(i));
|
|
}
|
|
}
|
|
//template<typename T>
|
|
//inline double RowTypeMatrix<T>::maxMagnitude()
|
|
//{
|
|
// double max = 0.0;
|
|
// for (size_t i = 0; i < this->size(); i++)
|
|
// {
|
|
// double element = this->at(i)->maxMagnitude();
|
|
// if (max < element) max = element;
|
|
// }
|
|
// return max;
|
|
//}
|
|
template<typename T>
|
|
inline size_t RowTypeMatrix<T>::numberOfElements()
|
|
{
|
|
return this->nrow() * this->ncol();
|
|
}
|
|
}
|
|
|