MatematicaMatrix.h
```00001 #ifndef MATEMATICAMATRIX_H
00002 #define MATEMATICAMATRIX_H
00003 #include <stdio.h>
00004 #include <stdlib.h>
00005 #include <math.h>
00006 #include "MatematicaStruct.h"
00007 //---------------------Matrice--------------------
00010 class Matrice{
00011  private:
00013   void allocate(){
00014     delete[] data;
00015     data = new double [NSize*NSize];
00016   };
00018   int NSize;
00020   int NCol;
00022   int NRow;
00024   int NZed;
00026   int NDim;
00027  public:
00029   Matrice(int newNSize);// {Matrice(newNSize,newNSize);};
00030   //Matrice(int newNSize, int newactualsize);
00032   Matrice(int NRow, int NCol);
00034   Matrice(int NRow, int NCol,int NZed);
00037   Matrice(int ExtNRow, int ExtNCol, double *pointer);
00040   Matrice(SPLINE Wg);
00043   Matrice(SPLINE Wg,int Dim);
00047   Matrice(double *M,int Nr,int Nc);
00049   Matrice(double Roll,double Pitch,double Yaw,int NDim);
00051   Matrice(double *Axis,double Angle,int NDim);
00053   ~Matrice();
00055   bool Set(int row, int column,double Val);
00057   bool Add(int row,int col,double Val);
00059   int Size(){return NSize;};
00061   int pNCol(){return NCol;};
00063   int pNRow(){return NRow;};
00065   int pNZed(){return NZed;};
00067   void Apply(double *Known,double *UnKnown);
00069   int Solve(double *Known,double *UnKnown);
00071   int getNRow();
00073   void Shout(const char *s, ... );
00075   void comparetoidentity();
00077   void settoproduct(Matrice& left, Matrice& right);
00079   void copymatrix(Matrice&  source);
00081   void setNRow(int newNRow);
00083   void getvalue(int row, int column, double& returnvalue, bool& success);
00085   void Invert();
00087   void Mult(Matrice &A,Matrice &B);
00089   void Mult(Matrice &A);
00091   Vettore Mult(Matrice &A,Vettore &v);
00093   Vettore Mult(Vettore &v);
00095   void Mult(Vettore &v,Vettore &u);
00097   void RandomFill(double Max);
00099   void FillDiffOperator(SPLINE Wg,int NDim);
00101   void FillCanny();
00103   void FillGaussian(double Sigma,double CutOff);
00105   void FillGaussian5();
00107   void Transpose();
00109   void Normalize();
00111   void Clear();
00113   void Multiply(double Val);
00115   void CopyOn(Matrice *B);
00117   void Print();
00119   double Val(int row);
00121   double Val(int row,int col);
00123   double Val(int row,int col,int zed);
00125   double Det();
00127   Matrice operator+(Matrice&);
00128   //Matrice operator*(Matrice&) ;
00130   Matrice operator*(Matrice &A);
00131   //  Matrice &operator*(const Matrice&) const;
00133   Matrice operator*(const double&) const;
00135   Vettore operator*(const Vettore&) const;
00137   Matrice operator=(Matrice&);
00138   //  Matrice operator[][](int row,int col);
00140   Matrice operator^(Matrice&) const;
00142   double* data;
00144   void ConvoluteMatrix(double *Plot,int NGrid,int NDim,int IfMinImConv);
00146   void ConvoluteMatrix1(double *Plot,int NGrid);
00148   void ConvoluteMatrix1MinImConv(double *Plot,int NGrid);
00150   void ConvoluteMatrix2(double *Plot,int NGrid);
00152   void ConvoluteMatrix2MinImConv(double *Plot,int NGrid);
00154   void ConvoluteMatrix3(double *Plot,int NGrid);
00155 };
00156 #endif //MATEMATICA_H
```