Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
utils
Commits
e6578505
Commit
e6578505
authored
23 years ago
by
Stuart Clare
Browse files
Options
Downloads
Patches
Plain Diff
Edited string_to_T(vector<int> &vi, const string& s)
parent
354e6b8c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
functions.cc
+38
-12
38 additions, 12 deletions
functions.cc
with
38 additions
and
12 deletions
functions.cc
+
38
−
12
View file @
e6578505
...
...
@@ -48,23 +48,49 @@ namespace Utilities {
}
bool
string_to_T
(
vector
<
int
>&
vi
,
const
string
&
s
)
{
string
str
=
s
+
','
;
vi
.
assign
(
0
,
0
);
while
(
str
.
size
())
{
float
v
=
atof
(
str
.
substr
(
0
,
str
.
find
(
","
)).
c_str
());
vi
.
push_back
(
v
);
str
=
str
.
substr
(
str
.
find
(
","
)
+
1
,
str
.
length
()
-
str
.
find
(
","
)
-
1
);
string
str
=
s
;
if
(
str
.
find
(
":"
)
!=
string
::
npos
){
int
a
=
atoi
(
str
.
substr
(
0
,
str
.
find
(
":"
)).
c_str
());
str
=
str
.
substr
(
str
.
find
(
":"
)
+
1
,
str
.
length
()
-
str
.
find
(
":"
)
-
1
);
int
b
=
atoi
(
str
.
substr
(
0
,
str
.
find
(
":"
)).
c_str
());
str
=
str
.
substr
(
str
.
find
(
":"
)
+
1
,
str
.
length
()
-
str
.
find
(
":"
)
-
1
);
int
c
=
atoi
(
str
.
c_str
());
while
(
a
<=
c
){
vi
.
push_back
(
a
);
a
+=
b
;
}
}
else
{
str
=
str
+
','
;
vi
.
assign
(
0
,
0
);
while
(
str
.
size
())
{
int
v
=
atoi
(
str
.
substr
(
0
,
str
.
find
(
","
)).
c_str
());
vi
.
push_back
(
v
);
str
=
str
.
substr
(
str
.
find
(
","
)
+
1
,
str
.
length
()
-
str
.
find
(
","
)
-
1
);
}
}
return
true
;
}
bool
string_to_T
(
vector
<
float
>&
vi
,
const
string
&
s
)
{
string
str
=
s
+
','
;
vi
.
assign
(
0
,
0
);
while
(
str
.
size
())
{
float
v
=
atof
(
str
.
substr
(
0
,
str
.
find
(
","
)).
c_str
());
vi
.
push_back
(
v
);
str
=
str
.
substr
(
str
.
find
(
","
)
+
1
,
str
.
length
()
-
str
.
find
(
","
)
-
1
);
string
str
=
s
;
if
(
str
.
find
(
":"
)
!=
string
::
npos
){
float
a
=
atof
(
str
.
substr
(
0
,
str
.
find
(
":"
)).
c_str
());
str
=
str
.
substr
(
str
.
find
(
":"
)
+
1
,
str
.
length
()
-
str
.
find
(
":"
)
-
1
);
float
b
=
atof
(
str
.
substr
(
0
,
str
.
find
(
":"
)).
c_str
());
str
=
str
.
substr
(
str
.
find
(
":"
)
+
1
,
str
.
length
()
-
str
.
find
(
":"
)
-
1
);
float
c
=
atof
(
str
.
c_str
());
while
(
a
<=
c
){
vi
.
push_back
(
a
);
a
+=
b
;
}
}
else
{
str
=
str
+
','
;
vi
.
assign
(
0
,
0
);
while
(
str
.
size
())
{
float
v
=
atof
(
str
.
substr
(
0
,
str
.
find
(
","
)).
c_str
());
vi
.
push_back
(
v
);
str
=
str
.
substr
(
str
.
find
(
","
)
+
1
,
str
.
length
()
-
str
.
find
(
","
)
-
1
);
}
}
return
true
;
}
...
...
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