diff --git a/NonLinearSolver/modelReduction/DeepMaterialNetworks.cpp b/NonLinearSolver/modelReduction/DeepMaterialNetworks.cpp index 27d6a83bf22fe7872d8c83f79f2b53fb5cbc2de4..63577897ccc0631d22e9532a0c7b38d8e8a77e7f 100644 --- a/NonLinearSolver/modelReduction/DeepMaterialNetworks.cpp +++ b/NonLinearSolver/modelReduction/DeepMaterialNetworks.cpp @@ -2609,7 +2609,7 @@ void DeepMaterialNetwork::initializeOnlineEvaluation() _T->getBackTrackingPath(_leaves[i],path); _backTrackingMap[_leaves[i]] = path; }; - printf("size of void leaves = %d\n",_voidLeaves.size()); + printf("size of void leaves = %ld\n",_voidLeaves.size()); // leaf map printf("creating associated leaves map\n"); @@ -2700,7 +2700,7 @@ void DeepMaterialNetwork::initializeOnlineEvaluation() } }; - printf("size of void _notUnknownRegularNodes = %d\n",_notUnknownRegularNodes.size()); + printf("size of void _notUnknownRegularNodes = %ld\n",_notUnknownRegularNodes.size()); }; void DeepMaterialNetwork::getKeys(const TreeNode* node, std::vector<Dof>& keys) const diff --git a/NonLinearSolver/modelReduction/Tree.cpp b/NonLinearSolver/modelReduction/Tree.cpp index 3858f487aaaed0cc52d0b58fbab1fe51096f678a..fa1b4f61447e3731f9b239786610c66c7c1b6642 100644 --- a/NonLinearSolver/modelReduction/Tree.cpp +++ b/NonLinearSolver/modelReduction/Tree.cpp @@ -1485,6 +1485,22 @@ void Tree::printPhaseFraction() const allPhase.print("all phase fraction:"); }; +void Tree::printLeafFraction() const +{ + nodeContainer allLeaves; + getAllLeaves(allLeaves); + double total = getNonNegativeWeight(_root); + printf("print fraction at leaf:\n"); + int ord=0; + for (int i=0; i< allLeaves.size(); i++) + { + const TreeNode* leaf = allLeaves[i]; + printf("loc %d: %d %d, fraction = %.5e\n",ord,leaf->depth,leaf->location,getNonNegativeWeight(leaf)/total); + ord++; + } + printf("done printing:\n"); +}; + void Tree::printTree() const { printf("Tree print \n"); diff --git a/NonLinearSolver/modelReduction/Tree.h b/NonLinearSolver/modelReduction/Tree.h index dfaff94d743e2c810b69e96968dc6c43957465ab..3087d7297f76d3d67b9ec5ec558ef9d328513513 100644 --- a/NonLinearSolver/modelReduction/Tree.h +++ b/NonLinearSolver/modelReduction/Tree.h @@ -74,6 +74,7 @@ class Tree int getNumberOfNodes() const; double getPhaseFraction(int i) const; void printPhaseFraction() const; + void printLeafFraction() const; void printNodeFraction() const; bool removeLeavesWithZeroContribution(double tol=1e-6);