51int main(
int argc,
char* argv[])
68 int rows, cols, stride;
69 rows = My_Copy3.numRows();
70 cols = My_Copy3.numCols();
71 stride = My_Copy3.stride();
77 Empty_Matrix.shape( 3 );
78 My_Matrix.reshape( 3 );
82 My_Copy1.putScalar( 1.0 );
85 Empty_Matrix = My_Matrix;
92 My_Copy2 += My_Matrix;
97 if (Empty_Matrix == My_Matrix) {
98 std::cout<<
"The matrices are the same!" <<std::endl;
101 if (My_Copy2 != My_Matrix) {
102 std::cout<<
"The matrices are different!" <<std::endl;
106 double norm_one, norm_inf, norm_fro;
107 norm_one = My_Matrix.normOne();
108 norm_inf = My_Matrix.normInf();
109 norm_fro = My_Matrix.normFrobenius();
111 std::cout << std::endl <<
"|| My_Matrix ||_1 = " << norm_one << std::endl;
112 std::cout <<
"|| My_Matrix ||_Inf = " << norm_inf << std::endl;
113 std::cout <<
"|| My_Matrix ||_F = " << norm_fro << std::endl << std::endl;
125 My_Solver.setMatrix(
Teuchos::rcp( &My_Matrix2,
false ) );
127 info = My_Solver.factor();
129 std::cout <<
"Teuchos::SerialSpdDenseSolver::factor() returned : " << info << std::endl;
130 info = My_Solver.solve();
132 std::cout <<
"Teuchos::SerialSpdDenseSolver::solve() returned : " << info << std::endl;
138 A1(0,0) = 1.0, A1(1,1) = 2.0;
139 A2(0,0) = 1.0, A2(1,1) = 2.0, A2(2,2) = 3.00;
148 std::cout<< printMat(My_Matrix) << std::endl;
149 std::cout<< printMat(X) << std::endl;