source: inundation/wiki/least_squares_refactoring.txt @ 1899

Last change on this file since 1899 was 1899, checked in by duncan, 18 years ago

started documenting changes

File size: 4.0 KB
Line 
1Project Plan
2
3By Duncan Gray
4
5INTRODUCTION
6
7 Software, called least squares, has been developed to implement a
8penalised least-squares fit and associated interpolations. It is in
9least_squares.py.  It is currently not meeting user requirements with
10regards to speed and memory use.  Additional functionality is also needed.
11
12SCOPE
13This is looking at refactoring the Class Interpolation
14
15LIFE-CYCLE
16
17Use a staged delivery life-cycle (see rapid development), with the
18proviso that additional functionality to supporting objects, such as
19build_quadtree in quad.py can be worked on after requirements have
20been determined.  Also, the current least squares may be tinkered with
21to check the feasibility of concepts.
22
23At this stage how the design will be coded, eg built from the ground
24up, cut and past into a new file or changing the current code, has not
25been determined.
26
27
28
29______________________________________________________________________
30Least Squares Refactoring Software Requirements Specification
31
32By Duncan Gray
33
34
35INTRODUCTION
36
37This document specifies the requirements to implement when these
38modules are refactored.
39
40
41OVERALL DESCRIPTION
42
43Steven Roberts outlined the least squares algorithm used. 
44
45
46DEFINITIONS
47
48The least squares algorithm will not be changed. 
49
50
51REQUIREMENT SECTION
52
53Introduction
54
55Assume that all the requirements of the current least squares code will
56stay the same, unless stated.  Note implementation and names used are
57not regarded as requirements. 
58
59
60Requirements
61Warn the user when interpolating if points are outside the mesh.
62     Let the user set the default value that is returned for these points.
63
64Warn the user when fitting to mesh if the mesh is outside the points boundary.
65 (Note: by using alpha least squares can alway return a result in this
66 situation)
67
68X number of points will not cause a memory error.  (Problem is setting
69how many)
70Reduce the memory use of least_squares.  (This requirement isn't
71really testable)
72
73Reduce the time spent building matrix A. (ditto)
74
75 by using blocking and improving
76the architecture. and is implementation focused.)
77
78 
79 
80Requirement Notes
81How should we handle points outside of the mesh when interpolating?
82Currently the interpolated values are set to 0.0. 
83Other options are, set to a given value.
84Raise an error.
85Return/set a flag and set to a given value/0.0. (I like this one)
86
87
88How should interpolate_sww respond? 
89warning/error/exit/replace with given value.
90
91General Error Handling Guidelines
92
93Assume 4 ways of using the code
941) command line interface
952) API function - these have parameters of input  data file names,
96output file names, and carry out a process.
973) External methods - These are the calls that the api function uses
984) Internal methods.
99
100Ways 1 and 2 are used by general users, so they should not return
101something that looks like a code crash from bad input.
102Another option for way 2 is to raise an error, which the user handles. 
103Discus with  Ole
104
105
106___________________________________________________________________________
107Least Squares System Design Specification
108
109By Duncan Gray
110
111
112INTRODUCTION
113
114This specifies design choices for the least squares code.
115
116OVERALL ARCHITECTURAL CHANGES
117
118DESIGN IDEAS, to meet requirements
119*To save memory;
120When interpolating, don't build AtA, B and D. (This has been implemented)
121When fitting, don't build A.
122
123
124
125
126* To save memory
127Use blocking when interpolating a large number of points (how large?
128Can the program check the available memory and work out a good block
129size?)
130
131*To reduce the time spent building matrix A.
132Change the expansion algorithm, when determining what triangle a point
133is in. It should look in the cell of the point and then all adjacent
134cells. If it isn't there then ... we have problems.  My feeling is it
135has to be there.
136
137
138DESIGN IDEAS, refactoring
139
140Remove georeferencing from build_interpolation_matrix_A. Change the
141point co-ords to conform to the mesh co-ords early in the code.
142
143
Note: See TracBrowser for help on using the repository browser.