Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cm3Libraries
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm3
cm3Libraries
Commits
900c980c
Commit
900c980c
authored
4 years ago
by
Van Dung NGUYEN
Browse files
Options
Downloads
Patches
Plain Diff
new option
parent
ee18f955
No related branches found
No related tags found
1 merge request
!310
Master - transfer updates into WIP branch
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
NonLinearSolver/modelReduction/Tree.cpp
+9
-2
9 additions, 2 deletions
NonLinearSolver/modelReduction/Tree.cpp
NonLinearSolver/modelReduction/Tree.h
+1
-1
1 addition, 1 deletion
NonLinearSolver/modelReduction/Tree.h
with
10 additions
and
3 deletions
NonLinearSolver/modelReduction/Tree.cpp
+
9
−
2
View file @
900c980c
...
@@ -2138,7 +2138,7 @@ void Tree::clear()
...
@@ -2138,7 +2138,7 @@ void Tree::clear()
_root
=
NULL
;
_root
=
NULL
;
};
};
void
Tree
::
initialize
(
bool
rand
,
bool
normalizedWeight
)
void
Tree
::
initialize
(
bool
rand
,
bool
normalizedWeight
,
bool
type
)
{
{
// random weight for leaves
// random weight for leaves
unsigned
seed
=
std
::
chrono
::
system_clock
::
now
().
time_since_epoch
().
count
();
unsigned
seed
=
std
::
chrono
::
system_clock
::
now
().
time_since_epoch
().
count
();
...
@@ -2174,8 +2174,15 @@ void Tree::initialize(bool rand, bool normalizedWeight)
...
@@ -2174,8 +2174,15 @@ void Tree::initialize(bool rand, bool normalizedWeight)
if
(
normalizedWeight
)
if
(
normalizedWeight
)
{
{
double
vv
=
(
n
->
af
->
getVal
(
n
->
weight
))
/
toltalWeightLeaves
;
double
vv
=
(
n
->
af
->
getVal
(
n
->
weight
))
/
toltalWeightLeaves
;
if
(
type
)
{
n
->
weight
=
n
->
af
->
getReciprocalVal
(
vv
);
n
->
weight
=
n
->
af
->
getReciprocalVal
(
vv
);
}
}
else
{
n
->
weight
=
vv
;
}
}
// propagate data
// propagate data
double
w
=
n
->
weight
;
double
w
=
n
->
weight
;
TreeNode
*
parent
=
n
->
parent
;
TreeNode
*
parent
=
n
->
parent
;
...
...
This diff is collapsed.
Click to expand it.
NonLinearSolver/modelReduction/Tree.h
+
1
−
1
View file @
900c980c
...
@@ -59,7 +59,7 @@ class Tree
...
@@ -59,7 +59,7 @@ class Tree
void
printTree
()
const
;
void
printTree
()
const
;
void
printTreeInteraction
(
const
std
::
string
fname
=
"treeInteraction.txt"
,
bool
colorMat
=
true
,
int
dir
=
1
)
const
;
void
printTreeInteraction
(
const
std
::
string
fname
=
"treeInteraction.txt"
,
bool
colorMat
=
true
,
int
dir
=
1
)
const
;
void
clear
();
void
clear
();
void
initialize
(
bool
rand
=
true
,
bool
normalizedWeight
=
true
);
void
initialize
(
bool
rand
=
true
,
bool
normalizedWeight
=
true
,
bool
type
=
true
);
const
TreeNode
*
getRootNode
()
const
{
return
_root
;};
const
TreeNode
*
getRootNode
()
const
{
return
_root
;};
void
assignMaterialLaws
(
int
numPhases
);
void
assignMaterialLaws
(
int
numPhases
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment