31 LinSolver(
const LinSolver&);
36 bool ready()
const {
return ready_; }
37 int size()
const {
return n_; }
39 void apply(
const T* b,T* x)
const;
64 ? tr(
"Generating linear model")
68 {
return tr(
"Nr points processed"); }
85 :
Executor(
"Generating linear model")
87 , totalnr_(A.info().getSize(0))
91 , croutsidx_(croutsidx)
99 for (
int idx=0; idx<
totalnr_; idx++ )
102 for (
int idy=0; idy<
totalnr_; idy++ )
115 vv_[idx] = 1.0f/maxval;
131 for (
int idx=0; idx<
curidx_; idx++ )
134 for (
int idz=0; idz<idx; idz++ )
141 for (
int idx=curidx_; idx<
totalnr_; idx++ )
144 for (
int idz=0; idz<
curidx_; idz++ )
151 T dum =
vv_[idx]*fabs(sum);
160 if ( curidx_ !=
imax_ )
162 for (
int idz=0; idz<
totalnr_; idz++ )
177 if ( curidx_ != totalnr_-1 )
180 for (
int idx=curidx_+1; idx<
totalnr_; idx++ )
190 template <
class T>
inline 194 , n_(A.info().getSize(0))
201 template <
class T>
inline 210 template <
class T>
inline 221 for (
int idx=0; idx<s.
n_; idx++ )
227 template <
class T>
inline 234 template <
class T>
inline 239 pErrMsg(
"Cannot apply. Did you forget to call LinSolver::init()?");
243 for (
int idx=0; idx<
n_; idx++ )
248 for (
int i=0; i<
n_; i++ )
256 for (
int j=ii; j<=i-1; j++ )
267 for (
int i=n_-1; i>=0; i-- )
270 for (
int j=i+1; j<
n_; j++ )
int * croutsidx_
Definition: linsolv.h:76
bool parity_
Definition: linsolv.h:45
const Array2DInfo & info() const
Definition: arrayndimpl.h:124
int imax_
Definition: linsolv.h:75
Array2DImpl< T > & croutsmatrix_
Definition: linsolv.h:78
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
static int ErrorOccurred()
Definition: task.h:141
bool init(TaskRunner *=0)
Definition: linsolv.h:202
LinSolverTask(Array2DImpl< T > &, int *)
Definition: linsolv.h:84
#define mIsZero(x, eps)
Definition: commondefs.h:53
~LinSolverTask()
Definition: linsolv.h:56
int * croutsidx_
Definition: linsolv.h:43
#define od_int64
Definition: plftypes.h:36
Implementation of Array2D.
Definition: arrayndimpl.h:102
int n_
Definition: linsolv.h:44
#define TINY
Definition: linsolv.h:120
Definition: uistring.h:89
static int MoreToDo()
Definition: task.h:143
static bool execute(TaskRunner *tr, Task &)
Taskrunner may be zero.
virtual int getSize(int dim) const =0
int curidx_
Definition: linsolv.h:73
static int Finished()
Definition: task.h:142
Set of (small) copyable elements.
Definition: commontypes.h:30
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
Class that can execute a task.
Definition: task.h:169
LinSolver - Solves linear systems of equations on the form A*x=B. A is a matrix of the size N*N...
Definition: gridder2d.h:24
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
od_int64 nrDone() const
Definition: linsolv.h:70
od_int64 totalNr() const
Definition: linsolv.h:71
#define mDefEps
Definition: commondefs.h:58
TypeSet< T > vv_
Definition: linsolv.h:77
int totalnr_
Definition: linsolv.h:74
bool isEmpty() const
Definition: odstring.h:51
BufferString errmsg_
Definition: horizontracker.h:119
int size() const
Definition: linsolv.h:37
bool ready_
Definition: linsolv.h:46
static uiString phrInvalid(const uiString &string)
"Invalid <string>"
bool ready() const
Definition: linsolv.h:36
#define mClass(module)
Definition: commondefs.h:164
uiString uiMessage() const
will be message() again in 7.x
Definition: linsolv.h:61
#define pErrMsg(msg)
Definition: errmsg.h:60
LinSolver(const Array2D< T > &A)
Definition: linsolv.h:191
Array2DImpl< T > croutsmatrix_
Definition: linsolv.h:42
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: linsolv.h:67
Specification to enable chunkwise execution of a process.
Definition: executor.h:39
~LinSolver()
Definition: linsolv.h:228
void apply(const T *b, T *x) const
Definition: linsolv.h:235
uiString errmsg_
Definition: linsolv.h:79
int nextStep()
Definition: linsolv.h:123