| 1841 | } |
| 1842 | |
| 1843 | CFArray |
| 1844 | solveSystemFp (const CFMatrix& M, const CFArray& L) |
| 1845 | { |
| 1846 | ASSERT (L.size() <= M.rows(), "dimension exceeded"); |
| 1847 | CFMatrix *N; |
| 1848 | N= new CFMatrix (M.rows(), M.columns() + 1); |
| 1849 | |
| 1850 | for (int i= 1; i <= M.rows(); i++) |
| 1851 | for (int j= 1; j <= M.columns(); j++) |
| 1852 | (*N) (i, j)= M (i, j); |
| 1853 | |
| 1854 | int j= 1; |
| 1855 | for (int i= 0; i < L.size(); i++, j++) |
| 1856 | (*N) (j, M.columns() + 1)= L[i]; |
| 1857 | |
| 1858 | #ifdef HAVE_FLINT |
| 1859 | nmod_mat_t FLINTN; |
| 1860 | convertFacCFMatrix2nmod_mat_t (FLINTN, *N); |
| 1861 | long rk= nmod_mat_rref (FLINTN); |
| 1862 | #else |
| 1863 | int p= getCharacteristic (); |
| 1864 | if (fac_NTL_char != p) |
| 1865 | { |
| 1866 | fac_NTL_char= p; |
| 1867 | zz_p::init (p); |
| 1868 | } |
| 1869 | mat_zz_p *NTLN= convertFacCFMatrix2NTLmat_zz_p(*N); |
| 1870 | long rk= gauss (*NTLN); |
| 1871 | #endif |
| 1872 | delete N; |
| 1873 | if (rk != M.columns()) |
| 1874 | { |
| 1875 | #ifdef HAVE_FLINT |
| 1876 | nmod_mat_clear (FLINTN); |
| 1877 | #else |
| 1878 | delete NTLN; |
| 1879 | #endif |
| 1880 | return CFArray(); |
| 1881 | } |
| 1882 | #ifdef HAVE_FLINT |
| 1883 | N= convertNmod_mat_t2FacCFMatrix (FLINTN); |
| 1884 | nmod_mat_clear (FLINTN); |
| 1885 | #else |
| 1886 | N= convertNTLmat_zz_p2FacCFMatrix (*NTLN); |
| 1887 | delete NTLN; |
| 1888 | #endif |
| 1889 | CFArray A= readOffSolution (*N, rk); |
| 1890 | |
| 1891 | delete N; |
| 1892 | return A; |
| 1893 | } |
| 1894 | |
| 1895 | CFArray |
| 1896 | solveSystemFq (const CFMatrix& M, const CFArray& L, const Variable& alpha) |
no test coverage detected