@echo =====optimized===== $<
@$(CXX) $(flags) -c $< -o $@
-all: solver.check mgbase.check mg.check
+all: full_matrix.check solver.check mgbase.check mg.check
exe: $(all:.check=.testcase) benchmark
run: $(all:.check=.output)
############################################################
clean:
- rm -f Make.depend *.o *.go *.output T
+ rm -f Makefile.depend *.o *.go *.output T
veryclean: clean
rm -f *.testcase *.inp *.gpl *.eps *.gnuplot
+############################################################
+# Automatic generation of dependencies
+############################################################
+
+all-cc-files = $(shell echo *.cc)
+
+Makefile.depend: $(all-cc-files)
+ @echo =====Dependencies== Makefile.depend
+ @$(CXX) $(flags) $^ -M > $@
+ @perl -pi~ -e 's/(^[^.]+)\.o:/\1.o \1.g.o:/;' $@
+
+include Makefile.depend
int
main ()
{
+ ofstream logfile("full_matrix.output");
+ logfile.setf(ios::fixed);
+ logfile.precision(3);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+
FullMatrix<double> A(5,5), C(5,5), D(5,5), H(5,5);
D(0,0) = 1.;
D(1,1) = 2.;
C(i+1,i) = sin(i+1);
C(i,i+1) = -sin(i+1);
+ C.print_formatted (logfile);
+ deallog << "l1-norm: " << C.l1_norm() << endl;
+ D = C;
+ D.gauss_jordan();
+ D.print_formatted (logfile);
+ deallog << "linfty-norm: " << D.linfty_norm() << endl
+ << "Frobenius-norm: " << D.norm2() << endl;
+
// Rotate original matrix
A.mmult(H,C);
C.Tmmult(A,H);
}
- A.print_formatted (cout);
+ A.print_formatted (logfile);
Vector<double> u(5);
GrowingVectorMemory<Vector<double> > mem;
SolverControl control (500,1.e-8, false, true);
- {
- u = 1.;
- EigenPower<Vector<double> >
- von_Mises(control, mem, 0.);
- double eigen = 0.;
- von_Mises.solve(eigen, A, u);
- deallog << "Eigenvalue: " << eigen << endl;
- }
- {
- u = 1.;
- EigenPower<Vector<double> >
- von_Mises(control, mem, -4.);
- double eigen = 0.;
- von_Mises.solve(eigen, A, u);
- deallog << "Eigenvalue: " << eigen << endl;
- }
+ if (true)
+ {
+ u = 1.;
+ EigenPower<Vector<double> >
+ von_Mises(control, mem, 0.);
+ double eigen = 0.;
+ von_Mises.solve(eigen, A, u);
+ deallog << "Eigenvalue: " << eigen << endl;
+ }
+ if (true)
+ {
+ u = 1.;
+ EigenPower<Vector<double> >
+ von_Mises(control, mem, -4.);
+ double eigen = 0.;
+ von_Mises.solve(eigen, A, u);
+ deallog << "Eigenvalue: " << eigen << endl;
+ }
+ H = A;
+ H.gauss_jordan();
+ H.print_formatted (logfile);
+ if (true)
+ {
+ u = 1.;
+ EigenPower<Vector<double> >
+ von_Mises(control, mem, 0.);
+ double eigen = 0.;
+ von_Mises.solve(eigen, H, u);
+ deallog << "Eigenvalue: " << eigen << endl;
+ }
+ if (true)
+ {
+ u = 1.;
+ EigenPower<Vector<double> >
+ von_Mises(control, mem, -4.);
+ double eigen = 0.;
+ von_Mises.solve(eigen, H, u);
+ deallog << "Eigenvalue: " << eigen << endl;
+ }
}
--- /dev/null
+
+5.403e-01 -8.415e-01
+8.415e-01 5.403e-01
+ 1.000e+00
+ 1.000e+00
+ 1.000e+00
+DEAL::l1-norm: 1.38
+5.403e-01 8.415e-01
+-8.415e-01 5.403e-01
+ 1.000e+00
+ 1.000e+00
+ 1.000e+00
+DEAL::linfty-norm: 1.38
+DEAL::Frobenius-norm: 5.00
+1.000e+00
+ -4.161e-01 -9.093e-01
+ 9.093e-01 -4.161e-01
+ 1.000e+00
+ 1.000e+00
+DEAL::l1-norm: 1.33
+1.000e+00
+ -4.161e-01 9.093e-01
+ -9.093e-01 -4.161e-01
+ 1.000e+00
+ 1.000e+00
+DEAL::linfty-norm: 1.33
+DEAL::Frobenius-norm: 5.00
+1.000e+00
+ 1.000e+00
+ -9.900e-01 -1.411e-01
+ 1.411e-01 -9.900e-01
+ 1.000e+00
+DEAL::l1-norm: 1.13
+1.000e+00
+ 1.000e+00
+ -9.900e-01 1.411e-01
+ -1.411e-01 -9.900e-01
+ 1.000e+00
+DEAL::linfty-norm: 1.13
+DEAL::Frobenius-norm: 5.00
+1.000e+00
+ 1.000e+00
+ 1.000e+00
+ -6.536e-01 7.568e-01
+ -7.568e-01 -6.536e-01
+DEAL::l1-norm: 1.41
+1.000e+00
+ 1.000e+00
+ 1.000e+00
+ -6.536e-01 -7.568e-01
+ 7.568e-01 -6.536e-01
+DEAL::linfty-norm: 1.41
+DEAL::Frobenius-norm: 5.00
+1.708e+00 -1.892e-01 4.093e-01 -3.813e-02 4.415e-02
+-1.892e-01 2.704e+00 6.399e-01 -5.962e-02 6.903e-02
+4.093e-01 6.399e-01 1.636e+00 2.203e-01 -2.551e-01
+-3.813e-02 -5.962e-02 2.203e-01 4.552e+00 5.184e-01
+4.415e-02 6.903e-02 -2.551e-01 5.184e-01 4.400e+00
+DEAL:Power method::Starting
+DEAL:Power method::Convergence step 21
+DEAL::Eigen
+DEAL:Power method::Starting
+DEAL:Power method::Convergence step 27
+DEAL::Eigen
+6.460e-01 9.460e-02 -2.046e-01 1.907e-02 -2.208e-02
+9.460e-02 4.235e-01 -1.951e-01 1.817e-02 -2.104e-02
+-2.046e-01 -1.951e-01 7.536e-01 -4.693e-02 5.433e-02
+1.907e-02 1.817e-02 -4.693e-02 2.257e-01 -2.980e-02
+-2.208e-02 -2.104e-02 5.433e-02 -2.980e-02 2.345e-01
+DEAL:Power method::Starting
+DEAL:Power method::Convergence step 17
+DEAL::Eigen
+DEAL:Power method::Starting
+DEAL:Power method::Convergence step 177
+DEAL::Eigen
+DEAL::GrowingVectorMemory:Overall allocated vectors: 8
+DEAL::GrowingVectorMemory:Maximum allocated vectors: 2