Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCDDS-core
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPC
SCDDS
SCDDS-core
Commits
5c995789
Commit
5c995789
authored
5 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
Avoid adding same algoobj to list twice
parent
b0ca1818
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
code/classes/SCDclass_algo.m
+1
-1
1 addition, 1 deletion
code/classes/SCDclass_algo.m
code/classes/SCDclass_expcode.m
+21
-19
21 additions, 19 deletions
code/classes/SCDclass_expcode.m
with
22 additions
and
20 deletions
code/classes/SCDclass_algo.m
+
1
−
1
View file @
5c995789
...
...
@@ -245,7 +245,7 @@ classdef SCDclass_algo
function
printinits
(
obj
)
if
(
~
isempty
(
obj
.
stdinits
))
for
ii
=
1
:
numel
(
obj
.
stdinits
)
fprintf
(
'%s -> %s in workspace %s \n'
,
char
(
obj
.
stdinits
{
ii
}{
1
}),
char
(
obj
.
stdinits
{
ii
}{
2
}
,
obj
.
stdinits
{
ii
}{
3
}));
fprintf
(
'%s -> %s in workspace %s \n'
,
char
(
obj
.
stdinits
{
ii
}{
1
}),
char
(
obj
.
stdinits
{
ii
}{
2
}
{
1
}),
char
(
obj
.
stdinits
{
ii
}{
3
}));
end
end
end
...
...
This diff is collapsed.
Click to expand it.
code/classes/SCDclass_expcode.m
+
21
−
19
View file @
5c995789
...
...
@@ -399,27 +399,29 @@ classdef SCDclass_expcode
% Importing inits
algoinits
=
algo
.
getinits
;
if
(
numel
(
algoinits
)
>
0
)
for
ii
=
1
:
numel
(
algoinits
)
toadd
=
1
;
if
(
~
isempty
(
obj
.
stdinits
))
for
jj
=
1
:
numel
(
obj
.
stdinits
)
for
kk
=
1
:
numel
(
obj
.
stdinits
{
jj
}{
2
})
if
(
strcmp
(
char
(
obj
.
stdinits
{
jj
}{
2
}{
kk
}),
algoinits
{
ii
}{
2
}))
warning
(
'SCDclass_expcode:addalgorithm'
,
'An init driving the structure %s has already been added, ignoring algorithm object.\d'
,
algoinits
{
ii
}{
2
})
toadd
=
0
;
end
end
end
end
if
(
toadd
)
temp
=
cell
(
10
,
1
);
temp
{
1
}
=
algoinits
{
ii
}{
1
};
temp
{
2
}
=
algoinits
{
ii
}{
2
};
obj
.
stdinits
{
end
+
1
}
=
temp
;
obj
.
algoobjlist
{
end
+
1
}
=
algo
;
%% Add the full algorithm object here, to see if it is fine
toadd
=
ones
(
numel
(
algoinits
),
1
);
for
ii
=
1
:
numel
(
algoinits
)
if
(
~
isempty
(
obj
.
stdinits
))
for
jj
=
1
:
numel
(
obj
.
stdinits
)
for
kk
=
1
:
numel
(
obj
.
stdinits
{
jj
}{
2
})
if
(
strcmp
(
char
(
obj
.
stdinits
{
jj
}{
2
}{
kk
}),
algoinits
{
ii
}{
2
}))
warning
(
'SCDclass_expcode:addalgorithm'
,
'An init driving the structure %s has already been added, ignoring this init.\d'
,
algoinits
{
ii
}{
2
})
toadd
(
ii
)
=
0
;
end
end
end
end
end
if
toadd
(
ii
)
temp
=
cell
(
10
,
1
);
temp
{
1
}
=
algoinits
{
ii
}{
1
};
temp
{
2
}
=
algoinits
{
ii
}{
2
};
obj
.
stdinits
{
end
+
1
}
=
temp
;
end
end
if
any
(
toadd
)
% if any inits from this algoobj were taken
obj
.
algoobjlist
{
end
+
1
}
=
algo
;
%% Add the full algorithm object here, to see if it is fine
end
end
end
function
out
=
getexportedtps
(
obj
)
...
...
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