Commit 875e9a68 authored by Tobias WEBER's avatar Tobias WEBER
Browse files

small bugfixes

parent e2862e54
...@@ -4497,11 +4497,11 @@ template<class t_mat> ...@@ -4497,11 +4497,11 @@ template<class t_mat>
std::tuple<t_mat, bool> inv(const t_mat& mat) std::tuple<t_mat, bool> inv(const t_mat& mat)
requires is_mat<t_mat> requires is_mat<t_mat>
{ {
// fail if matrix is not square // fail if matrix is not square, TODO: fix
if constexpr(m::is_dyn_mat<t_mat>) //if constexpr(m::is_dyn_mat<t_mat>)
assert((mat.size1() == mat.size2())); assert((mat.size1() == mat.size2()));
else //else
static_assert(mat.size1() == mat.size2()); // static_assert(mat.size1() == mat.size2());
#ifdef USE_LAPACK #ifdef USE_LAPACK
return m_la::inv<t_mat>(mat); 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 ...@@ -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) bool use_qr=true, bool use_pseudoinv=false)
requires is_vec<t_vec> && is_dyn_mat<t_mat> requires is_vec<t_vec> && is_dyn_mat<t_mat>
{ {
// check array sizes // check array sizes, TODO: fix
if constexpr(m::is_dyn_vec<t_vec>) //if constexpr(m::is_dyn_vec<t_vec>)
assert((x.size() == y.size())); assert((x.size() == y.size()));
else //else
static_assert(x.size() == y.size()); // static_assert(x.size() == y.size());
using namespace m_ops; using namespace m_ops;
......
#!/bin/bash #!/bin/bash
# #
# downloads external libraries # downloads external libraries for in20tools
# @author Tobias Weber <tweber@ill.fr> # @author Tobias Weber <tweber@ill.fr>
# @date 6-apr-18 # @date 6-apr-18
# @license see 'LICENSE' file # @license see 'LICENSE' file
......
...@@ -162,12 +162,14 @@ load_cif(const std::string& filename, t_real eps=1e-6) ...@@ -162,12 +162,14 @@ load_cif(const std::string& filename, t_real eps=1e-6)
// make homogeneuous 4-vector // make homogeneuous 4-vector
if(atom.size() == 3) atom.push_back(1); 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 no ops are given, just output the raw atom position
if(!ops.size()) if(!ops.size())
{
generatedatoms.push_back(std::vector<t_vec>{{atom}}); 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)); generatedatoms.emplace_back(std::move(newatoms));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment