Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Matrix_easy_to_fill< T, ReadWriteT > Class Template Reference
Inheritance diagram for Matrix_easy_to_fill< T, ReadWriteT >:
Antares::Matrix< double, double >

Public Member Functions

 Matrix_easy_to_fill (uint height, uint width)
 
 Matrix_easy_to_fill (uint height, uint width, const vector< T > &vec)
 
bool openFile (Yuni::IO::File::Stream &, const AnyString &) const override
 Trying to open a file.
 
void saveBufferToFile (std::string &buffer, Yuni::IO::File::Stream &) const override
 
- Public Member Functions inherited from Antares::Matrix< double, double >
Matrix< double, double > & operator= (const Matrix< U > &rhs)
 
 Matrix ()
 Default Constructor.
 
 Matrix (const Matrix &rhs)
 Copy constructor.
 
 Matrix (Matrix &&rhs) noexcept
 Move constructor.
 
 Matrix (const Matrix< U, V > &rhs)
 Copy constructor.
 
 Matrix (uint w, uint h)
 Constructor with a initial size.
 
virtual ~Matrix ()
 Destructor.
 
void copyFrom (const Matrix< U, V > &rhs)
 Copy values from another matrix.
 
void copyFrom (const Matrix< U, V > *rhs)
 
void swap (MatrixType &rhs) noexcept
 Swap contents of Matrix with another.
 
virtual bool loadFromCSVFile (const AnyString &filename, uint minWidth, uint maxHeight, uint options=optNone, BufferType *buffer=NULL)
 Load entries from a CSV file.
 
bool loadFromCSVFile (const AnyString &filename, uint minWidth, uint maxHeight, BufferType *buffer)
 
bool loadFromCSVFile (const AnyString &filename)
 
bool saveToCSVFile (const AnyString &filename, uint precision=6, bool print_dimensions=false, bool saveEvenIfAllZero=false) const
 Write the content of a matrix into a single file.
 
bool saveToCSVFile (const AnyString &filename, uint precision, bool print_dimensions, PredicateT &predicate, bool saveEvenIfAllZero=false) const
 Write the content of a matrix into a single file.
 
virtual Yuni::IO::Error loadFromFileToBuffer (BufferType &buffer, const AnyString &filename) const
 
void saveToFileDescriptor (std::string &data, uint precision, bool print_dimensions, PredicateT &predicate) const
 
void resize (uint w, uint h, bool fixedSize=false)
 Resize the matrix.
 
void resizeWithoutDataLost (uint x, uint y, const double &defVal=double())
 Resize the matrix without destroying its content.
 
void clear ()
 Empty the matrix.
 
void reset ()
 Empty the matrix and mark it as modified.
 
void reset (uint w, uint h, bool fixedSize=false)
 Resize a matrix and reset its values.
 
ColumnTypecolumn (uint n)
 Get the Nth column.
 
const ColumnTypecolumn (uint n) const
 Get the Nth column (const)
 
void zero ()
 Make the matrix a zero matrix.
 
void fill (const double &v)
 Fill the matrix with a given value.
 
void fillUnit ()
 Make the matrix an unit matrix (identity matrix)
 
void multiplyAllEntriesBy (const U &c)
 Multiply all entries by a given value.
 
void multiplyColumnBy (uint x, const U &c)
 Multiply or divide a column by a given value.
 
void divideColumnBy (uint x, const U &c)
 
void averageTimeseries (bool roundValues=true)
 Compute the average of all timeseries (derated mode)
 
void roundAllEntries ()
 Round all entries.
 
double findLowerBound () const
 Find the lower bound.
 
double findUpperBound () const
 Find the upper bound.
 
void makeAllEntriesAbsolute ()
 Make all entries absolute.
 
void pasteToColumn (uint x, const U *data)
 Copy values into a given column in the matrix.
 
void fillColumn (uint x, const double &value)
 Set a entire column with a given value.
 
void columnToZero (uint x)
 Set to zero a entire column.
 
bool containsOnlyZero () const
 Get if the matrix only contains zero.
 
bool containsOnlyZero (PredicateT &predicate) const
 Get if the matrix only contains zero.
 
void circularShiftRows (uint count)
 Shift all rows.
 
void circularShiftRows (uint column, uint count)
 Shift all rows of a specific column.
 
bool forceReload (bool reload=false) const
 Force the Load of data (if not done) for the next save and mark the matrix as modified.
 
void unloadFromMemory () const
 Try to remove from memory all data from the matrix.
 
void markAsModified () const
 Mark the matrix as modified.
 
bool empty () const
 Get if the matrix is empty.
 
void print () const
 Print the matrix to std::cout (debug)
 
Matrixoperator= (const Matrix &rhs)
 Assignement.
 
Matrixoperator= (Matrix &&rhs) noexcept
 
Matrixoperator= (const Matrix< U > &rhs)
 Assignement.
 
ColumnTypeoperator[] (uint column)
 operator []
 
const ColumnTypeoperator[] (uint column) const
 
void saveToBuffer (std::string &data, uint precision=6) const
 
void saveToBuffer (std::string &data, uint precision, bool print_dimensions, PredicateT &predicate, bool saveEvenIfAllZero) const
 

Public Attributes

std::string data
 
- Public Attributes inherited from Antares::Matrix< double, double >
uint width
 Width of the matrix.
 
uint height
 Height of the matrix.
 
ColumnTypeentry
 All entries of the matrix (bidimensional array)
 
JIT::Informationsjit
 Just-in-time informations.
 

Additional Inherited Members

- Public Types inherited from Antares::Matrix< double, double >
enum  Options
 Options when loading a file.
 
enum  
 
using Type
 Type.
 
using TypePtr
 Pointer.
 
using MatrixType
 Matrix type.
 
using ReadWriteType
 Read / Write type.
 
using MatrixPtr
 Pointer.
 
using Vector
 Vector.
 
using ColumnType
 Column type.
 
using BufferType
 A buffer, for large amount of data.
 

Member Function Documentation

◆ openFile()

template<class T = double, class ReadWriteT = T>
bool Matrix_easy_to_fill< T, ReadWriteT >::openFile ( Yuni::IO::File::Stream & file,
const AnyString & filename ) const
inlineoverridevirtual

Trying to open a file.

Parameters
fileThe file object
filenameThe full path of the file we try to open
Returns
True if file could be opened, False otherwise (no enough permission or wrong path)

Reimplemented from Antares::Matrix< double, double >.

◆ saveBufferToFile()

template<class T = double, class ReadWriteT = T>
void Matrix_easy_to_fill< T, ReadWriteT >::saveBufferToFile ( std::string & buffer,
Yuni::IO::File::Stream &  ) const
inlineoverridevirtual

Reimplemented from Antares::Matrix< double, double >.


The documentation for this class was generated from the following file: