1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
/*1:*/
#line 22 "./twod_matrix.hweb"
#ifndef TWOD_MATRIX_H
#define TWOD_MATRIX_H
#include "GeneralMatrix.h"
#include <cstdio>
#include <matio.h>
class TwoDMatrix;
/*2:*/
#line 42 "./twod_matrix.hweb"
class ConstTwoDMatrix:public ConstGeneralMatrix{
public:
ConstTwoDMatrix(int m,int n,const double*d)
:ConstGeneralMatrix(d,m,n){}
ConstTwoDMatrix(const TwoDMatrix&m);
ConstTwoDMatrix(const TwoDMatrix&m,int first_col,int num);
ConstTwoDMatrix(const ConstTwoDMatrix&m,int first_col,int num);
ConstTwoDMatrix(int first_row,int num,const TwoDMatrix&m);
ConstTwoDMatrix(int first_row,int num,const ConstTwoDMatrix&m);
ConstTwoDMatrix(const ConstTwoDMatrix&m,int first_row,int first_col,int rows,int cols)
:ConstGeneralMatrix(m,first_row,first_col,rows,cols){}
virtual~ConstTwoDMatrix(){}
int nrows()const
{return numRows();}
int ncols()const
{return numCols();}
void writeMat(mat_t*fd,const char*vname)const;
};
/*:2*/
#line 32 "./twod_matrix.hweb"
;
/*3:*/
#line 69 "./twod_matrix.hweb"
class TwoDMatrix:public GeneralMatrix{
public:
TwoDMatrix(int r,int c)
:GeneralMatrix(r,c){}
TwoDMatrix(int r,int c,double*d)
:GeneralMatrix(d,r,c){}
TwoDMatrix(int r,int c,const double*d)
:GeneralMatrix(d,r,c){}
TwoDMatrix(const GeneralMatrix&m)
:GeneralMatrix(m){}
TwoDMatrix(const GeneralMatrix&m,const char*dummy)
:GeneralMatrix(m,dummy){}
TwoDMatrix(const TwoDMatrix&m,int first_col,int num)
:GeneralMatrix(m,0,first_col,m.numRows(),num){}
TwoDMatrix(TwoDMatrix&m,int first_col,int num)
:GeneralMatrix(m,0,first_col,m.numRows(),num){}
TwoDMatrix(int first_row,int num,const TwoDMatrix&m)
:GeneralMatrix(m,first_row,0,num,m.ncols()){}
TwoDMatrix(int first_row,int num,TwoDMatrix&m)
:GeneralMatrix(m,first_row,0,num,m.ncols()){}
TwoDMatrix(TwoDMatrix&m,int first_row,int first_col,int rows,int cols)
:GeneralMatrix(m,first_row,first_col,rows,cols){}
TwoDMatrix(const TwoDMatrix&m,int first_row,int first_col,int rows,int cols)
:GeneralMatrix(m,first_row,first_col,rows,cols){}
TwoDMatrix(const ConstTwoDMatrix&a,const ConstTwoDMatrix&b)
:GeneralMatrix(a,b){}
virtual~TwoDMatrix(){}
int nrows()const
{return numRows();}
int ncols()const
{return numCols();}
/*4:*/
#line 111 "./twod_matrix.hweb"
void copyRow(int from,int to);
void copyRow(const ConstTwoDMatrix&m,int from,int to);
void copyRow(const TwoDMatrix&m,int from,int to)
{copyRow(ConstTwoDMatrix(m),from,to);}
void addRow(const ConstTwoDMatrix&m,int from,int to)
{addRow(1.0,m,from,to);}
void addRow(const TwoDMatrix&m,int from,int to)
{addRow(1.0,ConstTwoDMatrix(m),from,to);}
void addRow(double d,const ConstTwoDMatrix&m,int from,int to);
void addRow(double d,const TwoDMatrix&m,int from,int to)
{addRow(d,ConstTwoDMatrix(m),from,to);}
/*:4*/
#line 103 "./twod_matrix.hweb"
;
/*5:*/
#line 126 "./twod_matrix.hweb"
void copyColumn(int from,int to);
void copyColumn(const ConstTwoDMatrix&m,int from,int to);
void copyColumn(const TwoDMatrix&m,int from,int to)
{copyColumn(ConstTwoDMatrix(m),from,to);}
void addColumn(const ConstTwoDMatrix&m,int from,int to)
{addColumn(1.0,ConstTwoDMatrix(m),from,to);}
void addColumn(const TwoDMatrix&m,int from,int to)
{addColumn(1.0,ConstTwoDMatrix(m),from,to);}
void addColumn(double d,const ConstTwoDMatrix&m,int from,int to);
void addColumn(double d,const TwoDMatrix&m,int from,int to)
{addColumn(d,ConstTwoDMatrix(m),from,to);}
/*:5*/
#line 104 "./twod_matrix.hweb"
;
void save(const char*fname)const;
void writeMat(mat_t*fd,const char*vname)const
{ConstTwoDMatrix(*this).writeMat(fd,vname);}
};
/*:3*/
#line 33 "./twod_matrix.hweb"
;
#endif
/*:1*/
|