Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Frida
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
Service Desk
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
mlz
Frida
Commits
e69c5a8e
Commit
e69c5a8e
authored
15 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
removed obsolete, unused, misleading, duplicate Load routines from CEle and CScan
parent
a9a108ea
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pub/src/olm.cpp
+0
-81
0 additions, 81 deletions
pub/src/olm.cpp
pub/src/olm.h
+0
-1
0 additions, 1 deletion
pub/src/olm.h
pub/src/scan.cpp
+11
-66
11 additions, 66 deletions
pub/src/scan.cpp
pub/src/scan.h
+2
-5
2 additions, 5 deletions
pub/src/scan.h
with
13 additions
and
153 deletions
pub/src/olm.cpp
+
0
−
81
View file @
e69c5a8e
...
...
@@ -226,87 +226,6 @@ void CEle::Save( FILE *fd, string fmt )
};
//! OBSOLETE ??? ( obsoleted by File_io ? )
void
CEle
::
Load
(
FILE
*
fd
,
string
fshort
)
{
throw
string
(
" sorry, in oct07 JWu thought Ele::Load was obsolete"
);
COlc
C
;
COld
D
;
CScan
DS
;
CCurve
CS
;
CCoord
co
;
uint
iz
,
nj
=
0
,
j
;
string
lin
,
test
;
if
(
mystd
::
freadln
(
fd
,
&
lin
)
<=
0
)
throw
string
(
"! file empty or starting with empty line"
);
if
(
lin
!=
string
(
"ASCII-01 JWu"
))
throw
"! unknown file format: "
+
lin
;
if
(
mystd
::
freadln
(
fd
,
&
lin
)
<=
0
)
throw
string
(
"! unexpected empty line
\n
"
);
if
(
lin
.
substr
(
0
,
4
)
!=
string
(
"typ "
))
throw
string
(
"! missing
\"
typ
\"
entry
\n
"
);
if
(
lin
.
substr
(
4
)
==
"D"
)
{
Typ
=
DATA
;
Ptr
=
&
D
;
}
else
if
(
lin
.
substr
(
4
)
==
"C"
)
{
Typ
=
CURVE
;
Ptr
=
&
C
;
}
else
throw
"FATAL: invalid type: "
+
lin
.
substr
(
4
);
P
()
->
name
=
fshort
;
while
(
1
)
{
if
(
mystd
::
freadln
(
fd
,
&
lin
)
<
0
)
throw
string
(
"! unexpected end-of-file"
);
if
(
lin
==
"eof"
)
{
NOlm
::
OloAdd
(
P
())
->
P
()
->
as_on_disk
=
true
;
return
;
// regular exit
}
else
if
(
lin
.
substr
(
0
,
4
)
==
"fil "
)
{
if
(
lin
.
substr
(
4
)
!=
fshort
)
{
printf
(
"! warning: file %s renamed from %s
\n
"
,
fshort
.
c_str
(),
lin
.
substr
(
4
).
c_str
());
}
}
else
if
(
lin
.
substr
(
0
,
4
)
==
"doc "
)
{
P
()
->
lDoc
.
push_back
(
lin
.
substr
(
4
));
}
else
if
(
lin
.
substr
(
0
,
4
)
==
"x "
)
{
P
()
->
xco
.
load
(
lin
.
substr
(
4
));
}
else
if
(
lin
.
substr
(
0
,
4
)
==
"y "
)
{
P
()
->
yco
.
load
(
lin
.
substr
(
4
));
}
else
if
(
lin
[
0
]
==
'z'
)
{
if
(
sscanf
(
lin
.
substr
(
1
,
3
).
c_str
(),
"%u"
,
&
iz
)
!=
1
)
throw
string
(
"z coordinates must be numbered"
);
if
(
iz
!=
P
()
->
ZCo
.
size
())
throw
string
(
"z coordinates must be sorted"
);
co
.
load
(
lin
.
substr
(
4
));
P
()
->
ZCo
.
push_back
(
co
);
}
else
if
(
lin
.
substr
(
0
,
4
)
==
"#j "
)
{
if
(
sscanf
(
lin
.
substr
(
4
).
c_str
(),
"%u"
,
&
nj
)
!=
1
)
throw
string
(
"after label #j no no. of scans"
);
}
else
if
(
lin
.
substr
(
0
,
4
)
==
"scn "
)
{
if
(
sscanf
(
lin
.
substr
(
4
).
c_str
(),
"%u"
,
&
j
)
!=
1
)
{
throw
string
(
"! number of scan not given
\n
"
);
}
else
if
(
j
!=
nScan
())
{
printf
(
"scan %u, label %u
\n
"
,
nScan
(),
j
);
throw
string
(
"inconsistency in input file"
);
}
if
(
Typ
==
DATA
)
{
DS
.
Load
(
fd
,
P
()
->
ZCo
.
size
()
);
D
.
VS
.
push_back
(
DS
);
}
else
if
(
Typ
==
CURVE
)
{
CS
.
Load
(
fd
,
P
()
->
ZCo
.
size
()
);
C
.
VC
.
push_back
(
CS
);
}
else
throw
string
(
"FATAL: invalid Typ"
);
}
else
throw
"! Unexpected label "
+
lin
.
substr
(
0
,
4
);
}
}
//***************************************************************************//
//* namespace NOlm *//
//***************************************************************************//
...
...
This diff is collapsed.
Click to expand it.
pub/src/olm.h
+
0
−
1
View file @
e69c5a8e
...
...
@@ -147,7 +147,6 @@ class CEle {
else
if
(
Typ
==
CURVE
)
return
&
(((
COlc
*
)
Ptr
)
->
VC
[
j
].
z
);
else
throw
string
(
"FATAL ERROR in CEle:Z()"
);
};
void
Load
(
FILE
*
fd
,
string
fshort
);
void
Save
(
FILE
*
fd
,
string
fmt
);
};
...
...
This diff is collapsed.
Click to expand it.
pub/src/scan.cpp
+
11
−
66
View file @
e69c5a8e
...
...
@@ -18,29 +18,24 @@
//* Construct or modify *//
//**************************************************************************//
CScan
::
CScan
(
const
vector
<
double
>&
X_in
,
const
vector
<
double
>&
Y_in
,
const
vector
<
double
>&
Z_in
)
{
if
(
X_in
.
size
()
!=
Y_in
.
size
())
throw
string
(
"PROGRAM ERROR: cannot make scan "
"from incompatible input vectors"
);
x
=
X_in
;
y
=
Y_in
;
z
=
Z_in
;
}
//! Append given data point.
void
CScan
::
push_back
(
const
double
x_in
,
const
double
y_in
)
void
CScan
::
push_back
(
const
double
x_in
,
const
double
y_in
)
{
x
.
push_back
(
x_in
);
y
.
push_back
(
y_in
);
}
void
CScan
::
erase
(
const
uint
begin
,
const
uint
end
)
//! Remove data points according to given indices.
void
CScan
::
erase
(
const
uint
begin
,
const
uint
end
)
{
x
.
erase
(
x
.
begin
()
+
begin
,
x
.
begin
()
+
end
);
y
.
erase
(
y
.
begin
()
+
begin
,
y
.
begin
()
+
end
);
x
.
erase
(
x
.
begin
()
+
begin
,
x
.
begin
()
+
end
);
y
.
erase
(
y
.
begin
()
+
begin
,
y
.
begin
()
+
end
);
}
//! Reset to initial state.
void
CScan
::
Clear
(
void
)
{
x
.
clear
();
...
...
@@ -52,6 +47,8 @@ void CScan::Clear(void)
//* Input, output *//
//**************************************************************************//
//! Write scan to open file.
void
CScan
::
Save
(
FILE
*
fd
,
string
fmt
)
const
{
if
(
fmt
==
"y08"
){
...
...
@@ -70,58 +67,6 @@ void CScan::Save( FILE *fd, string fmt ) const
}
}
int
CScan
::
Load
(
FILE
*
fd
,
uint
nz
)
{
int
err
;
uint
i
,
m
;
char
lab
[
4
];
double
v
,
w
;
Clear
();
if
((
err
=
fscanf
(
fd
,
"%4c%u
\n
"
,
lab
,
&
m
))
!=
2
)
{
printf
(
"! expecting Z head line, found %d entries
\n
"
,
err
);
return
-
1
;
}
if
(
strncmp
(
lab
,
"Z "
,
4
))
{
printf
(
"! found [%s] in Z head line
\n
"
,
lab
);
return
-
1
;
}
if
(
m
!=
nz
)
{
printf
(
"! found %u Z entries, expecting %u
\n
"
,
m
,
nz
);
return
-
1
;
}
for
(
i
=
0
;
i
<
nz
;
i
++
)
{
if
((
err
=
fscanf
(
fd
,
"%lg
\n
"
,
&
v
))
!=
1
)
{
printf
(
"! expecting z value, found %d entries
\n
"
,
err
);
return
-
1
;
}
z
.
push_back
(
v
);
}
// printf(".. read %u z values\n", nz);
if
((
err
=
fscanf
(
fd
,
"%4c%u
\n
"
,
lab
,
&
m
))
!=
2
)
{
printf
(
"! expecting XY head line, found %d entries
\n
"
,
err
);
return
-
1
;
}
if
(
strncmp
(
lab
,
"XY "
,
4
))
{
printf
(
"! found [%s] in XY head line
\n
"
,
lab
);
return
-
1
;
}
for
(
i
=
0
;
i
<
m
;
i
++
)
{
if
((
err
=
fscanf
(
fd
,
"%lg %lg
\n
"
,
&
v
,
&
w
))
!=
2
)
{
printf
(
"! expecting xy pair, found %d entries
\n
"
,
err
);
return
-
1
;
}
push_back
(
v
,
w
);
}
// printf(".. read %u xy pairs\n", m);
return
0
;
}
//**************************************************************************//
//* Extract data *//
//**************************************************************************//
...
...
This diff is collapsed.
Click to expand it.
pub/src/scan.h
+
2
−
5
View file @
e69c5a8e
...
...
@@ -5,16 +5,13 @@ class CScan {
// construct, modify:
inline
CScan
()
{};
CScan
(
const
vector
<
double
>&
X_in
,
const
vector
<
double
>&
Y_in
,
const
vector
<
double
>&
Z_in
);
void
push_back
(
const
double
x_in
,
const
double
y_in
);
void
push_back
(
const
double
x_in
,
const
double
y_in
);
void
Clear
(
void
);
void
erase
(
const
uint
begin
,
const
uint
end
);
void
erase
(
const
uint
begin
,
const
uint
end
);
// input, output:
void
Save
(
FILE
*
fd
,
string
fmt
)
const
;
int
Load
(
FILE
*
fd
,
uint
nz
);
// extract data:
size_t
size
()
const
;
...
...
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