Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads
hbio.hpp
Go to the documentation of this file.
1 
5 /* Copyright (c) 2005-2010,2012 Taneli Kalvas. All rights reserved.
6  *
7  * You can redistribute this software and/or modify it under the terms
8  * of the GNU General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this library (file "COPYING" included in the package);
19  * if not, write to the Free Software Foundation, Inc., 51 Franklin
20  * Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * If you have questions about your rights to use or distribute this
23  * software, please contact Berkeley Lab's Technology Transfer
24  * Department at TTD@lbl.gov. Other questions, comments and bug
25  * reports should be sent directly to the author via email at
26  * taneli.kalvas@jyu.fi.
27  *
28  * NOTICE. This software was developed under partial funding from the
29  * U.S. Department of Energy. As such, the U.S. Government has been
30  * granted for itself and others acting on its behalf a paid-up,
31  * nonexclusive, irrevocable, worldwide license in the Software to
32  * reproduce, prepare derivative works, and perform publicly and
33  * display publicly. Beginning five (5) years after the date
34  * permission to assert copyright is obtained from the U.S. Department
35  * of Energy, and subject to any subsequent five (5) year renewals,
36  * the U.S. Government is granted for itself and others acting on its
37  * behalf a paid-up, nonexclusive, irrevocable, worldwide license in
38  * the Software to reproduce, prepare derivative works, distribute
39  * copies to the public, perform publicly and display publicly, and to
40  * permit others to do so.
41  */
42 
43 #ifndef HBIO_HPP
44 #define HBIO_HPP 1
45 
46 
47 #include <cstdlib>
48 #include <iostream>
49 #include "error.hpp"
50 #include "mvector.hpp"
51 #include "ccolmatrix.hpp"
52 
53 
66 class HBIO {
67  std::string filename;
68  std::string title;
69  std::string key;
70  int valacc;
71  int rhsacc;
72 
73  CColMatrix mat;
74  Vector rhs;
75  Vector sol;
76 
77 public:
78 
81  HBIO();
82 
85  ~HBIO();
86 
89  void write( const std::string filename ) const;
90 
93  void read( const std::string filename );
94 
97  const std::string get_title( void ) const;
98 
101  void set_title( const std::string ttitle );
102 
105  const std::string get_key( void ) const;
106 
109  void set_key( const std::string kkey );
110 
113  int get_valacc( void ) const;
114 
117  void set_valacc( int vvalacc );
118 
121  int get_rhsacc( void ) const;
122 
125  void set_rhsacc( int rrhsacc );
126 
129  void get_matrix( CColMatrix &mmat ) const;
130 
133  void set_matrix( const CColMatrix &mmat );
134 
137  void get_rhs_vector( Vector &rrhs ) const;
138 
141  void set_rhs_vector( const Vector &rrhs );
142 
145  void get_solution_vector( Vector &ssol ) const;
146 
149  void set_solution_vector( const Vector &ssol );
150 };
151 
152 
153 inline HBIO::HBIO()
154 {
155  valacc = 8;
156  rhsacc = 8;
157 }
158 
159 
160 inline HBIO::~HBIO()
161 {
162 }
163 
164 
165 inline const std::string HBIO::get_title( void ) const
166 {
167  return( title );
168 }
169 
170 
171 inline void HBIO::set_title( const std::string ttitle )
172 {
173  title = ttitle;
174 }
175 
176 
177 inline const std::string HBIO::get_key( void ) const
178 {
179  return( key );
180 }
181 
182 
183 inline void HBIO::set_key( const std::string kkey )
184 {
185  key = kkey;
186 }
187 
188 
189 inline int HBIO::get_valacc( void ) const
190 {
191  return( valacc );
192 }
193 
194 
195 inline void HBIO::set_valacc( int vvalacc )
196 {
197  valacc = vvalacc;
198 }
199 
200 
201 inline int HBIO::get_rhsacc( void ) const
202 {
203  return( rhsacc );
204 }
205 
206 
207 inline void HBIO::set_rhsacc( int rrhsacc )
208 {
209  rhsacc = rrhsacc;
210 }
211 
212 
213 #endif
Compressed column sparse matrix algebra.
Compressed column sparse matrix class.
Definition: ccolmatrix.hpp:75
Harwell Boeing sparse matrix file format I/O class.
Definition: hbio.hpp:66
void write(const std::string filename) const
Write file filename.
Definition: hbio.cpp:90
void set_solution_vector(const Vector &ssol)
Set solution vector.
Definition: hbio.cpp:572
HBIO()
Constructor.
Definition: hbio.hpp:153
const std::string get_key(void) const
Get file key (max 8 chars)
Definition: hbio.hpp:177
int get_rhsacc(void) const
Get right hand side accuracy (in chars)
Definition: hbio.hpp:201
const std::string get_title(void) const
Get file title (max 72 chars)
Definition: hbio.hpp:165
void set_title(const std::string ttitle)
Set file title (max 72 chars)
Definition: hbio.hpp:171
void set_rhs_vector(const Vector &rrhs)
Set right hand side vector.
Definition: hbio.cpp:560
void set_key(const std::string kkey)
Set file key (max 8 chars)
Definition: hbio.hpp:183
void set_matrix(const CColMatrix &mmat)
Set matrix.
Definition: hbio.cpp:548
void read(const std::string filename)
Read file filename.
Definition: hbio.cpp:244
void get_matrix(CColMatrix &mmat) const
Get matrix.
Definition: hbio.cpp:542
int get_valacc(void) const
Get value accuracy (in chars)
Definition: hbio.hpp:189
void set_valacc(int vvalacc)
Set value accuracy (in chars)
Definition: hbio.hpp:195
~HBIO()
Destructor.
Definition: hbio.hpp:160
void get_solution_vector(Vector &ssol) const
Get solution vector.
Definition: hbio.cpp:566
void set_rhsacc(int rrhsacc)
Set right hand side accuracy (in chars)
Definition: hbio.hpp:207
void get_rhs_vector(Vector &rrhs) const
Get right hand side vector.
Definition: hbio.cpp:554
Dense math vector class.
Definition: mvector.hpp:71
Error classes and handling
N-dimensional vector.


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.