21.06.2014 Views

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

22 # endif<br />

23 #include <br />

24 typedef double Real ;<br />

25 using namespace std ;<br />

26<br />

27 class ColumnMajorMatrix {<br />

28 private : / / Data Members:<br />

29 Real∗ data ;<br />

30 i n t n ,m;<br />

31 public :<br />

32 / / ——Class Managment———:<br />

33 / / Constructors<br />

34 ColumnMajorMatrix ( i n t _n , i n t _m) ;<br />

35 ColumnMajorMatrix ( const ColumnMajorMatrix &B) ;<br />

36 / / Destructor<br />

37 ~ColumnMajorMatrix ( ) ;<br />

38 / / Assignment operator<br />

39 ColumnMajorMatrix & operator =( const ColumnMajorMatrix &B) ;<br />

40 / / Access for ColumnMajorArrangement<br />

41 i n l i n e Real& operator ( ) ( i n t i , i n t j )<br />

42 { a ssert ( i m==B .m) ; / / only support square matrices<br />

6 ColumnMajorMatrix C( n ,m) ; / / important: must be zero: (done in constructor)<br />

7 for ( i n t j =0; j m==B .m) ; / / only support square matrices<br />

6 ColumnMajorMatrix C( n ,m) ; / / important: must be zero: (done in constructor)<br />

7 double alpha ( 1 . 0 ) , beta ( 1 . 0 ) ;<br />

8 for ( i n t j =0; j

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!