⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cwmtx.txt

📁 用C++写的矩阵和矢量运算库
💻 TXT
📖 第 1 页 / 共 3 页
字号:
      Maps a square matrix into another square matrix.  The resulting mapping      is identical to the result of the mapping constructor.  Deallocates      existing rows and columns first if needed.   void StoreAdjoint(const CWTSquareMatrix<T> &);      Stores the adjoint of argument matrix in the destination matrix.  The      sizes of argument matrix and destination matrix should match.  This      function is provided for situations where using adj(qtn) causes too much      overhead because it has to construct a new result matrix each time it is      called.   void StoreInverse(const CWTSquareMatrix<T> &);      Stores the inverse of argument matrix in the destination matrix.  The      sizes of argument matrix and destination matrix should match.  This      function is provided for situations where using inv(qtn) causes too much      overhead because it has to construct a new result matrix each time it is      called.   void MakeAdjoint();      Makes the destination matrix its own adjoint.  The original values in      the destination matrix are lost.   void MakeInverse();      Makes the destination matrix its own inverse.  The original values in      the destination matrix are lost.   void MakeUnity();      Makes the destination matrix a unity matrix.  The original values in the      destination matrix are lost.Operators   CWTSquareMatrix<T> operator +(const CWTSquareMatrix<T> &) const;      Square matrix addition.   CWTSquareMatrix<T> operator -(const CWTSquareMatrix<T> &) const;      Square matrix subtraction.   CWTSquareMatrix<T> operator -();      Changes sign of square matrix, i.e. changes sign of all elements.   CWTSquareMatrix<T> operator *(T val) const;      Square matrix "scalar" multiplication smat*val.   CWTSquareMatrix<T> operator *(const CWTSquareMatrix<T> &) const;      Square matrix multiplication.   CWTSquareMatrix<T> operator /(T val) const;      Square matrix "scalar" division.   CWTSquareMatrix operator /(const CWTSquareMatrix &smat2) const;      Square matrix division.  Performs smat1*inv(smat2).   CWTSquareMatrix<T> & operator =(const CWTSquareMatrix<T> &smat);      Square matrix assignment.  For details see CWTMatrix assignment.  (Not      inherited)   CWTSquareMatrix<T> & operator +=(const CWTSquareMatrix<T> &smat);      Compound addition and assignment.   CWTSquareMatrix<T> & operator -=(const CWTSquareMatrix<T> &smat);      Compound subtraction and assignment.   CWTSquareMatrix<T> & operator *=(T val);      Compound "scalar" multiplication and assignment smat*val.   CWTSquareMatrix<T> & operator *=(const CWTSquareMatrix<T> &);      Compound matrix multiplication and assignment.   CWTSquareMatrix<T> & operator /=(T val);      Compound "scalar" division and assignment.   CWTSquareMatrix & operator /=(const CWTSquareMatrix &);      Compound matrix division and assignment.Related Global Functions and Operators   CWTSquareMatrix<T> operator *(T val, const CWTSquareMatrix<T> &smat)      Square matrix "scalar" multiplication val*smat.   CWTSquareMatrix<T> transpose(const CWTSquareMatrix<T> &);      Returns a matrix that is the transpose of the argument matrix.   CWTSquareMatrix<T> adj(const CWTSquareMatrix<T> &);      Return a matrix that is the (classical) adjoint of the argument matrix.   CWTSquareMatrix<T> inv(const CWTSquareMatrix<T> &);      Returns a matrix that is the inverse of the argument matrix   T det(const CWTSquareMatrix<T> &);      Returns a the determinant of the argument matrix.   T tr(const CWTSquareMatrix<T> &);      Returns the trace of the argument matrix.==============================================================================template <class T = double> CWTVectorHeader file "vector.h"Description   Template class CWTVector provides a mathematical vector.  It provides most   of the vector operations that are used extensively in engineering and   science.  A vector is considered a matrix with many rows and just one   column.  The default element type for this template is double.Base Classes   public CWTMatrix<T>Public Constructors   CWTVector();      Default constructor.  Constructs a vector in N_NOTALLOCATED status, i.e.      it has no elements.   CWTVector(unsigned crowInit);      Constructs a vector in N_ALLOCATED status, i.e. it has crowInit elements.   CWTVector(const CWTMatrix<T> &mat);      Constructs a vector from a copy of a matrix.  See matrix copy      constructor for more details.      NOTE: The argument matrix should have only one column.   CWTVector(const CWTVector<T> &vec);      Copy constructor.  See matrix copy constructor for more details.   CWTVector(      const CWTMatrix<T> &mat,      unsigned irowStart,      unsigned icolStart,      unsigned irowEnd);      Constructs a vector in N_MAPPED status.  The resulting vector is mapped      into the argument matrix using element mat[irowStart][icolStart] as      starting point and runs down from there to row irowEnd along column      icolStart.   CWTVector(const CWTVector<T> &vec, unsigned irowStart, unsigned irowEnd);      Constructs a vector in N_MAPPED status.  The resulting vector is mapped      into the argument vector using element vec[irowStart] as starting point      and runs down from there to row irowEnd.Public Destructors   ~CWTVector() {};      Destroys a vector object.Public Member Functions   void MapInto(const CWTMatrix<T> &, unsigned, unsigned, unsigned);      Maps a vector into a matrix.  The resulting mapping is identical to the      result of the corresponding mapping constructor.  Deallocates existing      column first.   void MapInto(const CWTVector<T> &vec, unsigned irowStart, unsigned irowEnd);      Maps a vector into another vector.  The resulting mapping is identical      to the result of the corresponding mapping constructor.  Deallocates      existing column first.   void Dimension(unsigned crowInit);      Allocates crowInit rows and one column.  Deallocates existing rows and      column first if neccesary.  If the vector has status N_MAPPED it does      *NOT* deallocate the rows and column of the matrix it is mapped into.      NOTE: Since CWTVector is derived from CWTMatrix,            CWTMatrix<T>::Dimension(rows, cols) can be called for a CWTVector            as well, possibly creating a vector having more than one column!            This should be avoided since it can result in runtime errors.   void StoreAtRow(unsigned irowStart, CWTVector<T> &vec);      Stores vector at the row in the destination vector vec indicated by      irowStart.   T Norm() const;      Return the norm (absolute length) of a vector.   CWTVector<T> Unit() const;      Returns a unit vector that has the same direction as the original vector      but its norm is scaled up/down to 1.   void MakeUnit();      Makes the destination matrix its own unit vector.  The original values      in the destination matrix are lost.Operators   T & operator [](unsigned irow);      Subscript operator.  Returns the element at index irow of the vector.   const T & operator [](unsigned irow) const;      Subscript operator.  Returns the non-modifyable element at index irow      of the non-modifyable vector.   CWTVector<T> operator +(const CWTVector<T> &) const;      Vector addition.   CWTVector<T> operator -(const CWTVector<T> &) const;      Vector subtraction.   CWTVector<T> operator -() const;      Changes sign of vector, i.e. of all elements of the vector   CWTVector<T> operator *(T val) const;      Vector "scalar" multiplication vec*val.   T operator *(const CWTVector<T> &) const;      Vector inner product.   CWTVector<T> operator /(T val) const;      Vector "scalar" division vec/val.   CWTVector<T> & operator =(const CWTVector<T> &);      Vector assignment.  For details see CWTMatrix assignment.  (Not      inherited.)   CWTVector<T> & operator +=(const CWTVector<T> &);      Compound vector addition and assignment.   CWTVector<T> & operator -=(const CWTVector<T> &);      Compound vector subtraction and assignment.   CWTVector<T> & operator *=(T val);      Compound vector "scalar" multiplication and assignment.   CWTVector<T> & operator /=(T val);      Compound vector "scalar" division and assignment.   T operator !();      Returns vector norm (absolute size).Related Global Functions and Operators   CWTVector<T> operator *(T val, const CWTVector<T> &);      Vector "scalar" multiplication val*vec.   CWTVector<T> operator *(const CWTMatrix<T> &, const CWTVector<T> &);      Vector matrix multiplication mat*vec must yield a new vector.   T norm(const CWTVector<T> &vec)      Returns vector norm (absolute size).==============================================================================template <class T = double> CWTSpaceVectorHeader file "svector.h"Description   Class CWTSpaceVector provides a 3-dimensional vector which provides the   operations used often in engineering and science problems.  The default   element type for this template is double.Base Classes   public CWTVector<T>Public Constructors   CWTSpaceVector();      Default constructor.  Constructs a vector with three elements in one      column.   CWTSpaceVector(const CWTMatrix<T> &);      Constructs a space vector from a copy af a matrix.      NOTE: The matrix should have only one column with three elements.   CWTSpaceVector(const CWTVector<T> &);      Constructs a space vector from a copy af an ordinary vector.      NOTE: The matrix should have exactly three elements.   CWTSpaceVector(const CWTSpaceVector<T> &);      Constructs a copy of a space vector.  See matrix copy constructor for      more details.   CWTSpaceVector(T, T, T);      Constructs a space vector directly from 3 elements.   CWTSpaceVector(CWTMatrix<T> &mat, unsigned irowStart, unsigned icolStart);      Constructs a space vector in N_MAPPED status.  The resulting space      vector is mapped into the argument matrix from element      mat[irowStart][icolStart] to element mat[irowStart + 2][icolStart].   CWTSpaceVector(CWTVector<T> &vec, unsigned irowStart);      Constructs a space vector in N_MAPPED status.  The resulting space      vector is mapped into the argument vector from element vec[irowStart] to      element vec[irowStart + 2].Public Destructors   ~CWTSpaceVector();      Destroys a space vector object.Public Member Functions   void Dimension();      Dimensions a space vector to have one column with three elements.      NOTE: Since CWTSpaceVector is derived from CWTVector and CWTVector in            turn is derived from CWTMatrix, CWTMatrix<T>::Dimension(rows,            cols) and CWTVector<T>::Dimension(rows) can be called for a            CWTSpaceVector as well, possibly creating a space vector having            more than one column and/or more than three elements! This should            be avoided since it can lead to run time errors.   void MapInto(const CWTMatrix<T> &mat,                unsigned irowStart,		unsigned icolStart);      Maps a space vector into a matrix.  The resulting mapping is identical      to the corresponding mapping constructor   void MapInto(const CWTVector<T> &vec, unsigned irowStart);      Maps a space vector into an ordinary vector.  The resulting mapping is      identical to the corresponding mapping constructor   void StoreOuterProduct(const CWTSpaceVector<T> &,                          const CWTSpaceVector<T> &);      Stores the outer product of the two argument space vectors in the      destination space vector.  This function is provided for situations      where using operator%(qtn) causes too much overhead because it has to      construct a new result matrix each time it is called.   CWTSpaceVector<T> Unit() const;      Returns a unit vector that has the same direction as the original space      vector but its norm is scaled up/down to 1.Operators   CWTSpaceVector<T> operator +(const CWTSpaceVector<T> &) const;      Space vector addition.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -