#### D.15.14.30 multiDeg

Procedure from library `multigrading.lib` (see multigrading_lib).

Usage:
  multiDeg(A); polynomial/vector/ideal/module A

Purpose:
  compute multidegree

Example:

    LIB "multigrading.lib";
    ring r = 0,(x, y), dp;
    intmat A[2][2] = 1, 0, 0, 1;
    print(A);
    ==>      1     0
    ==>      0     1
    intmat Ta[2][1] = 0, 3;
    print(Ta);
    ==>      0
    ==>      3
    //   attrib(A, "gradingGroup", Ta); // to think about
    //  "poly:";
    setBaseMultigrading(A);
    multiDeg( x*x, A );
    ==> 2,0
    multiDeg( y*y*y, A );
    ==> 0,3
    setBaseMultigrading(A, Ta);
    multiDeg( x*x*y );
    ==> 2,1
    multiDeg( y*y*y*x );
    ==> 1,3
    multiDeg( x*y + x + 1 );
    ==> 1,1
    multiDegPartition(x*y + x + 1);
    ==> _[1]=xy
    ==> _[2]=x
    ==> _[3]=1
    print ( multiDeg(0) );
    ==> 0,
    ==> 0
    poly zero = 0;
    print ( multiDeg(zero) );
    ==> 0,
    ==> 0
    //  "ideal:";
    ideal I = y*x*x, x*y*y*y;
    print( multiDeg(I) );
    ==>      2     1
    ==>      1     3
    print ( multiDeg(ideal(0)) );
    ==> 0,
    ==> 0
    print ( multiDeg(ideal(0,0,0)) );
    ==>      0     0     0
    ==>      0     0     0
    //  "vectors:";
    intmat B[2][2] = 0, 1, 1, 0;
    print(B);
    ==>      0     1
    ==>      1     0
    multiDeg( setModuleGrading(y*y*y*gen(2), B ));
    ==> 1,3
    multiDeg( setModuleGrading(x*x*gen(1), B ));
    ==> 2,1
    vector V = x*gen(1) + y*gen(2);
    V = setModuleGrading(V, B);
    multiDeg( V );
    ==> 1,1
    vector v1 = setModuleGrading([0, 0, 0], B);
    print( multiDeg( v1 ) );
    ==> 0,
    ==> 0
    vector v2 = setModuleGrading([0], B);
    print( multiDeg( v2 ) );
    ==> 0,
    ==> 0
    //  "module:";
    module D = x*gen(1), y*gen(2);
    D;
    ==> D[1]=x*gen(1)
    ==> D[2]=y*gen(2)
    D = setModuleGrading(D, B);
    print( multiDeg( D ) );
    ==>      1     1
    ==>      1     1
    module DD = [0, 0],[0, 0, 0];
    DD = setModuleGrading(DD, B);
    print( multiDeg( DD ) );
    ==>      0     0
    ==>      0     0
    module DDD = [0, 0];
    DDD = setModuleGrading(DDD, B);
    print( multiDeg( DDD ) );
    ==> 0,
    ==> 0

User manual for Singular version 4.4.1, 2025, generated by texi2html.