40 #ifndef _IODISTANCEMATRIX_H_ 41 #define _IODISTANCEMATRIX_H_ 43 #include <Bpp/Io/IoFormat.h> 58 public virtual IOFormat
65 virtual const std::string
getDataType()
const {
return "Distance matrix"; }
86 virtual DistanceMatrix*
read(
const std::string& path)
const throw (Exception) = 0;
94 virtual DistanceMatrix*
read(std::istream& in)
const throw (Exception) = 0;
117 virtual void write(
const DistanceMatrix& dist,
const std::string& path,
bool overwrite)
const throw (Exception) = 0;
125 virtual void write(
const DistanceMatrix& dist, std::ostream& out)
const throw (Exception) = 0;
139 virtual DistanceMatrix*
read(
const std::string& path)
const throw (Exception)
141 std::ifstream input(path.c_str(), std::ios::in);
142 DistanceMatrix* mat =
read(input);
146 virtual DistanceMatrix*
read(std::istream& in)
const throw (Exception) = 0;
160 virtual void write(
const DistanceMatrix& dist,
const std::string& path,
bool overwrite)
const throw (Exception)
163 std::ofstream output(path.c_str(), overwrite ? (std::ios::out) : (std::ios::out|std::ios::app));
167 virtual void write(
const DistanceMatrix& dist, std::ostream& out)
const throw (Exception) = 0;
172 #endif //_IODISTANCEMATRIX_H_
virtual DistanceMatrix * read(const std::string &path) const
Read a distance matrix from a file.
General interface for distance matrix I/O.
virtual ~AbstractODistanceMatrix()
virtual const std::string getDataType() const
virtual ~IODistanceMatrix()
AbstractODistanceMatrix()
General interface for distance matrix writers.
virtual ~AbstractIDistanceMatrix()
virtual void write(const DistanceMatrix &dist, const std::string &path, bool overwrite) const
Write a distance matrix to a file.
virtual DistanceMatrix * read(const std::string &path) const =0
Read a distance matrix from a file.
General interface for distance matrix readers.
virtual void write(const DistanceMatrix &dist, const std::string &path, bool overwrite) const =0
Write a distance matrix to a file.
Partial implementation of the ODistanceMatrix interface.
virtual ~IDistanceMatrix()
Partial implementation of the IDistanceMatrix interface.
AbstractIDistanceMatrix()
virtual ~ODistanceMatrix()