1 // 2 // BAGEL - Brilliantly Advanced General Electronic Structure Library 3 // Filename: xyzfile.h 4 // Copyright (C) 2012 Toru Shiozaki 5 // 6 // Author: Toru Shiozaki <shiozaki@northwestern.edu> 7 // Maintainer: Shiozaki group 8 // 9 // This file is part of the BAGEL package. 10 // 11 // This program is free software: you can redistribute it and/or modify 12 // it under the terms of the GNU General Public License as published by 13 // the Free Software Foundation, either version 3 of the License, or 14 // (at your option) any later version. 15 // 16 // This program is distributed in the hope that it will be useful, 17 // but WITHOUT ANY WARRANTY; without even the implied warranty of 18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 // GNU General Public License for more details. 20 // 21 // You should have received a copy of the GNU General Public License 22 // along with this program. If not, see <http://www.gnu.org/licenses/>. 23 // 24 25 26 #ifndef __SRC_MATH_XYZFILE_H 27 #define __SRC_MATH_XYZFILE_H 28 29 #include <src/util/math/matrix.h> 30 #include <src/util/math/matop.h> 31 32 namespace bagel { 33 34 class XYZFile : public Matrix { 35 protected: 36 37 public: 38 XYZFile(const size_t natom, const double a = 0.0) : Matrix(3, natom, true) { fill(a); } XYZFile(const XYZFile & o)39 XYZFile(const XYZFile& o) : Matrix(o) { assert(o.ndim() == 3 && localized_); } XYZFile(const Matrix & o)40 XYZFile(const Matrix& o) : Matrix(o) { localize(); assert(o.ndim() == 3); } 41 42 std::shared_ptr<XYZFile> clone() const; 43 44 void print(const std::string in = "", const int dum = 0) const override; 45 void print_export(const std::string in = "", const int dum = 0) const; 46 double maximum(int atomno) const; 47 48 // this function assumes that double[] has data_.size()*data_size() elements. 49 std::shared_ptr<XYZFile> transform(const std::shared_ptr<const Matrix>, const bool transpose) const; 50 51 }; 52 53 // to make the code readable 54 using GradFile = XYZFile; 55 56 } 57 58 #endif 59