MCPcopy Create free account
hub / github.com/Singular/Singular / id_Mult

Function id_Mult

libpolys/polys/simpleideals.cc:918–956  ·  view source on GitHub ↗

h1 * h2 one h_i must be an ideal (with at least one column) the other h_i may be a module (with no columns at all)

Source from the content-addressed store, hash-verified

916/// one h_i must be an ideal (with at least one column)
917/// the other h_i may be a module (with no columns at all)
918ideal id_Mult (ideal h1,ideal h2, const ring R)
919{
920 id_Test(h1, R);
921 id_Test(h2, R);
922
923 int j = IDELEMS(h1);
924 while ((j > 0) && (h1->m[j-1] == NULL)) j--;
925
926 int i = IDELEMS(h2);
927 while ((i > 0) && (h2->m[i-1] == NULL)) i--;
928
929 j *= i;
930 int r = si_max( h2->rank, h1->rank );
931 if (j==0)
932 {
933 if ((IDELEMS(h1)>0) && (IDELEMS(h2)>0)) j=1;
934 return idInit(j, r);
935 }
936 ideal hh = idInit(j, r);
937
938 int k = 0;
939 for (i=0; i<IDELEMS(h1); i++)
940 {
941 if (h1->m[i] != NULL)
942 {
943 for (j=0; j<IDELEMS(h2); j++)
944 {
945 if (h2->m[j] != NULL)
946 {
947 hh->m[k] = pp_Mult_qq(h1->m[i],h2->m[j],R);
948 k++;
949 }
950 }
951 }
952 }
953
954 id_Compactify(hh,R);
955 return hh;
956}
957
958/// returns true if h is the zero ideal
959BOOLEAN idIs0 (ideal h)

Callers 2

idMultFunction · 0.85
slicehilbFunction · 0.85

Calls 4

si_maxFunction · 0.85
idInitFunction · 0.85
pp_Mult_qqFunction · 0.85
id_CompactifyFunction · 0.85

Tested by

no test coverage detected