Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Conor Joseph Mccoid
UNIGE
Commits
1fc46b22
Commit
1fc46b22
authored
Nov 19, 2021
by
Conor McCoid
Browse files
Extrap: added Householder reflections to MPE algo
parent
6d027f20
Changes
4
Hide whitespace changes
Inline
Side-by-side
Research/Extrapolation methods/Code/ALGO_extrap_MPE_v2_20211029.m
View file @
1fc46b22
function
[
x_out
,
r_out
]
=
ALGO_extrap_MPE_v2_20211029
(
F
,
X
)
% MPE performs minimal polynomial extrapolation
using Arnoldi iteration
% MPE performs minimal polynomial extrapolation
[
d
,
k
]
=
size
(
F
);
x_out
=
zeros
(
d
,
k
);
x_out
(:,
1
)
=
X
(:,
1
);
...
...
Research/Extrapolation methods/Code/ALGO_extrap_MPE_v3_20211119.m
0 → 100644
View file @
1fc46b22
function
[
x_out
,
r_out
]
=
ALGO_extrap_MPE_v3_20211119
(
F
,
X
)
% MPE performs minimal polynomial extrapolation using Arnoldi iteration
% with Householder reflections
[
d
,
k
]
=
size
(
F
);
I
=
eye
(
d
);
Q
=
I
;
H
=
F
;
x_out
=
zeros
(
d
,
k
);
r_out
=
zeros
(
k
,
1
);
for
i
=
1
:
min
(
d
,
k
)
w
=
SUB_extrap_Householder_v1_20211119
(
H
(:,
i
),
i
);
Q
=
(
I
-
2
*
w
*
w
'
)
*
Q
;
H
=
(
I
-
2
*
w
*
w
'
)
*
H
;
u
=
zeros
(
i
,
1
);
u
(
end
)
=
1
;
u
=
H
(
1
:
i
,
1
:
i
)\
u
;
u
=
u
/
sum
(
u
);
x_out
(:,
i
)
=
X
(:,
1
:
i
)
*
u
;
r_out
(
i
)
=
norm
(
F
(:,
1
:
i
)
*
u
);
end
\ No newline at end of file
Research/Extrapolation methods/Code/EX_extrap_linearFPI_v1_20211022.m
View file @
1fc46b22
...
...
@@ -10,7 +10,8 @@ end
F
=
X
(:,
2
:
end
)
-
X
(:,
1
:
n
);
[
x_v1
,
r_v1
]
=
ALGO_extrap_MPE_v1_20211022
(
F
,
X
(:,
1
:
n
));
[
x_v2
,
r_v2
]
=
ALGO_extrap_MPE_v2_20211029
(
F
,
X
(:,
1
:
n
));
% [x_v2,r_v2] = ALGO_extrap_MPE_v2_20211029(F,X(:,1:n));
[
x_v2
,
r_v2
]
=
ALGO_extrap_MPE_v3_20211119
(
F
,
X
(:,
1
:
n
));
x
=
x_v1
(:,
end
);
Error_abs
=
norm
(
x
-
x_true
)
Error_rel
=
Error_abs
/
norm
(
x_true
)
...
...
Research/Extrapolation methods/Code/SUB_extrap_Householder_v1_20211119.m
0 → 100644
View file @
1fc46b22
function
w
=
SUB_extrap_Householder_v1_20211119
(
v
,
i
)
% HOUSEHOLDER calculates component of Householder reflection
w
=
v
(
i
:
end
);
w
(
1
)
=
w
(
1
)
+
sign
(
w
(
1
))
*
norm
(
w
);
w
=
w
/
norm
(
w
);
w
=
[
zeros
(
i
-
1
,
1
);
w
];
end
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment