Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
BornAgain
Commits
78dad0a2
Commit
78dad0a2
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
rm 2 unused util fcts
parent
27fe7526
No related branches found
No related tags found
1 merge request
!2006
restore coverage tool, and remove some unused code
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Base/Util/VectorUtil.cpp
+0
-36
0 additions, 36 deletions
Base/Util/VectorUtil.cpp
Base/Util/VectorUtil.h
+0
-5
0 additions, 5 deletions
Base/Util/VectorUtil.h
with
0 additions
and
41 deletions
Base/Util/VectorUtil.cpp
+
0
−
36
View file @
78dad0a2
...
...
@@ -13,42 +13,6 @@
// ************************************************************************************************
#include
"Base/Util/VectorUtil.h"
#include
<cmath>
#include
<stdexcept>
bool
VectorUtil
::
is_equidistant
(
const
std
::
vector
<
double
>&
vec
,
double
tol
)
{
double
span
=
vec
.
back
()
-
vec
.
front
();
if
(
span
==
0.
)
{
for
(
std
::
size_t
i
=
1
;
i
<
vec
.
size
()
-
1
;
++
i
)
if
(
vec
[
i
]
!=
vec
.
front
())
return
false
;
return
true
;
}
double
step
=
span
/
vec
.
size
();
for
(
std
::
size_t
i
=
1
;
i
<
vec
.
size
()
-
1
;
++
i
)
if
(
fabs
(
vec
[
i
])
-
(
vec
.
front
()
+
i
*
step
)
>
tol
*
step
)
return
false
;
return
true
;
}
std
::
vector
<
double
>
VectorUtil
::
make_grid
(
std
::
size_t
n
,
double
first
,
double
last
)
{
std
::
vector
<
double
>
result
;
result
.
reserve
(
n
);
if
(
n
==
1
)
{
if
(
first
!=
last
)
throw
std
::
runtime_error
(
"Cannot make grid of size 1 unless first == last"
);
result
.
push_back
(
first
);
return
result
;
}
for
(
std
::
size_t
i
=
0
;
i
<
n
;
++
i
)
result
.
push_back
(
first
+
i
*
(
last
-
first
)
/
(
n
-
1
));
return
result
;
}
std
::
vector
<
double
>
VectorUtil
::
real
(
const
std
::
vector
<
complex_t
>&
v
)
{
...
...
This diff is collapsed.
Click to expand it.
Base/Util/VectorUtil.h
+
0
−
5
View file @
78dad0a2
...
...
@@ -20,11 +20,6 @@
namespace
VectorUtil
{
//! Returns true if vector is equidistant within tol * bin_width.
bool
is_equidistant
(
const
std
::
vector
<
double
>&
vec
,
double
tol
);
std
::
vector
<
double
>
make_grid
(
std
::
size_t
n
,
double
first
,
double
last
);
//! Returns vector of real parts.
std
::
vector
<
double
>
real
(
const
std
::
vector
<
complex_t
>&
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