ergo
files_dense.h
Go to the documentation of this file.
1/* Ergo, version 3.8.2, a program for linear scaling electronic structure
2 * calculations.
3 * Copyright (C) 2023 Elias Rudberg, Emanuel H. Rubensson, Pawel Salek,
4 * and Anastasia Kruchinina.
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Primary academic reference:
20 * Ergo: An open-source program for linear-scaling electronic structure
21 * calculations,
22 * Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, and Anastasia
23 * Kruchinina,
24 * SoftwareX 7, 107 (2018),
25 * <http://dx.doi.org/10.1016/j.softx.2018.03.005>
26 *
27 * For further information about Ergo, see <http://www.ergoscf.org>.
28 */
29
38#ifndef FILES_DENSE_HEADER_TXT
39#define FILES_DENSE_HEADER_TXT
40
41#include "realtype.h" // definitions of types (utilities_basic)
42
43#include <iostream>
44#include <fstream>
45#include <vector>
46#include <cmath>
47#include <string.h>
48
49
50using namespace std;
51
53#define PRECISION 16
54
55
56
57/* READ DENSE MATRIX FROM THE FILE */
58int read_matrix(const char *filename, vector<real> &A, int &N, int &M, bool is_binary = false);
59
60int read_vector(const char *filename, vector<real> &A, int &N, bool is_binary);
61
62/* WRITE DENSE MATRIX TO THE FILE */
63int write_matrix(const char *filename, const vector<real> &A, int N, int M);
64
65/* WRITE VECTOR TO THE FILE */
66int write_vector(const char *filename, const vector<real> &v);
67
68
69
70#endif //FILES_DENSE_HEADER_TXT
71
72
73
74
ergo_real real
Definition: files_dense.h:52
int write_vector(const char *filename, const vector< real > &v)
Definition: files_dense.cc:206
int read_matrix(const char *filename, vector< real > &A, int &N, int &M, bool is_binary=false)
Definition: files_dense.cc:48
int write_matrix(const char *filename, const vector< real > &A, int N, int M)
Definition: files_dense.cc:179
int read_vector(const char *filename, vector< real > &A, int &N, bool is_binary)
Definition: files_dense.cc:115
#define A
Definition of the main floating-point datatype used; the ergo_real type.
double ergo_real
Definition: realtype.h:69