My Project
Loading...
Searching...
No Matches
ModPMatrixBackSubstProxyOnArray< number_type > Class Template Reference

#include <tgb_internal.h>

Public Member Functions

void multiplyRow (int row, number_type coef)
 
 ModPMatrixBackSubstProxyOnArray (ModPMatrixProxyOnArray< number_type > &p)
 
void updateLastReducibleIndex (int r, int upper_bound)
 
void backwardSubstitute (int r)
 
 ~ModPMatrixBackSubstProxyOnArray ()
 
void backwardSubstitute ()
 

Private Attributes

int * startIndices
 
number_type ** rows
 
int * lastReducibleIndices
 
int ncols
 
int nrows
 
int nonZeroUntil
 

Detailed Description

template<class number_type>
class ModPMatrixBackSubstProxyOnArray< number_type >

Definition at line 1683 of file tgb_internal.h.

Constructor & Destructor Documentation

◆ ModPMatrixBackSubstProxyOnArray()

template<class number_type>
ModPMatrixBackSubstProxyOnArray< number_type >::ModPMatrixBackSubstProxyOnArray ( ModPMatrixProxyOnArray< number_type > & p)
inline

Definition at line 1692 of file tgb_internal.h.

1712 {
1713// (number_type* array, int nrows, int ncols, int* startIndices, number_type** rows){
1714 //we borrow some parameters ;-)
1715 //we assume, that nobody changes the order of the rows
1717 this->rows=p.rows;
1718 this->ncols=p.ncols;
1719 this->nrows=p.nrows;
1720 lastReducibleIndices=(int*) omalloc(nrows*sizeof(int));
1721 nonZeroUntil=0;
1722 while(nonZeroUntil<nrows)
1723 {
1725 {
1726 nonZeroUntil++;
1727 }
1728 else break;
1729 }
1730 if (TEST_OPT_PROT)
1731 Print("rank:%i\n",nonZeroUntil);
1732 nonZeroUntil--;
1733 int i;
1734 for(i=0;i<=nonZeroUntil;i++)
1735 {
1737 assume(!(npIsZero((number)(long) rows[i][startIndices[i]],currRing->cf)));
1740 }
1741 }
void updateLastReducibleIndex(int r, int upper_bound)
#define Print
Definition emacs.cc:80
#define assume(x)
Definition mod2.h:389
static BOOLEAN npIsZero(number a, const coeffs r)
Definition modulop_inl.h:38
#define omalloc(size)

◆ ~ModPMatrixBackSubstProxyOnArray()

template<class number_type>
ModPMatrixBackSubstProxyOnArray< number_type >::~ModPMatrixBackSubstProxyOnArray ( )
inline

Definition at line 1760 of file tgb_internal.h.

1825 {
1827 }
#define omfree(addr)

Member Function Documentation

◆ backwardSubstitute() [1/2]

template<class number_type>
void ModPMatrixBackSubstProxyOnArray< number_type >::backwardSubstitute ( )
inline

Definition at line 1828 of file tgb_internal.h.

1829 {
1830 int i;
1831 for(i=nonZeroUntil;i>0;i--)
1832 {
1834 }
1835 }

◆ backwardSubstitute() [2/2]

template<class number_type>
void ModPMatrixBackSubstProxyOnArray< number_type >::backwardSubstitute ( int r)
inline

Definition at line 1760 of file tgb_internal.h.

1761 {
1762 int start=startIndices[r];
1764 number_type zero=0;//npInit(0);
1766 assume((!(npIsZero((number)(long) row_array[start],currRing->cf))));
1768 int other_row;
1769 if (!(npIsOne((number)(long) row_array[r],currRing->cf)))
1770 {
1771 //it should be one, but this safety is not expensive
1773 }
1776 assume(lastIndex>=0);
1777 if(currRing->cf->ch<=NV_MAX_PRIME)
1778 {
1779 for(other_row=r-1;other_row>=0;other_row--)
1780 {
1783 {
1786 assume(!(npIsZero(coef,currRing->cf)));
1787 int i;
1789 for(i=start;i<=lastIndex;i++)
1790 {
1791 if (row_array[i]!=zero)
1792 {
1794 }
1795 }
1797 }
1798 }
1799 }
1800 else
1801 {
1802 for(other_row=r-1;other_row>=0;other_row--)
1803 {
1806 {
1809 assume(!(npIsZero(coef,currRing->cf)));
1810 int i;
1812 for(i=start;i<=lastIndex;i++)
1813 {
1814 if (row_array[i]!=zero)
1815 {
1817 }
1818 }
1820 }
1821 }
1822 }
1823 }
void multiplyRow(int row, number_type coef)
static BOOLEAN npIsOne(number a, const coeffs)
Definition modulop.h:179
static number npAddM(number a, number b, const coeffs r)
Definition modulop.h:124
static number npNegM(number a, const coeffs r)
Definition modulop.h:174
static number npInversM(number c, const coeffs r)
Definition modulop.h:223
static number nvMult(number a, number b, const coeffs r)
Definition modulop_inl.h:50
static number npMult(number a, number b, const coeffs r)
Definition modulop_inl.h:12
#define F4mat_to_number_type(a)
int modP_lastIndexRow(number_type *row, int ncols)

◆ multiplyRow()

template<class number_type>
void ModPMatrixBackSubstProxyOnArray< number_type >::multiplyRow ( int row,
number_type coef )
inline

Definition at line 1692 of file tgb_internal.h.

1693 {
1694 int i;
1696 if (currRing->cf->ch<=NV_MAX_PRIME)
1697 {
1698 for(i=startIndices[row];i<ncols;i++)
1699 {
1701 }
1702 }
1703 else
1704 {
1705 for(i=startIndices[row];i<ncols;i++)
1706 {
1708 }
1709 }
1710 }

◆ updateLastReducibleIndex()

template<class number_type>
void ModPMatrixBackSubstProxyOnArray< number_type >::updateLastReducibleIndex ( int r,
int upper_bound )
inline

Definition at line 1742 of file tgb_internal.h.

1743 {
1746 int i;
1747 const number_type zero=0;//npInit(0);
1748 for(i=upper_bound-1;i>r;i--)
1749 {
1750 int start=startIndices[i];
1752 if (!(row_array[start]==zero))
1753 {
1755 return;
1756 }
1757 }
1759 }

Field Documentation

◆ lastReducibleIndices

template<class number_type>
int* ModPMatrixBackSubstProxyOnArray< number_type >::lastReducibleIndices
private

Definition at line 1687 of file tgb_internal.h.

◆ ncols

template<class number_type>
int ModPMatrixBackSubstProxyOnArray< number_type >::ncols
private

Definition at line 1688 of file tgb_internal.h.

◆ nonZeroUntil

template<class number_type>
int ModPMatrixBackSubstProxyOnArray< number_type >::nonZeroUntil
private

Definition at line 1690 of file tgb_internal.h.

◆ nrows

template<class number_type>
int ModPMatrixBackSubstProxyOnArray< number_type >::nrows
private

Definition at line 1689 of file tgb_internal.h.

◆ rows

template<class number_type>
number_type** ModPMatrixBackSubstProxyOnArray< number_type >::rows
private

Definition at line 1686 of file tgb_internal.h.

◆ startIndices

template<class number_type>
int* ModPMatrixBackSubstProxyOnArray< number_type >::startIndices
private

Definition at line 1685 of file tgb_internal.h.


The documentation for this class was generated from the following file: