Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
Takin
mag-core
Commits
875e9a68
Commit
875e9a68
authored
Mar 13, 2019
by
Tobias WEBER
Browse files
small bugfixes
parent
e2862e54
Changes
3
Hide whitespace changes
Inline
Side-by-side
libs/_cxx20/math_algos.h
View file @
875e9a68
...
...
@@ -4497,11 +4497,11 @@ template<class t_mat>
std
::
tuple
<
t_mat
,
bool
>
inv
(
const
t_mat
&
mat
)
requires
is_mat
<
t_mat
>
{
// fail if matrix is not square
if
constexpr
(
m
::
is_dyn_mat
<
t_mat
>
)
// fail if matrix is not square
, TODO: fix
//
if constexpr(m::is_dyn_mat<t_mat>)
assert
((
mat
.
size1
()
==
mat
.
size2
()));
else
static_assert
(
mat
.
size1
()
==
mat
.
size2
());
//
else
//
static_assert(mat.size1() == mat.size2());
#ifdef USE_LAPACK
return
m_la
::
inv
<
t_mat
>
(
mat
);
...
...
@@ -4560,11 +4560,11 @@ std::tuple<t_vec, bool> leastsq(const t_vec& x, const t_vec& y, std::size_t orde
bool
use_qr
=
true
,
bool
use_pseudoinv
=
false
)
requires
is_vec
<
t_vec
>
&&
is_dyn_mat
<
t_mat
>
{
// check array sizes
if
constexpr
(
m
::
is_dyn_vec
<
t_vec
>
)
// check array sizes
, TODO: fix
//
if constexpr(m::is_dyn_vec<t_vec>)
assert
((
x
.
size
()
==
y
.
size
()));
else
static_assert
(
x
.
size
()
==
y
.
size
());
//
else
//
static_assert(x.size() == y.size());
using
namespace
m_ops
;
...
...
setup_ext.sh
View file @
875e9a68
#!/bin/bash
#
# downloads external libraries
# downloads external libraries
for in20tools
# @author Tobias Weber <tweber@ill.fr>
# @date 6-apr-18
# @license see 'LICENSE' file
...
...
tools/structfact/loadcif.h
View file @
875e9a68
...
...
@@ -162,12 +162,14 @@ load_cif(const std::string& filename, t_real eps=1e-6)
// make homogeneuous 4-vector
if
(
atom
.
size
()
==
3
)
atom
.
push_back
(
1
);
std
::
vector
<
t_vec
>
newatoms
=
m
::
apply_ops_hom
<
t_vec
,
t_mat
,
t_real
>
(
atom
,
ops
,
eps
);
// if no ops are given, just output the raw atom position
if
(
!
ops
.
size
())
{
generatedatoms
.
push_back
(
std
::
vector
<
t_vec
>
{{
atom
}});
continue
;
}
std
::
vector
<
t_vec
>
newatoms
=
m
::
apply_ops_hom
<
t_vec
,
t_mat
,
t_real
>
(
atom
,
ops
,
eps
);
generatedatoms
.
emplace_back
(
std
::
move
(
newatoms
));
}
...
...
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