source: src/LinearAlgebra/gslmatrix.hpp@ 3bc926

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 3bc926 was 3bc926, checked in by Frederik Heber <heber@…>, 14 years ago

Extended MatrixContent class.

  • MatrixContent formerly has been just a structure to contain the gsl_matrix due to forward declaration reasons.
  • now MatrixContent is a true wrapper to gsl_matrix, i.e. all functionality that is now specific to 3 dimensions has been shifted from Matrix over to MatrixContent.
  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 * gslmatrix.hpp
3 *
4 * Created on: Jan 8, 2010
5 * Author: heber
6 */
7
8#ifndef GSLMATRIX_HPP_
9#define GSLMATRIX_HPP_
10
11/*********************************************** includes ***********************************/
12
13// include config.h
14#ifdef HAVE_CONFIG_H
15#include <config.h>
16#endif
17
18#include <iosfwd>
19
20#include <gsl/gsl_matrix.h>
21
22
23/****************************************** forward declarations *****************************/
24
25class GSLMatrix;
26
27/********************************************** declarations *******************************/
28
29class GSLMatrix {
30 friend class LinearSystemOfEquations;
31 friend std::ostream &operator<<(std::ostream &ost,const GSLMatrix &mat);
32
33public:
34 GSLMatrix(size_t m, size_t n);
35 GSLMatrix(const GSLMatrix * const src);
36 GSLMatrix(size_t m, size_t n, gsl_matrix *&src);
37 ~GSLMatrix();
38
39 // Accessing
40 void SetFromDoubleArray(double * x);
41 double Get(size_t m, size_t n) const;
42 void Set(size_t m, size_t n, double x);
43 double *Pointer(size_t m, size_t n);
44 const double *const_Pointer(size_t m, size_t n) const;
45 size_t getRowCount() const;
46 size_t getColumnCount() const;
47
48 // Initializing
49 void SetAll(double x);
50 void SetZero();
51 void SetIdentity();
52
53 // Exchanging elements
54 bool SwapRows(size_t i, size_t j);
55 bool SwapColumns(size_t i, size_t j);
56 bool SwapRowColumn(size_t i, size_t j);
57
58 // Properties
59 bool Transpose();
60 bool IsNull() const;
61 bool IsPositive() const;
62 bool IsNegative() const;
63 bool IsNonNegative() const;
64 bool IsPositiveDefinite() const;
65 double Determinant() const;
66
67 // Operators
68 GSLMatrix &operator=(const GSLMatrix &src);
69 const GSLMatrix &operator+=(const GSLMatrix &rhs);
70 const GSLMatrix &operator-=(const GSLMatrix &rhs);
71 const GSLMatrix &operator*=(const GSLMatrix &rhs);
72 const GSLMatrix operator+(const GSLMatrix &rhs) const;
73 const GSLMatrix operator-(const GSLMatrix &rhs) const;
74 const GSLMatrix operator*(const GSLMatrix &rhs) const;
75
76private:
77 gsl_matrix *matrix;
78
79 size_t rows;
80 size_t columns;
81};
82
83std::ostream &operator<<(std::ostream &ost,const GSLMatrix &mat);
84
85#endif /* GSLMATRIX_HPP_ */
Note: See TracBrowser for help on using the repository browser.