LRAUV  revA
MtxIOStream.h
Go to the documentation of this file.
1 /*
2  * MtxIOStream.h
3  *
4  * reads in 2D matrix "mtx" file where first two int32 are the
5  * dimensions, and the rest is a column major matrix of
6  * single precision.
7  *
8  * Created on: Feb 15, 2012
9  * Author: godin
10  */
11 
12 #ifndef MTXIOSTREAM_H_
13 #define MTXIOSTREAM_H_
14 
15 #include "FileIOStream.h"
16 #include "data/Mtx.h"
17 #include "logger/Logger.h"
18 #include "logger/Syslog.h"
19 
21 {
22 public:
23  MtxIOStream( const char* filename, bool clobber );
24  virtual ~MtxIOStream();
25 
28  Mtx read( Logger& logger, int maxN = 0, Syslog::Severity severity = Syslog::FAULT )
29  {
30  return read( logger, 0, maxN, severity );
31  }
32 
35  Mtx read( Logger& logger, int minN = 0, int maxN = 0, Syslog::Severity severity = Syslog::FAULT );
36 
39  bool write( const Mtx& mtx, Logger& logger,
40  int minM = 0, int maxM = -1, int minN = 0, int maxN = -1,
41  Syslog::Severity severity = Syslog::FAULT );
42 
45  bool append( const Mtx& mtx, Logger& logger,
46  Syslog::Severity severity );
47 
48 };
49 
50 #endif /* MTXIOSTREAM_H_ */
Client-side interface for injecting log data into the log queue.
Definition: Logger.h:30
bool write(const Mtx &mtx, Logger &logger, int minM=0, int maxM=-1, int minN=0, int maxN=-1, Syslog::Severity severity=Syslog::FAULT)
Writes matrix or subset of matrix if min/max m & n are specified in case of failure, returns false.
Definition: MtxIOStream.cpp:68
MtxIOStream(const char *filename, bool clobber)
Definition: MtxIOStream.cpp:10
Contains the FileIOStream class declaration.
Wraps a c FILE* handle with an IOStream class.
Definition: FileIOStream.h:27
Mtx read(Logger &logger, int maxN=0, Syslog::Severity severity=Syslog::FAULT)
Reads matrix in case of failure, returns invalid Matrix.
Definition: MtxIOStream.h:28
Definition: Mtx.h:24
Contains the Syslog class definition.
bool append(const Mtx &mtx, Logger &logger, Syslog::Severity severity)
Writes matrix or subset of matrix if min/max m & n are specified in case of failure, returns false.
Definition: MtxIOStream.cpp:112
Contains the Logger class definition.
Definition: MtxIOStream.h:20
Severity
An attempt to define different levels of syslog severity.
Definition: Syslog.h:28
virtual ~MtxIOStream()
Definition: MtxIOStream.cpp:14
Definition: Syslog.h:34