00001 #ifndef _MATRIX_FRIEND_OPS_HH_
00002 #define _MATRIX_FRIEND_OPS_HH_
00003
00004
00005
00006
00007
00008
00009 friend ostream& operator << (ostream&, const Matrix&);
00010
00011
00012 friend Matrix operator + (const Matrix&);
00013 friend Matrix operator + (Matrix, Matrix);
00014 friend Matrix operator - (const Matrix&);
00015 friend Matrix operator - (Matrix, Matrix);
00016 friend MatMTimesMat operator * (const Matrix&, const Matrix&);
00017 friend Matrix operator / (const Matrix&, const Matrix&);
00018
00019
00020 friend Matrix operator == (const Matrix&, const Matrix&);
00021 friend Matrix operator != (const Matrix&, const Matrix&);
00022 friend Matrix operator > (const Matrix&, const Matrix&);
00023 friend Matrix operator < (const Matrix&, const Matrix&);
00024 friend Matrix operator >= (const Matrix&, const Matrix&);
00025 friend Matrix operator <= (const Matrix&, const Matrix&);
00026
00027
00028 friend Matrix uplus(const Matrix&);
00029 friend Matrix uminus(const Matrix&);
00030 friend Matrix mplus(const Matrix&, const Matrix&);
00031 friend Matrix mminus(const Matrix&, const Matrix&);
00032 friend MatTimesMat times(const Matrix&, const Matrix&);
00033 friend MatMTimesMat mtimes(const Matrix&, const Matrix&);
00034 friend Matrix ldivide(const Matrix&, const Matrix&);
00035 friend Matrix mldivide(Matrix, Matrix);
00036 friend Matrix mldivide(Matrix, Matrix, Matrix&);
00037 friend Matrix rdivide(const Matrix&, const Matrix&);
00038 friend Matrix mrdivide(Matrix, Matrix);
00039 friend MatCrossMat cross(const Matrix&, const Matrix&);
00040 friend double sumall(const Matrix&);
00041
00042
00043 friend Matrix subsref(const Matrix& a, const Matrix& ind,
00044 const Matrix& jnd = Matrix::DIN);
00045 friend Matrix subsasgn(const Matrix& a, const Matrix& ind, const Matrix& b);
00046 friend Matrix subsasgn(const Matrix& a, const Matrix& ind, const Matrix& jnd,
00047 const Matrix& b);
00048
00049
00050 friend Matrix transpose(const Matrix&);
00051 friend Matrix ctranspose(const Matrix&);
00052 friend Matrix horzcat(const vector<Matrix>& m_args);
00053 friend Matrix vertcat(const vector<Matrix>& m_args);
00054 friend Matrix horzcat(const vector<const Matrix*>& m_args);
00055 friend Matrix vertcat(const vector<const Matrix*>& m_args);
00056 friend Matrix horzcat(const Matrix& mat1,
00057 const Matrix& mat2=Matrix::DIN,
00058 const Matrix& mat3=Matrix::DIN,
00059 const Matrix& mat4=Matrix::DIN,
00060 const Matrix& mat5=Matrix::DIN,
00061 const Matrix& mat6=Matrix::DIN,
00062 const Matrix& mat7=Matrix::DIN,
00063 const Matrix& mat8=Matrix::DIN,
00064 const Matrix& mat9=Matrix::DIN,
00065 const Matrix& mat10=Matrix::DIN,
00066 const Matrix& mat11=Matrix::DIN,
00067 const Matrix& mat12=Matrix::DIN,
00068 const Matrix& mat13=Matrix::DIN,
00069 const Matrix& mat14=Matrix::DIN,
00070 const Matrix& mat15=Matrix::DIN,
00071 const Matrix& mat16=Matrix::DIN,
00072 const Matrix& mat17=Matrix::DIN,
00073 const Matrix& mat18=Matrix::DIN,
00074 const Matrix& mat19=Matrix::DIN,
00075 const Matrix& mat20=Matrix::DIN);
00076 friend Matrix mhorzcat(const Matrix& mat1,
00077 const Matrix& mat2=Matrix::DIN,
00078 const Matrix& mat3=Matrix::DIN,
00079 const Matrix& mat4=Matrix::DIN,
00080 const Matrix& mat5=Matrix::DIN,
00081 const Matrix& mat6=Matrix::DIN,
00082 const Matrix& mat7=Matrix::DIN,
00083 const Matrix& mat8=Matrix::DIN,
00084 const Matrix& mat9=Matrix::DIN,
00085 const Matrix& mat10=Matrix::DIN,
00086 const Matrix& mat11=Matrix::DIN,
00087 const Matrix& mat12=Matrix::DIN,
00088 const Matrix& mat13=Matrix::DIN,
00089 const Matrix& mat14=Matrix::DIN,
00090 const Matrix& mat15=Matrix::DIN,
00091 const Matrix& mat16=Matrix::DIN,
00092 const Matrix& mat17=Matrix::DIN,
00093 const Matrix& mat18=Matrix::DIN,
00094 const Matrix& mat19=Matrix::DIN,
00095 const Matrix& mat20=Matrix::DIN);
00096 friend Matrix vertcat(const Matrix& mat1,
00097 const Matrix& mat2=Matrix::DIN,
00098 const Matrix& mat3=Matrix::DIN,
00099 const Matrix& mat4=Matrix::DIN,
00100 const Matrix& mat5=Matrix::DIN,
00101 const Matrix& mat6=Matrix::DIN,
00102 const Matrix& mat7=Matrix::DIN,
00103 const Matrix& mat8=Matrix::DIN,
00104 const Matrix& mat9=Matrix::DIN,
00105 const Matrix& mat10=Matrix::DIN,
00106 const Matrix& mat11=Matrix::DIN,
00107 const Matrix& mat12=Matrix::DIN,
00108 const Matrix& mat13=Matrix::DIN,
00109 const Matrix& mat14=Matrix::DIN,
00110 const Matrix& mat15=Matrix::DIN,
00111 const Matrix& mat16=Matrix::DIN,
00112 const Matrix& mat17=Matrix::DIN,
00113 const Matrix& mat18=Matrix::DIN,
00114 const Matrix& mat19=Matrix::DIN,
00115 const Matrix& mat20=Matrix::DIN);
00116 friend Matrix mvertcat(const Matrix& mat1,
00117 const Matrix& mat2=Matrix::DIN,
00118 const Matrix& mat3=Matrix::DIN,
00119 const Matrix& mat4=Matrix::DIN,
00120 const Matrix& mat5=Matrix::DIN,
00121 const Matrix& mat6=Matrix::DIN,
00122 const Matrix& mat7=Matrix::DIN,
00123 const Matrix& mat8=Matrix::DIN,
00124 const Matrix& mat9=Matrix::DIN,
00125 const Matrix& mat10=Matrix::DIN,
00126 const Matrix& mat11=Matrix::DIN,
00127 const Matrix& mat12=Matrix::DIN,
00128 const Matrix& mat13=Matrix::DIN,
00129 const Matrix& mat14=Matrix::DIN,
00130 const Matrix& mat15=Matrix::DIN,
00131 const Matrix& mat16=Matrix::DIN,
00132 const Matrix& mat17=Matrix::DIN,
00133 const Matrix& mat18=Matrix::DIN,
00134 const Matrix& mat19=Matrix::DIN,
00135 const Matrix& mat20=Matrix::DIN);
00136
00137
00138 friend Matrix zeros(int n);
00139 friend Matrix zeros(int m, int n);
00140 friend Matrix zeros(const Matrix&);
00141 friend Matrix ones(int n);
00142 friend Matrix ones(int m, int n);
00143 friend Matrix ones(const Matrix&);
00144 friend Matrix eye(int n);
00145 friend Matrix eye(int m, int n);
00146 friend Matrix eye(const Matrix&);
00147 friend Matrix ramp(double start, double step, double stop);
00148 friend Matrix colon(double start, double step, double stop);
00149 friend Matrix colon();
00150 friend vector<Matrix> mask(const Matrix& a);
00151
00152
00153 friend int size(int& cols, const Matrix& a);
00154 friend int size(const Matrix& a, int dim);
00155 friend Matrix size(const Matrix&);
00156 friend int length(const Matrix&);
00157 friend bool isScalar(const Matrix&);
00158 friend bool any(const Matrix&);
00159 friend bool all(const Matrix&);
00160 friend Matrix find(const Matrix&);
00161
00162
00163 friend Matrix sin(const Matrix&);
00164 friend Matrix cos(const Matrix&);
00165 friend Matrix sincos(Matrix&, const Matrix&);
00166 friend Matrix power(const Matrix&, const Matrix&);
00167 friend Matrix mpower(const Matrix&, double);
00168 friend Matrix exp(const Matrix&);
00169 friend Matrix log(const Matrix&);
00170 friend Matrix sign(const Matrix&);
00171
00172
00173 friend Matrix mtimes_eval(const Matrix&, const Matrix&);
00174 friend Matrix times_eval(const Matrix&, const Matrix&);
00175 friend Matrix cross_eval(const Matrix&, const Matrix&);
00176 friend void matrix_dgemm(Matrix& C, Matrix A, Matrix B);
00177 friend Matrix& MatMTimesMatPlusEq(Matrix&, const Matrix&, const Matrix&);
00178 friend Matrix& MatTimesMatPlusEq(Matrix&, const Matrix&, const Matrix&);
00179 friend Matrix& MatCrossMatPlusEq(Matrix&, const Matrix&, const Matrix&);
00180
00181 #endif