?? mjz.h
字號:
#ifndef M_JZ_
#define M_JZ_
//#include "ads.h"
//#include <afx.h>
//#ifdef _ads_h
//#define printf ads_printf
//#endif
#ifdef _ads_h
#define MY_ADS 1
#else
#define MY_ADS 0
#endif
#define JZMax 10000
#define DefCol 4
#define RetErr -99999.0
#include <math.h>
class Mjz;
class Mjz
{
public:
int size;
int row;
int col;
double *pHead;
Mjz(){row=0;col=0;size=0;pHead=new double;}
Mjz(int m,int n);
Mjz(int m);
//~Mjz(){row=0;col=0;size=0;if(pHead) delete pHead;}
~Mjz(){free();}
void free();
bool ReadTextFile(char* filename);//m n date
bool WriteTextFile(char* filename);//m n date
bool IsIn(int n){return (n>=0 && n<size) ? true:false;};
//bool IsIn(int n){return true;};
bool SetAt(int n,double data);
bool SetAt(int m,int n,double data);
bool GetAt(int n,double &data);
bool GetAt(int m,int n,double &data);
double GetAt(int m,int n);
double GetAt(int n);
void I();
void I(int m);
const Mjz& T();
const Mjz& N();
const Mjz& NZ();
const Mjz& operator~(){return NZ();}
//basic BH
int RowJH(int n,int m);
int ColJH(int n,int m);
double RowMul(int n,double x);
double ColMul(int n,double x);
double RowDiv(int n,double x){return RowMul(n,1/x);}
double ColDiv(int n,double x){return ColMul(n,1/x);}
void RowAdd(int o,int s,double x);///Row(o)=Row(o)+Row(s)*x;
void ColAdd(int o,int s,double x);///Col(o)=Col(o)+Col(s)*x;
void RowSub(int o,int s,double x){RowAdd(o,s,-x);}///Row(o)=Row(o)-Row(s)*x;
void ColSub(int o,int s,double x){ColAdd(o,s,-x);}///Col(o)=Col(o)-Col(s)*x;
const Mjz& RowIns(Mjz M,int k);
const Mjz& ColIns(Mjz M,int k);
//Add(Mjz M);
//Mul(Mjz M);
//Mul(void *s);
//Sub(Mjz M);
//Cu(double x);
double YZS(int n,int m);
double DSYZS(int n,int m){return Aij(n,m);}
double Mij(int i,int j){return YZS(i,j);}
double Aij(int i,int j){return YZS(i,j)*pow(-1,i+j);}
double HLS();
void HLS(FILE *f);
int R();
//void print();
void print(){print(stderr);}
void print(char *msg);
void print(FILE *f);
bool RowEq (int n,double x);
bool ColEq (int n,double x);
bool RowEq (int n,Mjz MjzSrc);
bool ColEq (int n,Mjz MjzSrc);
bool RowEq (Mjz MjzSrc)
{return (row==MjzSrc.row) ? true:false;};
bool ColEq (Mjz MjzSrc)
{return (col==MjzSrc.col) ? true:false;};
bool RowColEq (Mjz MjzSrc)
{return (row==MjzSrc.row && col==MjzSrc.col) ? true:false;};
bool operator== (Mjz MjzSrc);
bool operator== (double x)
{Mjz M(row,col);M=x;return (operator==(M));}
bool operator!= (Mjz MjzSrc);
bool operator!= (double x)
{Mjz M(row,col);M=x;return (operator!=(M));}
const Mjz& Set(double M[][DefCol]);
const Mjz& operator=(double x);
const Mjz& operator=(Mjz MjzSrc);
const Mjz& operator+(double x);
const Mjz& operator+=(double x){return *this=(operator+(x));}
const Mjz& operator+(Mjz MjzSrc);
const Mjz& operator+=(Mjz MjzSrc){return *this=(operator+(MjzSrc));}
//const Mjz& operator+=(Mjz MjzSrc);
const Mjz& operator-(double x);
const Mjz& operator-=(double x){return *this=(operator-(x));}
const Mjz& operator-(Mjz MjzSrc);
const Mjz& operator-=(Mjz MjzSrc){return *this=(operator-(MjzSrc));}
//const Mjz& operator();
//friend const Mjz& operator*(Mjz MjzSrc1,Mjz MjzSrc2);
//{Mjz tmp,tmp1; tmp=(Mjz) this;tmp1=MjzSrc1;this=MjzSrc1;tmp1*=MjzSrc2;return tmp1;}
const Mjz& operator*(Mjz MjzSrc);
const Mjz& operator*=(Mjz MjzSrc){return *this=(operator*(MjzSrc));}
const Mjz& operator*(double x);
const Mjz& operator*=(double x){return *this=(operator*(x));}
const Mjz& operator/(Mjz MjzSrc){return (operator*(MjzSrc.NZ()));}
const Mjz& operator/=(Mjz MjzSrc){return *this=(operator*(MjzSrc.NZ()));}
const Mjz& operator/(double x);
const Mjz& operator/=(double x){return *this=(operator/(x));}
};
int min(int a,int b);
int min(int a,int b)
{
return a>b ? b : a;
}
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -