Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
INMOST
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Terekhov
INMOST
Commits
fa049b29
Commit
fa049b29
authored
Jan 25, 2018
by
Kirill Terekhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
46969853
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
3 deletions
+18
-3
Source/Autodiff/model.cpp
Source/Autodiff/model.cpp
+9
-0
Source/Headers/inmost_dense.h
Source/Headers/inmost_dense.h
+2
-2
Source/Headers/inmost_expression.h
Source/Headers/inmost_expression.h
+1
-1
Source/Headers/inmost_model.h
Source/Headers/inmost_model.h
+6
-0
No files found.
Source/Autodiff/model.cpp
View file @
fa049b29
...
...
@@ -176,6 +176,15 @@ namespace INMOST
return
success
;
}
bool
Model
::
PrepareIterations
()
{
bool
success
=
true
;
for
(
std
::
vector
<
std
::
pair
<
std
::
string
,
AbstractSubModel
*>
>::
const_iterator
it
=
SubModels
.
begin
();
it
!=
SubModels
.
end
();
++
it
)
success
&=
it
->
second
->
PrepareIterations
();
return
success
;
}
bool
Model
::
FillResidual
(
Residual
&
R
)
const
{
bool
success
=
true
;
...
...
Source/Headers/inmost_dense.h
View file @
fa049b29
...
...
@@ -202,7 +202,7 @@ namespace INMOST
/// @param order_singular_values
/// \warning Somehow result differ in auto-differential mode.
/// \todo Test implementation for auto-differentiation.
bool
SVD
(
AbstractMatrix
<
Var
>
&
U
,
AbstractMatrix
<
Var
>
&
Sigma
,
AbstractMatrix
<
Var
>
&
V
,
bool
order_singular_values
=
true
)
const
bool
SVD
(
AbstractMatrix
<
Var
>
&
U
,
AbstractMatrix
<
Var
>
&
Sigma
,
AbstractMatrix
<
Var
>
&
V
,
bool
order_singular_values
=
true
,
bool
nonnegative
=
true
)
const
{
int
flag
,
i
,
its
,
j
,
jj
,
k
,
l
,
nm
;
int
n
=
Rows
();
...
...
@@ -388,7 +388,7 @@ namespace INMOST
z
=
Sigma
(
k
,
k
);
if
(
l
==
k
)
{
// convergence
if
(
z
<
0.0
)
if
(
z
<
0.0
&&
nonnegative
)
{
// make singular value nonnegative
Sigma
(
k
,
k
)
=
-
z
;
for
(
j
=
0
;
j
<
(
int
)
n
;
j
++
)
V
(
j
,
k
)
=
-
V
(
j
,
k
);
...
...
Source/Headers/inmost_expression.h
View file @
fa049b29
...
...
@@ -2028,7 +2028,7 @@ namespace INMOST
mid
=
(
l
+
r
)
/
2
;
if
(
args
[
mid
]
>
arg
)
r
=
mid
-
1
;
else
if
(
args
[
mid
]
<
arg
)
l
=
mid
+
1
;
else
return
mid
;
else
break
;
}
mid
=
(
l
+
r
)
/
2
;
if
(
mid
>
static_cast
<
int
>
(
size
-
2
))
mid
=
static_cast
<
int
>
(
size
-
2
);
...
...
Source/Headers/inmost_model.h
View file @
fa049b29
...
...
@@ -24,6 +24,9 @@ namespace INMOST
virtual
bool
PrepareEntries
(
Model
&
P
)
=
0
;
/// Initialize coupling and dependent unknowns.
virtual
bool
Initialize
(
Model
&
P
)
=
0
;
/// Initialize data needed for FillResidual.
/// Called once before nonlinear iterations.
virtual
bool
PrepareIterations
()
{
return
true
;}
/// Fill part of the residual related to my unknowns.
virtual
bool
FillResidual
(
Residual
&
R
)
const
=
0
;
/// Update solution.
...
...
@@ -108,6 +111,9 @@ namespace INMOST
bool
PrepareEntries
();
/// Initialze all entries and submodels.
bool
Initialize
();
/// Initialize data needed for FillResidual.
/// Called once before nonlinear iterations.
bool
PrepareIterations
();
/// Compute the residual of the model.
bool
FillResidual
(
Residual
&
R
)
const
;
/// Update solution.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment