Macaulay2 Engine
Loading...
Searching...
No Matches
fractionfreeLU.hpp
Go to the documentation of this file.
1// Copyright 1997 Michael E. Stillman
2
3#ifndef _fractionfreeLU_hpp_
4#define _fractionfreeLU_hpp_
5
36
37#include "mat.hpp"
38
54{
55 // This is a class encapsulating the LU decomposition
56 // over a domain, using fraction free Gaussian elimination.
57
58 const Ring *R; // R should be a domain.
61 bool *need_div;
65
66 private:
69
70 bool choose_pivot_column(int lo, int hi, int &result);
71 // Chooses a pivot in the column range lo..hi, among those with
72 // the highest index row. Returns true if there is a non-zero
73 // column in the range lo..hi, and sets 'result' in this case.
74 // If all such columns are zero, returns false.
75
76 void do_pivots(int lo, int hi, int pivot_col);
77 // Use the lead element (pivot, in row r, in pivot_col to clear all
78 // elements in row r in columns lo..hi. This uses fraction-free
79 // methods, and uses 'need_div' to determine whether division
80 // by the previous pivot should be done. It also sets 'need_div'
81 // for the next time.
82
83 bool calc();
84 // Returns true if the computation completed. False if it was
85 // user interrupted.
86
88
89 public:
91 // Replace M with its column echelon form. If M has
92 // column recording going on, then one obtains the whole
93 // LU decomposition.
94 // If the computation was interrupted, or M is in a ring which is found to not
95 // be a domain (e.g. a non-commutative ring), then NULL is returned, and M is
96 // left in an intermediate state.
97 // Otherwise, M is modified, and the column permutation needed
98 // to obtain the resulting M is returned.
99};
100
101#endif
bool choose_pivot_column(int lo, int hi, int &result)
M2_arrayint get_column_permutation()
MutableMatrix * M
void do_pivots(int lo, int hi, int pivot_col)
FF_LUComputation(MutableMatrix *M)
Abstract base class for mutable matrices over an arbitrary engine Ring, the in-place counterpart of t...
Definition mat.hpp:79
xxx xxx xxx
Definition ring.hpp:102
VALGRIND_MAKE_MEM_DEFINED & result(result)
M2_arrayint M2_arrayintOrNull
Definition m2-types.h:99
MutableMatrix — abstract base of every mutable matrix the engine hands across the boundary.
#define DO(CALL)
Definition res-a0.cpp:256