![]() |
|
#include <matrices.h>
Public Member Functions | |
DenseMatrix () | |
Empty constructor, simply assign the lengths N and M to 0. More... | |
DenseMatrix (const DenseMatrix &source_matrix) | |
Copy constructor: Deep copy! More... | |
DenseMatrix & | operator= (const DenseMatrix &source_matrix) |
Copy assignment. More... | |
T & | entry (const unsigned long &i, const unsigned long &j) |
T | get_entry (const unsigned long &i, const unsigned long &j) const |
DenseMatrix (const unsigned long &n) | |
Constructor to build a square n by n matrix. More... | |
DenseMatrix (const unsigned long &n, const unsigned long &m) | |
Constructor to build a matrix with n rows and m columns. More... | |
DenseMatrix (const unsigned long &n, const unsigned long &m, const T &initial_val) | |
virtual | ~DenseMatrix () |
Destructor, clean up the matrix data. More... | |
unsigned long | nrow () const |
Return the number of rows of the matrix. More... | |
unsigned long | ncol () const |
Return the number of columns of the matrix. More... | |
void | resize (const unsigned long &n) |
void | resize (const unsigned long &n, const unsigned long &m) |
void | resize (const unsigned long &n, const unsigned long &m, const T &initial_value) |
void | initialise (const T &val) |
Initialize all values in the matrix to val. More... | |
void | output (std::ostream &outfile) const |
Output function to print a matrix row-by-row to the stream outfile. More... | |
void | output (std::string filename) const |
Output function to print a matrix row-by-row to a file. Specify filename. More... | |
void | indexed_output (std::ostream &outfile) const |
Indexed output as i,j,a(i,j) More... | |
void | indexed_output (std::string filename) const |
void | output_bottom_right_zero_helper (std::ostream &outfile) const |
void | sparse_indexed_output_helper (std::ostream &outfile) const |
Sparse indexed output as i,j,a(i,j) for a(i,j)!=0 only. More... | |
![]() | |
Matrix () | |
(Empty) constructor More... | |
Matrix (const Matrix &matrix)=delete | |
Broken copy constructor. More... | |
void | operator= (const Matrix &)=delete |
Broken assignment operator. More... | |
virtual | ~Matrix () |
Virtual (empty) destructor. More... | |
T | operator() (const unsigned long &i, const unsigned long &j) const |
T & | operator() (const unsigned long &i, const unsigned long &j) |
void | sparse_indexed_output (std::ostream &outfile, const unsigned &precision=0, const bool &output_bottom_right_zero=false) const |
void | sparse_indexed_output (std::string filename, const unsigned &precision=0, const bool &output_bottom_right_zero=false) const |
Protected Attributes | |
T * | Matrixdata |
Internal representation of matrix as a pointer to data. More... | |
unsigned long | N |
Number of rows. More... | |
unsigned long | M |
Number of columns. More... | |
Additional Inherited Members | |
![]() | |
void | range_check (const unsigned long &i, const unsigned long &j) const |
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// Class for dense matrices, storing all the values of the matrix as a pointer to a pointer with assorted output functions inherited from Matrix<T>. The curious recursive template pattern is used here to pass the specific class to the base class so that round bracket access can be inlined.
|
inline |
Empty constructor, simply assign the lengths N and M to 0.
|
inline |
Copy constructor: Deep copy!
References i, j, oomph::DenseMatrix< T >::M, oomph::DenseMatrix< T >::Matrixdata, oomph::DenseMatrix< T >::N, oomph::DenseMatrix< T >::ncol(), and oomph::DenseMatrix< T >::nrow().
oomph::DenseMatrix< T >::DenseMatrix | ( | const unsigned long & | n | ) |
Constructor to build a square n by n matrix.
////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
oomph::DenseMatrix< T >::DenseMatrix | ( | const unsigned long & | n, |
const unsigned long & | m | ||
) |
Constructor to build a matrix with n rows and m columns.
oomph::DenseMatrix< T >::DenseMatrix | ( | const unsigned long & | n, |
const unsigned long & | m, | ||
const T & | initial_val | ||
) |
|
inlinevirtual |
Destructor, clean up the matrix data.
References oomph::DenseMatrix< T >::Matrixdata.
|
inline |
The access function that will be called by the read-write round-bracket operator.
References i, j, oomph::DenseMatrix< T >::Matrixdata, and oomph::Matrix< T, DenseMatrix< T > >::range_check().
Referenced by oomph::DenseDoubleMatrix::operator()().
|
inline |
The access function the will be called by the read-only (const version) round-bracket operator.
References i, j, oomph::DenseMatrix< T >::Matrixdata, and oomph::Matrix< T, DenseMatrix< T > >::range_check().
Referenced by oomph::DenseDoubleMatrix::operator()().
void oomph::DenseMatrix< T >::indexed_output | ( | std::ostream & | outfile | ) | const |
Indexed output as i,j,a(i,j)
Indexed output function to print a matrix to the stream outfile as i,j,a(i,j)
void oomph::DenseMatrix< T >::indexed_output | ( | std::string | filename | ) | const |
Indexed output function to print a matrix to a file as i,j,a(i,j). Specify filename.
References MergeRestartFiles::filename.
|
inline |
Initialize all values in the matrix to val.
References i, oomph::DenseMatrix< T >::M, oomph::DenseMatrix< T >::Matrixdata, oomph::DenseMatrix< T >::N, and calibrate::val.
Referenced by oomph::PeriodicOrbitTemporalMesh< ELEMENT >::assemble_residuals_and_jacobian(), oomph::FSIHermiteBeamElement::dposition_dlagrangian_at_local_coordinate(), oomph::FSIDiagHermiteShellElement::dposition_dlagrangian_at_local_coordinate(), oomph::GeneralisedElement::get_djacobian_and_dmass_matrix_dparameter(), oomph::GeneralisedElement::get_djacobian_dparameter(), ABCElement::get_inner_product_matrix(), oomph::PeriodicOrbitBaseElement::get_inner_product_matrix(), oomph::DGElement::get_inverse_mass_matrix_times_residuals(), oomph::Problem::get_jacobian(), oomph::ElasticallySupportedRingElement::get_jacobian(), ElasticFishBackElement::get_jacobian(), oomph::GeneralisedElement::get_jacobian(), oomph::GeneralisedElement::get_jacobian_and_mass_matrix(), oomph::GeneralisedElement::get_mass_matrix(), oomph::PseudoBucklingRingElement::get_residuals_generic(), oomph::SpaceTimeNavierStokesEquations< DIM >::get_vorticity(), oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::get_vorticity(), oomph::DGElement::pre_compute_mass_matrix(), oomph::SpaceTimeNavierStokesEquations< DIM >::strain_rate(), and oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::strain_rate().
|
inlinevirtual |
Return the number of columns of the matrix.
Implements oomph::Matrix< T, DenseMatrix< T > >.
References oomph::DenseMatrix< T >::M.
Referenced by oomph::ConstitutiveLaw::calculate_contravariant(), oomph::ConstitutiveLaw::calculate_d_contravariant_dG(), oomph::CRDoubleMatrixHelpers::concatenate(), oomph::CRDoubleMatrixHelpers::concatenate_without_communication(), create_matrices_to_cat(), oomph::DenseMatrix< T >::DenseMatrix(), oomph::FiniteElement::dJ_eulerian_dnodal_coordinates(), oomph::DenseDoubleMatrix::eigenvalues_by_jacobi(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::extrapolated_strain_rate(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::extrapolated_strain_rate(), fill_in_sub_matrices(), oomph::NavierStokesEquations< 2 >::full_output(), oomph::CRDoubleMatrixHelpers::gershgorin_eigenvalue_estimate(), oomph::BlockPreconditioner< MATRIX >::get_blocks(), oomph::LinearElasticityEquationsBase< DIM >::get_strain(), oomph::PoroelasticityEquations< DIM >::get_strain(), oomph::PVDEquationsBase< DIM >::get_strain(), oomph::LinearElasticityEquations< DIM >::get_stress(), oomph::PoroelasticityEquations< DIM >::get_stress(), oomph::CRDoubleMatrixHelpers::inf_norm(), main(), oomph::DenseDoubleMatrix::ncol(), oomph::DenseMatrix< T >::operator=(), oomph::LagrangeEnforcedFlowPreconditioner::setup(), oomph::LinearisedAxisymmetricNavierStokesEquations::strain_rate(), oomph::AxisymmetricNavierStokesEquations::strain_rate(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::strain_rate(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::strain_rate(), oomph::PolarNavierStokesEquations::strain_rate(), oomph::SpaceTimeNavierStokesEquations< DIM >::strain_rate(), oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::strain_rate(), oomph::LinearisedNavierStokesEquations::strain_rate(), and oomph::PolarNavierStokesEquations::strain_rate_by_r().
|
inlinevirtual |
Return the number of rows of the matrix.
Implements oomph::Matrix< T, DenseMatrix< T > >.
References oomph::DenseMatrix< T >::N.
Referenced by oomph::HelmholtzMGPreconditioner< DIM >::block_preconditioner_self_test(), oomph::IsotropicStrainEnergyFunctionConstitutiveLaw::calculate_second_piola_kirchhoff_stress(), oomph::CRDoubleMatrixHelpers::concatenate(), oomph::CRDoubleMatrixHelpers::concatenate_without_communication(), create_matrices_to_cat(), oomph::DenseMatrix< T >::DenseMatrix(), oomph::FiniteElement::dJ_eulerian_dnodal_coordinates(), oomph::DenseDoubleMatrix::eigenvalues_by_jacobi(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::extrapolated_strain_rate(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::extrapolated_strain_rate(), oomph::DisplacementBasedFoepplvonKarmanEquations::fill_in_contribution_to_jacobian_and_mass_matrix(), fill_in_sub_matrices(), oomph::NavierStokesEquations< 2 >::full_output(), oomph::CRDoubleMatrixHelpers::gershgorin_eigenvalue_estimate(), oomph::BlockPreconditioner< MATRIX >::get_blocks(), oomph::LinearElasticityEquationsBase< DIM >::get_strain(), oomph::PoroelasticityEquations< DIM >::get_strain(), oomph::PVDEquationsBase< DIM >::get_strain(), oomph::LinearElasticityEquations< DIM >::get_stress(), oomph::PoroelasticityEquations< DIM >::get_stress(), oomph::CRDoubleMatrixHelpers::inf_norm(), main(), oomph::DenseDoubleMatrix::nrow(), oomph::DenseMatrix< T >::operator=(), oomph::JacksHelloWorld::say_it_external(), oomph::JacksHelloWorld::say_it_inline(), oomph::SecondInvariantHelper::second_invariant(), oomph::LagrangeEnforcedFlowPreconditioner::setup(), oomph::LinearisedAxisymmetricNavierStokesEquations::strain_rate(), oomph::AxisymmetricNavierStokesEquations::strain_rate(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::strain_rate(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::strain_rate(), oomph::PolarNavierStokesEquations::strain_rate(), oomph::SpaceTimeNavierStokesEquations< DIM >::strain_rate(), oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::strain_rate(), oomph::LinearisedNavierStokesEquations::strain_rate(), and oomph::PolarNavierStokesEquations::strain_rate_by_r().
|
inline |
Copy assignment.
References i, j, m, oomph::DenseMatrix< T >::M, n, oomph::DenseMatrix< T >::N, oomph::DenseMatrix< T >::ncol(), oomph::DenseMatrix< T >::nrow(), and oomph::DenseMatrix< T >::resize().
|
virtual |
Output function to print a matrix row-by-row to the stream outfile.
Reimplemented from oomph::Matrix< T, DenseMatrix< T > >.
void oomph::DenseMatrix< T >::output | ( | std::string | filename | ) | const |
Output function to print a matrix row-by-row to a file. Specify filename.
Output function to print a matrix row-by-row to a file. Specify filename.
References MergeRestartFiles::filename, and oomph::output().
|
virtual |
Output the "bottom right" entry regardless of it being zero or not (this allows automatic detection of matrix size in e.g. matlab, python).
Implements oomph::Matrix< T, DenseMatrix< T > >.
References N.
|
inline |
Resize to a square nxn matrix; any values already present will be transfered
References n.
Referenced by SpineGravityTractionElement< ELEMENT >::assign_additional_local_eqn_numbers(), oomph::SpectralElement::assign_all_generic_local_eqn_numbers(), oomph::DenseDoubleMatrix::eigenvalues_by_jacobi(), oomph::PeriodicOrbitEquations::fill_in_generic_residual_contribution_orbit(), RefineableQAxisymCrouzeixRaviartBoussinesqElement::get_dbody_force_axi_nst_dexternal_element_data(), QAxisymCrouzeixRaviartElementWithExternalElement::get_dbody_force_axi_nst_dexternal_element_data(), RefineableQCrouzeixRaviartElementWithExternalElement< DIM >::get_dbody_force_nst_dexternal_element_data(), RefineableQCrouzeixRaviartElementWithTwoExternalElement< DIM >::get_dbody_force_nst_dexternal_element_data(), QCrouzeixRaviartElementWithTwoExternalElement< DIM >::get_dbody_force_nst_dexternal_element_data(), oomph::RefineableNavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >::get_dbody_force_nst_dexternal_element_data(), oomph::NavierStokesBoussinesqElement< NST_ELEMENT, AD_ELEMENT >::get_dbody_force_nst_dexternal_element_data(), oomph::Problem::get_fd_jacobian(), oomph::DGElement::get_inverse_mass_matrix_times_residuals(), oomph::Problem::get_jacobian(), oomph::IMRBase::IMRBase(), oomph::JacksHelloWorld::JacksHelloWorld(), oomph::KirchhoffLoveShellEquations::KirchhoffLoveShellEquations(), oomph::DenseDoubleMatrix::matrix_reduction(), oomph::ContinuationStorageScheme::modify_storage(), oomph::DenseDoubleMatrix::multiply(), oomph::DenseMatrix< T >::operator=(), oomph::DGElement::pre_compute_mass_matrix(), oomph::SelfStartingBDF2::SelfStartingBDF2(), oomph::BinaryTree::setup_static_data(), oomph::OcTree::setup_static_data(), oomph::QuadTree::setup_static_data(), and oomph::HSL_MA42::solve().
void oomph::DenseMatrix< T >::resize | ( | const unsigned long & | n, |
const unsigned long & | m | ||
) |
Resize to a non-square n x m matrix; any values already present will be transfered
Resize to a non-square n_row x m_col matrix, where any values already present will be transfered.
void oomph::DenseMatrix< T >::resize | ( | const unsigned long & | n, |
const unsigned long & | m, | ||
const T & | initial_value | ||
) |
Resize to a non-square n x m matrix and initialize the new values to initial_value.
Resize to a non-square n_row x m_col matrix and initialize the new entries to specified value.
|
virtual |
Sparse indexed output as i,j,a(i,j) for a(i,j)!=0 only.
Indexed output function to print a matrix to the stream outfile as i,j,a(i,j) for a(i,j)!=0 only.
Implements oomph::Matrix< T, DenseMatrix< T > >.
|
protected |
Number of columns.
Referenced by oomph::DenseMatrix< T >::DenseMatrix(), oomph::DenseMatrix< T >::initialise(), oomph::DenseMatrix< T >::ncol(), and oomph::DenseMatrix< T >::operator=().
|
protected |
Internal representation of matrix as a pointer to data.
Referenced by oomph::DenseMatrix< T >::DenseMatrix(), oomph::DenseMatrix< T >::entry(), oomph::DenseMatrix< T >::get_entry(), oomph::DenseMatrix< T >::initialise(), and oomph::DenseMatrix< T >::~DenseMatrix().
|
protected |
Number of rows.
Referenced by oomph::DenseMatrix< T >::DenseMatrix(), oomph::DenseMatrix< T >::initialise(), oomph::DenseMatrix< T >::nrow(), and oomph::DenseMatrix< T >::operator=().