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
7cc9ef3e
Commit
7cc9ef3e
authored
10 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
trivial embelishments of libtrivia.
parent
7bf37839
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
pub/lib/manip.cpp
+1
-1
1 addition, 1 deletion
pub/lib/manip.cpp
pub/trivia/vector_ops.cpp
+7
-7
7 additions, 7 deletions
pub/trivia/vector_ops.cpp
pub/trivia/vector_ops.hpp
+2
-2
2 additions, 2 deletions
pub/trivia/vector_ops.hpp
with
10 additions
and
10 deletions
pub/lib/manip.cpp
+
1
−
1
View file @
7cc9ef3e
...
...
@@ -643,7 +643,7 @@ void NManip::ScaExch()
for
(
int
i
=
0
;
i
<
fin
->
VS
(
j
)
->
size
();
++
i
)
xcommon
.
push_back
(
fin
->
VS
(
j
)
->
x
[
i
]
);
sort
(
xcommon
.
begin
(),
xcommon
.
end
()
);
triv
::
unique
(
&
xcommon
,
1e-180
,
1e-20
);
triv
::
make_
unique
(
&
xcommon
,
1e-180
,
1e-20
);
printf
(
"group of spectra %u .. %u has %i different x
\n
"
,
ji
,
jf
-
1
,
(
int
)
xcommon
.
size
());
...
...
This diff is collapsed.
Click to expand it.
pub/trivia/vector_ops.cpp
+
7
−
7
View file @
7cc9ef3e
...
...
@@ -20,9 +20,9 @@ using namespace std;
//* vector operations *//
//***************************************************************************//
//! Insert val into vector *V, presuming the latter is sorted.
//! Insert
s
val into vector *V, presuming the latter is sorted.
void
triv
::
merge
(
vector
<
double
>
*
V
,
double
val
)
void
triv
::
insert_in_sorted
(
vector
<
double
>
*
V
,
double
val
)
{
for
(
size_t
i
=
0
;
i
<
V
->
size
();
++
i
)
{
if
(
val
>
(
*
V
)[
i
])
continue
;
...
...
@@ -33,9 +33,9 @@ void triv::merge( vector<double> *V, double val )
V
->
push_back
(
val
);
}
//! Eliminate double entries from vector V.
//! Eliminate
s
double entries from vector V.
void
triv
::
unique
(
vector
<
double
>
*
V
,
double
tolabs
,
double
tolrel
)
void
triv
::
make_
unique
(
vector
<
double
>
*
V
,
double
tolabs
,
double
tolrel
)
{
// tolrel z.Zt. nicht benutzt
vector
<
double
>
aux
;
...
...
@@ -48,7 +48,7 @@ void triv::unique( vector<double> *V, double tolabs, double tolrel )
*
V
=
aux
;
}
//!
T
rue unless V[i]<=V[i-1] for some i.
//!
Returns
rue unless V[i]<=V[i-1] for some i.
bool
triv
::
is_ascending
(
const
vector
<
double
>&
V
)
{
...
...
@@ -58,7 +58,7 @@ bool triv::is_ascending( const vector<double>& V )
return
true
;
}
//!
D
et
ect
equidistant
grid
, set *step.
//!
R
et
urns true if grid is
equidistant, set
s
*step.
bool
triv
::
is_equidist
(
double
*
step
,
const
vector
<
double
>&
V
)
{
...
...
@@ -72,7 +72,7 @@ bool triv::is_equidist( double *step, const vector<double>& V )
return
true
;
}
//!
Compute
array of
sorted
indices.
//!
Returns
array of indices
sorted according to V
.
vector
<
size_t
>
triv
::
sorted_indices
(
vector
<
double
>
const
&
V
)
{
...
...
This diff is collapsed.
Click to expand it.
pub/trivia/vector_ops.hpp
+
2
−
2
View file @
7cc9ef3e
...
...
@@ -9,8 +9,8 @@ namespace triv {
using
namespace
std
;
void
merge
(
vector
<
double
>
*
V
,
double
val
);
void
unique
(
vector
<
double
>
*
V
,
void
insert_in_sorted
(
vector
<
double
>
*
V
,
double
val
);
void
make_
unique
(
vector
<
double
>
*
V
,
double
tolabs
=
1e-100
,
double
tolrel
=
1e-10
);
bool
is_ascending
(
const
vector
<
double
>&
V
);
bool
is_equidist
(
double
*
step
,
const
vector
<
double
>&
V
);
...
...
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