Mercurial > hg > smallbox
comparison examples/SMALL_solver_test.m @ 4:2d7d8736ce6c
(none)
author | idamnjanovic |
---|---|
date | Mon, 22 Mar 2010 10:42:47 +0000 |
parents | 7750624e0c73 |
children | ce03373b3761 |
comparison
equal
deleted
inserted
replaced
3:01cad25206d6 | 4:2d7d8736ce6c |
---|---|
49 fprintf('\n\nExample test of SMALL solver against their counterparts on Sparco problems.\n\n'); | 49 fprintf('\n\nExample test of SMALL solver against their counterparts on Sparco problems.\n\n'); |
50 | 50 |
51 %% | 51 %% |
52 % Generate SPARCO problem | 52 % Generate SPARCO problem |
53 | 53 |
54 global SMALL | 54 |
55 SMALL.Problem = generateProblem(6, 'P', 6, 'm', 270,'n',1024, 'show'); | 55 SMALL.Problem = generateProblem(6, 'P', 6, 'm', 270,'n',1024, 'show'); |
56 %% | 56 %% |
57 | 57 i=1; |
58 %% | 58 %% |
59 % SMALL Conjugate Gradient test | 59 % SMALL Conjugate Gradient test |
60 | 60 SMALL.solver(i)=SMALL_init_solver; |
61 SMALL.solver.toolbox='SMALL'; | 61 SMALL.solver(i).toolbox='SMALL'; |
62 SMALL.solver.name='SMALL_cgp'; | 62 SMALL.solver(i).name='SMALL_cgp'; |
63 | 63 |
64 % In the following string all parameters except matrix, measurement vector | 64 % In the following string all parameters except matrix, measurement vector |
65 % and size of solution need to be specified. If you are not sure which | 65 % and size of solution need to be specified. If you are not sure which |
66 % parameters are needed for particular solver type "help <Solver name>" in | 66 % parameters are needed for particular solver type "help <Solver name>" in |
67 % MATLAB command line | 67 % MATLAB command line |
68 | 68 |
69 SMALL.solver.param='200, 1e-14'; | 69 SMALL.solver(i).param='200, 1e-14'; |
70 | 70 |
71 SMALL=SMALL_solve(SMALL); | 71 SMALL.solver(i)=SMALL_solve(SMALL.Problem,SMALL.solver(i)); |
72 | 72 |
73 | 73 |
74 SMALL_plot(SMALL); | 74 i=i+1; |
75 | |
76 %% | 75 %% |
77 % SMALL OMP with Cholesky update test | 76 % SMALL OMP with Cholesky update test |
78 | 77 SMALL.solver(i)=SMALL_init_solver; |
79 SMALL.solver.toolbox='SMALL'; | 78 SMALL.solver(i).toolbox='SMALL'; |
80 SMALL.solver.name='SMALL_chol'; | 79 SMALL.solver(i).name='SMALL_chol'; |
81 | 80 |
82 % In the following string all parameters except matrix, measurement vector | 81 % In the following string all parameters except matrix, measurement vector |
83 % and size of solution need to be specified. If you are not sure which | 82 % and size of solution need to be specified. If you are not sure which |
84 % parameters are needed for particular solver type "help <Solver name>" in | 83 % parameters are needed for particular solver type "help <Solver name>" in |
85 % MATLAB command line | 84 % MATLAB command line |
86 | 85 |
87 SMALL.solver.param='200, 1e-14'; | 86 SMALL.solver(i).param='200, 1e-14'; |
88 | 87 |
89 SMALL=SMALL_solve(SMALL); | 88 SMALL.solver(i)=SMALL_solve(SMALL.Problem, SMALL.solver(i)); |
90 | 89 |
91 SMALL_plot(SMALL); | 90 i=i+1; |
92 %% | 91 %% |
93 % SolveOMP from SparseLab test | 92 % SolveOMP from SparseLab test |
94 | 93 |
95 SMALL.solver.toolbox='SparseLab'; | 94 SMALL.solver(i)=SMALL_init_solver; |
96 SMALL.solver.name='SolveOMP'; | 95 SMALL.solver(i).toolbox='SparseLab'; |
96 SMALL.solver(i).name='SolveOMP'; | |
97 | 97 |
98 % In the following string all parameters except matrix, measurement vector | 98 % In the following string all parameters except matrix, measurement vector |
99 % and size of solution need to be specified. If you are not sure which | 99 % and size of solution need to be specified. If you are not sure which |
100 % parameters are needed for particular solver type "help <Solver name>" in | 100 % parameters are needed for particular solver type "help <Solver name>" in |
101 % MATLAB command line | 101 % MATLAB command line |
102 | 102 |
103 SMALL.solver.param='200, 0, 0, 0, 1e-14'; | 103 SMALL.solver(i).param='200, 0, 0, 0, 1e-14'; |
104 | 104 |
105 SMALL=SMALL_solve(SMALL); | 105 SMALL.solver(i)=SMALL_solve(SMALL.Problem, SMALL.solver(i)); |
106 | 106 |
107 SMALL_plot(SMALL); | 107 i=i+1; |
108 | 108 |
109 %% | 109 %% |
110 % greed_pcgp from Sparsify test | 110 % greed_pcgp from Sparsify test |
111 | 111 |
112 SMALL.solver.toolbox='Sparsify'; | 112 SMALL.solver(i)=SMALL_init_solver; |
113 SMALL.solver.name='greed_pcgp'; | 113 SMALL.solver(i).toolbox='Sparsify'; |
114 SMALL.solver(i).name='greed_pcgp'; | |
114 | 115 |
115 % In the following string all parameters except matrix, measurement vector | 116 % In the following string all parameters except matrix, measurement vector |
116 % and size of solution need to be specified. If you are not sure which | 117 % and size of solution need to be specified. If you are not sure which |
117 % parameters are needed for particular solver type "help <Solver name>" in | 118 % parameters are needed for particular solver type "help <Solver name>" in |
118 % MATLAB command line | 119 % MATLAB command line |
119 | 120 |
120 SMALL.solver.param='''stopCrit'', ''M'', ''stopTol'', 200'; | 121 SMALL.solver(i).param='''stopCrit'', ''M'', ''stopTol'', 200'; |
121 | 122 |
122 SMALL=SMALL_solve(SMALL); | 123 SMALL.solver(i)=SMALL_solve(SMALL.Problem, SMALL.solver(i)); |
124 | |
125 %% | |
123 | 126 |
124 SMALL_plot(SMALL); | 127 SMALL_plot(SMALL); |
125 | 128 |
126 %% | 129 |
127 | 130 |
128 | 131 |
129 end % function SMALL_solver_test | 132 end % function SMALL_solver_test |