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
Coenen, Joachim
Frida
Commits
2c956f0f
Commit
2c956f0f
authored
16 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
more info when points out of range
parent
2a3cf8fd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/dualplot.cpp
+28
-28
28 additions, 28 deletions
src/dualplot.cpp
src/dualplot.h
+2
-1
2 additions, 1 deletion
src/dualplot.h
src/edif.cpp
+2
-1
2 additions, 1 deletion
src/edif.cpp
with
32 additions
and
30 deletions
src/dualplot.cpp
+
28
−
28
View file @
2c956f0f
...
...
@@ -437,20 +437,18 @@ void NPlot::Box()
ps_accu
.
push_back
(
"
\n
%% modeDD
\n
plotbefore
\n
"
);
}
void
NPlot
::
Line
(
const
int
lstyle
,
const
vector
<
double
>
x
,
const
vector
<
double
>
y
,
const
vector
<
double
>*
z
,
const
string
xco
,
const
string
yco
)
void
NPlot
::
Line
(
const
int
lstyle
,
const
vector
<
double
>
x
,
const
vector
<
double
>
y
,
const
vector
<
double
>*
z
,
const
string
xco
,
const
string
yco
,
const
string
info
)
{
double
*
xp
,
*
yp
;
uint
np
=
0
,
nxl
=
0
,
nxh
=
0
,
nyl
=
0
,
nyh
=
0
;
uint
n
=
x
.
size
();
if
(
n
!=
y
.
size
())
{
printf
(
"PROG ERR NPLot::Line x.size<>y.size
\n
"
);
return
;
}
xp
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
n
);
yp
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
n
);
if
(
n
!=
y
.
size
())
throw
string
(
"PROG ERR NPLot::Line x.size<>y.size"
);
vector
<
double
>
xp
,
yp
;
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
{
if
(
!
X
.
force
&&
!
X
.
R
.
contained
(
x
[
i
]))
{
if
(
x
[
i
]
<=
X
.
R
.
inf
)
nxl
++
;
...
...
@@ -462,19 +460,26 @@ void NPlot::Line(const int lstyle,
if
(
y
[
i
]
>=
Y
.
R
.
sup
)
nyh
++
;
continue
;
}
if
(
np
==
maxpoints
&&
np
<
n
)
{
if
(
np
==
maxpoints
&&
np
<
n
)
{
printf
(
"reached maxpoints at %g
\n
"
,
x
[
i
]);
}
xp
[
np
]
=
x
[
i
];
yp
[
np
]
=
y
[
i
];
np
++
;
if
(
np
>
maxpoints
)
i
+=
maxpoints
;
xp
.
push_back
(
x
[
i
]
);
yp
.
push_back
(
y
[
i
]
);
np
=
xp
.
size
();
if
(
np
>
maxpoints
)
// continue in large steps
i
+=
maxpoints
;
}
if
(
np
==
0
)
{
printf
(
"no points in data range:
\n
"
"of %d points are
\n
%d left and %d right of the x range,"
"
\n
%d below and %d above of the y range
\n
"
,
n
,
nxl
,
nxh
,
nyl
,
nyh
);
if
(
np
==
0
)
{
printf
(
"%s : all %d points outside plot range:
\n
"
,
info
.
c_str
(),
n
);
if
(
nxl
)
printf
(
" %d points < xmin
\n
"
,
nxl
);
if
(
nxh
)
printf
(
" %d points > xmax
\n
"
,
nxh
);
if
(
nyl
)
printf
(
" %d points < ymin
\n
"
,
nyl
);
if
(
nyh
)
printf
(
" %d points > ymax
\n
"
,
nyh
);
return
;
}
...
...
@@ -489,10 +494,8 @@ void NPlot::Line(const int lstyle,
if
(
lstyle
<
0
)
gp_fnames
+=
" with lines"
;
FILE
*
gp_fd
;
if
(
!
(
gp_fd
=
fopen
(
gp_fnam
,
"w"
)))
{
printf
(
"cannot save gnuplot data to %s"
,
gp_fnam
);
return
;
}
if
(
!
(
gp_fd
=
fopen
(
gp_fnam
,
"w"
)))
throw
string
(
"cannot save gnuplot data to "
)
+
gp_fnam
;
for
(
uint
i
=
0
;
i
<
np
;
i
++
)
fprintf
(
gp_fd
,
"%20.12g %20.12g
\n
"
,
xp
[
i
],
yp
[
i
]);
fclose
(
gp_fd
);
...
...
@@ -527,9 +530,6 @@ void NPlot::Line(const int lstyle,
i
==
0
?
'i'
:
i
==
np
-
1
?
'f'
:
' '
,
xp
[
i
],
yp
[
i
]
);
ps_accu
.
push_back
(
outlin
);
}
free
(
xp
);
free
(
yp
);
}
void
NPlot
::
Doc
(
vector
<
string
>
lDoc
)
...
...
This diff is collapsed.
Click to expand it.
src/dualplot.h
+
2
−
1
View file @
2c956f0f
...
...
@@ -66,7 +66,8 @@ namespace NPlot { // additional declarations in dualplot.cpp
void
Line
(
const
int
lstyle
,
const
vector
<
double
>
x
,
const
vector
<
double
>
y
,
const
vector
<
double
>*
z
,
const
string
xco
,
const
string
yco
);
const
string
xco
,
const
string
yco
,
const
string
info
);
void
Doc
(
vector
<
string
>
lDoc
);
void
Save
(
bool
full_outfile
);
void
Dialog
(
void
);
...
...
This diff is collapsed.
Click to expand it.
src/edif.cpp
+
2
−
1
View file @
2c956f0f
...
...
@@ -1008,7 +1008,8 @@ void NEdif::Plot( bool add )
}
else
throw
string
(
"PROGRAM ERROR plot invalid *e"
);
NPlot
::
Line
(
lstyle
,
s
->
x
,
s
->
y
,
e
->
Z
(
j
),
e
->
P
()
->
xco
.
str
(),
e
->
P
()
->
yco
.
str
()
);
e
->
P
()
->
xco
.
str
(),
e
->
P
()
->
yco
.
str
(),
"file "
+
strg
(
k
)
+
" scan "
+
strg
(
j
)
);
}
NPlot
::
Doc
(
e
->
P
()
->
lDoc
);
if
(
fc
)
...
...
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