Template Numerical Library version\ main:6c80161
|
Basic class for majority of TNL objects like matrices, meshes, grids, solvers, etc.. More...
#include <TNL/Object.h>
Public Member Functions | |
virtual | ~Object ()=default |
Destructor. | |
virtual std::string | getSerializationTypeVirtual () const |
void | load (const String &fileName) |
Method for restoring the object from a file. | |
virtual void | load (File &file) |
Method for restoring the object from a file. | |
void | save (const String &fileName) const |
Method for saving the object to a file as a binary data. | |
virtual void | save (File &file) const |
Method for saving the object to a file as a binary data. | |
Static Public Member Functions | |
static std::string | getSerializationType () |
Static serialization type getter. | |
Basic class for majority of TNL objects like matrices, meshes, grids, solvers, etc..
Objects like numerical meshes, matrices large vectors etc. are inherited by this class.
Since the virtual destructor is not defined as __cuda_callable__, objects inherited from Object should not be created in CUDA kernels.
In addition to methods of this class, see the following related functions:
|
virtualdefault |
Destructor.
Since it is not defined as __cuda_callable__, objects inherited from Object should not be created in CUDA kernels.
|
inlinestaticnodiscard |
Static serialization type getter.
Objects in TNL are saved as in a device independent manner. This method is supposed to return the object type but with the device type replaced by Devices::Host. For example Array< double, Devices::Cuda >
is saved as Array< double, Devices::Host >
.
|
inline |
Method for restoring the object from a file.
Throws Exceptions::FileDeserializationError if the object cannot be loaded.
fileName | String defining the name of a file. |
|
inlinevirtual |
Method for restoring the object from a file.
Throws Exceptions::FileDeserializationError if the object cannot be loaded.
file | Name of file object. |
Reimplemented in TNL::Matrices::DenseMatrix< Real, Device, Index, Organization, RealAllocator >, TNL::Matrices::DenseMatrix< GlobalIndexType, TNL::Devices::Host, int >, TNL::Matrices::DenseMatrix< RealType, Devices::Sequential, IndexType >, TNL::Matrices::MultidiagonalMatrix< Real, Device, Index, Organization, RealAllocator, IndexAllocator >, TNL::Matrices::SparseMatrix< Real, Device, Index, MatrixType_, Segments, ComputeReal, RealAllocator, IndexAllocator >, TNL::Matrices::SparseMatrix< RealType, DeviceType, IndexType, Matrices::GeneralMatrix, Algorithms::Segments::CSR >, TNL::Matrices::SparseMatrix< TNL::Real, TNL::Devices::Host, IndexType, TNL::Matrices::GeneralMatrix, TNL::Algorithms::Segments::CSR >, and TNL::Matrices::TridiagonalMatrix< Real, Device, Index, Organization, RealAllocator >.
|
inline |
Method for saving the object to a file as a binary data.
Throws Exceptions::FileSerializationError if the object cannot be saved.
fileName | String defining the name of a file. |
|
inlinevirtual |
Method for saving the object to a file as a binary data.
Throws Exceptions::FileSerializationError if the object cannot be saved.
file | Name of file object. |
Reimplemented in TNL::Matrices::DenseMatrix< Real, Device, Index, Organization, RealAllocator >, TNL::Matrices::DenseMatrix< GlobalIndexType, TNL::Devices::Host, int >, TNL::Matrices::DenseMatrix< RealType, Devices::Sequential, IndexType >, TNL::Matrices::MultidiagonalMatrix< Real, Device, Index, Organization, RealAllocator, IndexAllocator >, TNL::Matrices::SparseMatrix< Real, Device, Index, MatrixType_, Segments, ComputeReal, RealAllocator, IndexAllocator >, TNL::Matrices::SparseMatrix< RealType, DeviceType, IndexType, Matrices::GeneralMatrix, Algorithms::Segments::CSR >, TNL::Matrices::SparseMatrix< TNL::Real, TNL::Devices::Host, IndexType, TNL::Matrices::GeneralMatrix, TNL::Algorithms::Segments::CSR >, and TNL::Matrices::TridiagonalMatrix< Real, Device, Index, Organization, RealAllocator >.