Skip to content

Commit

Permalink
Merge pull request #109 from SpM-lab/terasaki/fix-fit-part2
Browse files Browse the repository at this point in the history
Use std::copy
  • Loading branch information
terasakisatoshi authored Feb 6, 2025
2 parents 36b6ff2 + 68b5d67 commit 68f8563
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/sparseir/sampling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ inline Eigen::Tensor<T, N>& div_noalloc_inplace(

// Remove the extra argument '0'
ldiv_noalloc_inplace<T, N>(flatbuffer, svd, flatarr, workarr);

std::copy(flatbuffer.data(), flatbuffer.data() + flatbuffer.size(), buffer_perm.data());
auto inv_perm = getperm<N>(0, dim);
buffer = buffer_perm.shuffle(inv_perm).eval();
return buffer;
Expand Down
4 changes: 1 addition & 3 deletions test/sampling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ TEST_CASE("Two-dimensional TauSampling test", "[sampling]") {
}
}

/*
TEST_CASE("Sampling Tests") {
double beta = 1.0;
vector<double> lambdas = {10.0, 42.0};
Expand Down Expand Up @@ -333,7 +332,7 @@ TEST_CASE("Sampling Tests") {
//std::cout << "gl(0, 0, 0, 0) " << gl(0, 0, 0, 0) << std::endl;
//std::cout << "gl(0, 0, 0, 1) " << gl(0, 0, 0, 1) << std::endl;

//REQUIRE(sparseir::tensorIsApprox(gl_from_tau, gl, 1e-10));
REQUIRE(sparseir::tensorIsApprox(gl_from_tau, gl, 1e-10));
}

// Test evaluate and fit
Expand All @@ -346,7 +345,6 @@ TEST_CASE("Sampling Tests") {
}
}
}
*/

TEST_CASE("Matsubara Sampling Tests") {
double beta = 1.0;
Expand Down

0 comments on commit 68f8563

Please sign in to comment.