Skip to content

Commit f42593a

Browse files
committed
changed to unix LF
1 parent 5e0260f commit f42593a

File tree

15 files changed

+1542
-1542
lines changed

15 files changed

+1542
-1542
lines changed

Contents.m

Lines changed: 91 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
1-
% International Terrestrial Reference Frame (ITRF) Matlab Toolbox.
2-
% Version 1.2 (26 May 2025).
3-
%
4-
% Coordinate transformations between different ITRS and ETRS89 realizations.
5-
%
6-
% Synopsis:
7-
%
8-
% crdvelout=itrf2itrf(crdvelin,from,to,yearin,yearout)
9-
% crdout=itrf2itrf(crdin,from,to,yearin)
10-
%
11-
% Main function:
12-
%
13-
% itrf2itrf - Transform coordinates/velocities between various ITRF's and
14-
% ETRF2000, ETRF2014 and ETRF2020.
15-
% pmmvel - Get velocity from Plate Motion Model parameters.
16-
%
17-
% Other functions:
18-
%
19-
% itrftp - Get ITRF transformation parameters at a certain epoch
20-
% itrftables - Print table with transformation parameters between ITRF's.
21-
% itrf2etrf - Transform coordinates/velocities between ITRFyy and ETRFyy.
22-
%
23-
% Support functions:
24-
%
25-
% itrftpdef - Define ITRF transformation parameters
26-
% etrftpdef - Define ETRF transformation parameters
27-
% pmmpar - Define Plate Motion Model parameters.
28-
% dijkstra - Find shortest path in a graph using Dijkstra's algorithm
29-
% trafo3d - 3D similarity transformation with 7 or 14 parameters
30-
%
31-
% Demo/test functions:
32-
%
33-
% testitrf - Test itrf2itrf using actual ITRF coordinates
34-
% testpmm - Test Plate Model Motion (PMM) functions
35-
%
36-
% Notes:
37-
%
38-
% (1) itrf2itrf supports also transformations between ITRFyy and ETRF2000,
39-
% ETRF2014 and ETRF2020.
40-
% (2) itrf2etrf only supports transformations between ITRFyy and ETRFyy, or
41-
% vice versa, for the same year.
42-
%
43-
% crdvelout=itrf2etrf(crdvelin,from,to,yearin,yearout)
44-
% crdout=itrf2etrf(crdin,from,to,yearin)
45-
%
46-
% Mainly useful for legacy ETRF. For operations involving ETRF2000,
47-
% ETRF2014 and ETRF2020 you are better off with itrf2itrf.
48-
% To preform transformations between legacy ETRF split the transform
49-
% in two steps, e.g.
50-
%
51-
% ITRFxx -> ETRFxx itrf2etrf
52-
% ETRFxx -> ITRFxx itrf2etrf
53-
% ITRFxx -> ETRFyy :
54-
% ITRFxx -> ITRFyy itrf2itrf
55-
% ITRFyy -> ETRFyy itrf2etrf
56-
% ETRFxx -> ITRFyy :
57-
% ETRFxx -> ITRFxx itrf2etrf
58-
% ITRFxx -> ITRFyy itrf2itrf
59-
% ETRFxx -> ETRFyy :
60-
% ETRFxx -> ITRFxx itrf2etrf
61-
% ITRFxx -> ITRFyy itrf2itrf
62-
% ITRFyy -> ETRFyy itrf2etrf
63-
%
64-
% (3) Dijkstra's algorithm to find the shortest path is used to construct
65-
% all possible combinations of transformations.
66-
%
67-
% Examples:
68-
%
69-
% crdvelout=itrf2itrf( ...
70-
% [ 3899225.258 396731.815 5015078.341 -.0130 .0158 .0092 ; ...
71-
% 3812141.404 395731.729 4995987.219 .0004 -.0013 .0002 ],...
72-
% 'ITRF2005','ITRF2000',2008.4,2000.0)
73-
%
74-
% crdout=itrf2itrf( ...
75-
% [ 3899225.258 396731.815 5015078.341 ; ...
76-
% 3812141.404 395731.729 4995987.219 ],...
77-
% 'ITRF2005','ITRF2000',2008.4)
78-
%
79-
% crdvelout=itrf2itrf( ...
80-
% [3924687.552 301132.856 5001910.904 -.0150 .0164 .0070], ...
81-
% 'ITRF2000','ETRF2000',1997.0,1989.0)
82-
%
83-
% The Matlab functions in this package are free software: you can redistribute
84-
% it and/or modify it under the terms of the GNU General Public License as
85-
% published by the Free Software Foundation <http://www.gnu.org/licenses/>.
86-
%
87-
% This software is distributed in the hope that it will be useful, but WITHOUT
88-
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
89-
% FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
90-
%
91-
% (c) Hans van der Marel, Delft University of Technology, 2012-2025.
1+
% International Terrestrial Reference Frame (ITRF) Matlab Toolbox.
2+
% Version 1.2 (26 May 2025).
3+
%
4+
% Coordinate transformations between different ITRS and ETRS89 realizations.
5+
%
6+
% Synopsis:
7+
%
8+
% crdvelout=itrf2itrf(crdvelin,from,to,yearin,yearout)
9+
% crdout=itrf2itrf(crdin,from,to,yearin)
10+
%
11+
% Main function:
12+
%
13+
% itrf2itrf - Transform coordinates/velocities between various ITRF's and
14+
% ETRF2000, ETRF2014 and ETRF2020.
15+
% pmmvel - Get velocity from Plate Motion Model parameters.
16+
%
17+
% Other functions:
18+
%
19+
% itrftp - Get ITRF transformation parameters at a certain epoch
20+
% itrftables - Print table with transformation parameters between ITRF's.
21+
% itrf2etrf - Transform coordinates/velocities between ITRFyy and ETRFyy.
22+
%
23+
% Support functions:
24+
%
25+
% itrftpdef - Define ITRF transformation parameters
26+
% etrftpdef - Define ETRF transformation parameters
27+
% pmmpar - Define Plate Motion Model parameters.
28+
% dijkstra - Find shortest path in a graph using Dijkstra's algorithm
29+
% trafo3d - 3D similarity transformation with 7 or 14 parameters
30+
%
31+
% Demo/test functions:
32+
%
33+
% testitrf - Test itrf2itrf using actual ITRF coordinates
34+
% testpmm - Test Plate Model Motion (PMM) functions
35+
%
36+
% Notes:
37+
%
38+
% (1) itrf2itrf supports also transformations between ITRFyy and ETRF2000,
39+
% ETRF2014 and ETRF2020.
40+
% (2) itrf2etrf only supports transformations between ITRFyy and ETRFyy, or
41+
% vice versa, for the same year.
42+
%
43+
% crdvelout=itrf2etrf(crdvelin,from,to,yearin,yearout)
44+
% crdout=itrf2etrf(crdin,from,to,yearin)
45+
%
46+
% Mainly useful for legacy ETRF. For operations involving ETRF2000,
47+
% ETRF2014 and ETRF2020 you are better off with itrf2itrf.
48+
% To preform transformations between legacy ETRF split the transform
49+
% in two steps, e.g.
50+
%
51+
% ITRFxx -> ETRFxx itrf2etrf
52+
% ETRFxx -> ITRFxx itrf2etrf
53+
% ITRFxx -> ETRFyy :
54+
% ITRFxx -> ITRFyy itrf2itrf
55+
% ITRFyy -> ETRFyy itrf2etrf
56+
% ETRFxx -> ITRFyy :
57+
% ETRFxx -> ITRFxx itrf2etrf
58+
% ITRFxx -> ITRFyy itrf2itrf
59+
% ETRFxx -> ETRFyy :
60+
% ETRFxx -> ITRFxx itrf2etrf
61+
% ITRFxx -> ITRFyy itrf2itrf
62+
% ITRFyy -> ETRFyy itrf2etrf
63+
%
64+
% (3) Dijkstra's algorithm to find the shortest path is used to construct
65+
% all possible combinations of transformations.
66+
%
67+
% Examples:
68+
%
69+
% crdvelout=itrf2itrf( ...
70+
% [ 3899225.258 396731.815 5015078.341 -.0130 .0158 .0092 ; ...
71+
% 3812141.404 395731.729 4995987.219 .0004 -.0013 .0002 ],...
72+
% 'ITRF2005','ITRF2000',2008.4,2000.0)
73+
%
74+
% crdout=itrf2itrf( ...
75+
% [ 3899225.258 396731.815 5015078.341 ; ...
76+
% 3812141.404 395731.729 4995987.219 ],...
77+
% 'ITRF2005','ITRF2000',2008.4)
78+
%
79+
% crdvelout=itrf2itrf( ...
80+
% [3924687.552 301132.856 5001910.904 -.0150 .0164 .0070], ...
81+
% 'ITRF2000','ETRF2000',1997.0,1989.0)
82+
%
83+
% The Matlab functions in this package are free software: you can redistribute
84+
% it and/or modify it under the terms of the GNU General Public License as
85+
% published by the Free Software Foundation <http://www.gnu.org/licenses/>.
86+
%
87+
% This software is distributed in the hope that it will be useful, but WITHOUT
88+
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
89+
% FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
90+
%
91+
% (c) Hans van der Marel, Delft University of Technology, 2012-2025.

