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

small bugfixes

parent e2862e54
......@@ -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;
......
#!/bin/bash
#
# downloads external libraries
# downloads external libraries for in20tools
# @author Tobias Weber <tweber@ill.fr>
# @date 6-apr-18
# @license see 'LICENSE' file
......
......@@ -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));
}
......
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