Skip to content

Commit 0f0f86e

Browse files
author
Roberto Di Remigio
committed
Move one header file from utils directory
1 parent 440fdc7 commit 0f0f86e

File tree

4 files changed

+39
-23
lines changed

4 files changed

+39
-23
lines changed

include/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
list(APPEND headers_list Citation.hpp Cxx11Workarounds.hpp ErrorHandling.hpp LoggerInterface.hpp TimerInterface.hpp)
1+
list(APPEND headers_list Citation.hpp
2+
Cxx11Workarounds.hpp
3+
ErrorHandling.hpp
4+
LoggerInterface.hpp
5+
PhysicalConstants.hpp
6+
STLUtils.hpp
7+
TimerInterface.hpp
8+
)
29

310
# Sets install directory for all the headers in the list
411
foreach(_header ${headers_list})

src/utils/GeneralPurpose.hpp renamed to include/STLUtils.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,4 @@ inline void PRINT_MAPPED_ELEMENTS (const T& coll,
7070
std::cout << std::endl;
7171
}
7272

73-
template <typename Derived>
74-
inline void print_eigen_matrix(const Eigen::MatrixBase<Derived> & matrix, const std::string & fname)
75-
{
76-
std::ofstream fout;
77-
fout.open(fname.c_str());
78-
fout << " Row index " << '\t' << " Column index " << '\t' << " Matrix entry " << std::endl;
79-
int rows = matrix.rows();
80-
int cols = matrix.cols();
81-
for (int i = 0; i < rows; ++i) {
82-
for (int j = 0; j < cols; ++j) {
83-
fout << i << '\t' << j << '\t' << matrix(i, j) << std::endl;
84-
}
85-
}
86-
fout.close();
87-
}
88-
8973
#endif /*GENERALPURPOSE_HPP*/

src/bin/plot_green_spherical.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
/*
33
* PCMSolver, an API for the Polarizable Continuum Model
44
* Copyright (C) 2013-2015 Roberto Di Remigio, Luca Frediani and contributors
5-
*
5+
*
66
* This file is part of PCMSolver.
7-
*
7+
*
88
* PCMSolver is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU Lesser General Public License as published by
1010
* the Free Software Foundation, either version 3 of the License, or
1111
* (at your option) any later version.
12-
*
12+
*
1313
* PCMSolver is distributed in the hope that it will be useful,
1414
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1515
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
* GNU Lesser General Public License for more details.
17-
*
17+
*
1818
* You should have received a copy of the GNU Lesser General Public License
1919
* along with PCMSolver. If not, see <http://www.gnu.org/licenses/>.
20-
*
20+
*
2121
* For information on the complete list of contributors to the
2222
* PCMSolver API, see: <http://pcmsolver.readthedocs.org/>
2323
*/
@@ -33,7 +33,7 @@
3333

3434
#include "CollocationIntegrator.hpp"
3535
#include "DerivativeTypes.hpp"
36-
#include "GeneralPurpose.hpp"
36+
#include "STLUtils.hpp"
3737
#include "OneLayerTanh.hpp"
3838
#include "SphericalDiffuse.hpp"
3939
#include "UniformDielectric.hpp"

src/utils/MathUtils.hpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,31 @@ inline double splineInterpolation(const double point, const std::vector<double>
294294
return s(point);
295295
}
296296

297+
/*! \brief Prints Eigen object (matrix or vector) to file
298+
* \param[in] matrix Eigen object
299+
* \param[in] fname name of the file
300+
* \tparam Derived template parameters of the MatrixBase object
301+
*
302+
* \note This is for debugging only, the format is in fact rather ugly.
303+
* Row index Column index Matrix entry
304+
* 0 0 0.0000
305+
*/
306+
template <typename Derived>
307+
inline void print_eigen_matrix(const Eigen::MatrixBase<Derived> & matrix, const std::string & fname)
308+
{
309+
std::ofstream fout;
310+
fout.open(fname.c_str());
311+
fout << " Row index " << '\t' << " Column index " << '\t' << " Matrix entry " << std::endl;
312+
int rows = matrix.rows();
313+
int cols = matrix.cols();
314+
for (int i = 0; i < rows; ++i) {
315+
for (int j = 0; j < cols; ++j) {
316+
fout << i << '\t' << j << '\t' << matrix(i, j) << std::endl;
317+
}
318+
}
319+
fout.close();
320+
}
321+
297322
namespace cnpy
298323
{
299324
/*!

0 commit comments

Comments
 (0)