dijkstra.m

Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,83 @@
1-
function [sp,spedge]=dijkstra(A,s,d)
2-
%DIJKSTRA Find shortest path in a graph using Dijkstra's algorithm.
3-
% [SP,SPEDGE]=DIJKSTRA(A,S,D) finds shortest path SP from source S to
4-
% destination D using Dijkstra's algorithm. A is the sparse adjacency matrix
5-
% with on the off-diagonal elements a non-zero number for each edge. SP is the
6-
% shortest path from the source S to destination D, with SPEDGE for each edge
7-
% the corresponding value A. The distance is the length of SPEDGE, or the
8-
% length of SP minus one.
9-
%
10-
% (c) Hans van der Marel, Delft University of Technology.
11-
12-
% Created: 24 March 2012 by Hans van der Marel
13-
% Modified:
14-
15-
% Check the input arguments
16-
17-
n=size(A,1);
18-
if n ~= size(A,2)
19-
error('The adjacency matrix A must be square');
20-
end
21-
if ~issparse(A)
22-
A=sparse(A);
23-
end
24-
if s < 1 || s > n || d < 1 || d > n
25-
error('source or destination not within range of adjacency matrix');
26-
end
27-
28-
% Initializations of distance function and previous node in the path
29-
30-
dist(1:n)=Inf;
31-
previous(1:n)=NaN;
32-
dist(s) = 0;
33-
34-
% Main loop
35-
36-
% The following algorithm searches for the vertex u in the vertex set Q that
37-
% has the least dist[u] value. That vertex is removed from the set Q and
38-
% returned to the user. It then calculates the length between the two neighbor-
39-
% nodes u and v and if this path is shorter than the current shortest path
40-
% recorded for v in dist[v], that current path is replaced with the shorter
41-
% length. The previous array is populated with a pointer to the "next-hop" node
42-
% on the source graph to get the shortest route to the source.
43-
44-
Q=1:n;
45-
while ~isempty(Q)
46-
% Find vertex in Q with smallest distance in dist[]
47-
[distu idxu]=min(dist(Q));
48-
u=Q(idxu);
49-
% Break if all remaining vertices are inaccessible from source
50-
if isinf(distu)
51-
break;
52-
end
53-
% Break if target has been reached, if not, remove u from Q and continue
54-
if u == d
55-
break;
56-
else
57-
Q(idxu)=[];
58-
end
59-
% Find neighbors v of u, where v has not yet been removed from Q
60-
idxv=find(A(Q,u));
61-
v=Q(idxv);
62-
% Relax neighbours for who the distance is shorter
63-
relax=find( dist(v) > distu + 1);
64-
dist(v(relax))=distu + 1;
65-
previous(v(relax))=u;
66-
end
67-
% niter=n-length(Q)
68-
69-
% Compute the shortest path
70-
71-
sp = [d];
72-
spedge = [];
73-
while sp(1) ~= s
74-
if isnan(previous(sp(1)))
75-
error('There is no path to the destination from the source');
76-
end
77-
sp=[previous(sp(1)) sp];
78-
spedge=[ full(A(sp(1),sp(2))) spedge];
79-
end;
80-
% spdist=dist(d);
81-
82-
return
83-
1+
function [sp,spedge]=dijkstra(A,s,d)
2+
%DIJKSTRA Find shortest path in a graph using Dijkstra's algorithm.
3+
% [SP,SPEDGE]=DIJKSTRA(A,S,D) finds shortest path SP from source S to
4+
% destination D using Dijkstra's algorithm. A is the sparse adjacency matrix
5+
% with on the off-diagonal elements a non-zero number for each edge. SP is the
6+
% shortest path from the source S to destination D, with SPEDGE for each edge
7+
% the corresponding value A. The distance is the length of SPEDGE, or the
8+
% length of SP minus one.
9+
%
10+
% (c) Hans van der Marel, Delft University of Technology.
11+
12+
% Created: 24 March 2012 by Hans van der Marel
13+
% Modified:
14+
15+
% Check the input arguments
16+
17+
n=size(A,1);
18+
if n ~= size(A,2)
19+
error('The adjacency matrix A must be square');
20+
end
21+
if ~issparse(A)
22+
A=sparse(A);
23+
end
24+
if s < 1 || s > n || d < 1 || d > n
25+
error('source or destination not within range of adjacency matrix');
26+
end
27+
28+
% Initializations of distance function and previous node in the path
29+
30+
dist(1:n)=Inf;
31+
previous(1:n)=NaN;
32+
dist(s) = 0;
33+
34+
% Main loop
35+
36+
% The following algorithm searches for the vertex u in the vertex set Q that
37+
% has the least dist[u] value. That vertex is removed from the set Q and
38+
% returned to the user. It then calculates the length between the two neighbor-
39+
% nodes u and v and if this path is shorter than the current shortest path
40+
% recorded for v in dist[v], that current path is replaced with the shorter
41+
% length. The previous array is populated with a pointer to the "next-hop" node
42+
% on the source graph to get the shortest route to the source.
43+
44+
Q=1:n;
45+
while ~isempty(Q)
46+
% Find vertex in Q with smallest distance in dist[]
47+
[distu idxu]=min(dist(Q));
48+
u=Q(idxu);
49+
% Break if all remaining vertices are inaccessible from source
50+
if isinf(distu)
51+
break;
52+
end
53+
% Break if target has been reached, if not, remove u from Q and continue
54+
if u == d
55+
break;
56+
else
57+
Q(idxu)=[];
58+
end
59+
% Find neighbors v of u, where v has not yet been removed from Q
60+
idxv=find(A(Q,u));
61+
v=Q(idxv);
62+
% Relax neighbours for who the distance is shorter
63+
relax=find( dist(v) > distu + 1);
64+
dist(v(relax))=distu + 1;
65+
previous(v(relax))=u;
66+
end
67+
% niter=n-length(Q)
68+
69+
% Compute the shortest path
70+
71+
sp = [d];
72+
spedge = [];
73+
while sp(1) ~= s
74+
if isnan(previous(sp(1)))
75+
error('There is no path to the destination from the source');
76+
end
77+
sp=[previous(sp(1)) sp];
78+
spedge=[ full(A(sp(1),sp(2))) spedge];
79+
end;
80+
% spdist=dist(d);
81+
82+
return
83+

0 commit comments

Comments
 (0)