Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alta
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
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
alta
alta
Commits
b68aba5e
Commit
b68aba5e
authored
Nov 04, 2013
by
Laurent Belcour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working interpolant.
Changed the interface of the data2gnuplot.
parent
77e15f1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
sources/plugins/data_interpolant/data.cpp
sources/plugins/data_interpolant/data.cpp
+1
-1
sources/softs/data2gnuplot/main.cpp
sources/softs/data2gnuplot/main.cpp
+16
-10
No files found.
sources/plugins/data_interpolant/data.cpp
View file @
b68aba5e
...
...
@@ -12,7 +12,7 @@ data_interpolant::data_interpolant()
_kdtree
=
new
flann
::
Index
<
flann
::
L2
<
double
>
>
(
flann
::
KDTreeIndexParams
(
4
));
_data
=
new
vertical_segment
();
_knn
=
10
;
_knn
=
3
;
}
data_interpolant
::~
data_interpolant
()
...
...
sources/softs/data2gnuplot/main.cpp
View file @
b68aba5e
...
...
@@ -17,7 +17,7 @@ int main(int argc, char** argv)
arguments
args
(
argc
,
argv
)
;
if
(
args
.
is_defined
(
"help"
))
{
std
::
cout
<<
"<<HELP>> data2gnuplot --input data.file --output gnuplot.file --
loader
loader.so"
<<
std
::
endl
;
std
::
cout
<<
"<<HELP>> data2gnuplot --input data.file --output gnuplot.file --
data
loader.so"
<<
std
::
endl
;
std
::
cout
<<
" - input and output are mandatory parameters"
<<
std
::
endl
;
return
0
;
}
...
...
@@ -32,7 +32,7 @@ int main(int argc, char** argv)
}
data
*
d
=
NULL
;
d
=
plugins_manager
::
get_data
(
args
[
"
loader
"
])
;
d
=
plugins_manager
::
get_data
(
args
[
"
data
"
])
;
d
->
load
(
args
[
"input"
]);
// Create output file
...
...
@@ -49,18 +49,24 @@ int main(int argc, char** argv)
in
[
1
]
=
sin
(
phi_in
)
*
sin
(
theta_in
);
in
[
2
]
=
cos
(
theta_in
);
const
int
N
=
1000
;
vec
_min
=
d
->
min
();
vec
_max
=
d
->
max
();
vec
x
(
d
->
dimX
());
x
=
_min
+
0.5
*
(
_max
-
_min
);
const
int
N
=
100
;
for
(
int
i
=
0
;
i
<
N
;
++
i
)
for
(
int
j
=
0
;
j
<
N
;
++
j
)
{
double
phi
=
(
i
-
N
/
2
)
*
M_PI
/
(
N
-
1
)
*
2
;
double
theta
=
(
j
-
N
/
2
)
*
M_PI
/
(
N
-
1
)
;
out
[
0
]
=
cos
(
phi
)
*
sin
(
theta
);
out
[
1
]
=
sin
(
phi
)
*
sin
(
theta
);
out
[
2
]
=
cos
(
theta
);
vec
v
=
d
->
value
(
in
,
out
)
;
x
[
0
]
=
_min
[
0
]
+
(
_max
[
0
]
-
_min
[
0
])
*
double
(
i
)
/
double
(
N
-
1
);
x
[
1
]
=
_min
[
1
]
+
(
_max
[
1
]
-
_min
[
1
])
*
double
(
j
)
/
double
(
N
-
1
);
vec
v
=
d
->
value
(
x
)
;
file
<<
phi
<<
"
\t
"
<<
theta
<<
"
\t
"
;
for
(
int
u
=
0
;
u
<
d
->
dimX
();
++
u
)
{
file
<<
x
[
u
]
<<
"
\t
"
;
}
for
(
int
u
=
0
;
u
<
d
->
dimY
();
++
u
)
{
file
<<
v
[
u
]
<<
"
\t
"
;
...
...
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