static FgMatrixC identity() { FG_STATIC_ASSERT(nrows == ncols); FgMatrixC ret(T(0)); for (uint ii=0; ii<nrows; ++ii) ret.elem(ii,ii) = T(1); return ret; }
FgMatrixC<T,nrows,1> fgMaxColwise(const FgMatrixC<T,nrows,ncols> & mat) { FG_STATIC_ASSERT(ncols > 1); FgMatrixC<T,nrows,1> ret(mat.colVec(0)); for (uint row=0; row<nrows; ++row) for (uint col=1; col<ncols; ++col) fgSetIfGreater(ret[row],mat.elm(col,row)); return ret; }
FgMatrixC(T a,T b,T c,T d,T e,T f,T g,T h,T i) { FG_STATIC_ASSERT(nrows*ncols == 9); m[0]=a; m[1]=b; m[2]=c; m[3]=d; m[4]=e; m[5]=f; m[6]=g; m[7]=h; m[8]=i; }
FgMatrixC(T a,T b,T c,T d,T e,T f) { FG_STATIC_ASSERT(nrows*ncols == 6); m[0]=a; m[1]=b; m[2]=c; m[3]=d; m[4]=e; m[5]=f; }
FgMatrixC(T a,T b,T c,T d,T e) { FG_STATIC_ASSERT(nrows*ncols == 5); m[0]=a; m[1]=b; m[2]=c; m[3]=d; m[4]=e; }
FgMatrixC(T a,T b,T c,T d) { FG_STATIC_ASSERT(nrows*ncols == 4); m[0]=a; m[1]=b; m[2]=c; m[3]=d; }
FgMatrixC(T x,T y,T z) { FG_STATIC_ASSERT(nrows*ncols == 3); m[0] = x; m[1] = y; m[2] = z; }
// Value-set constructors; # args must agree with # elements: FgMatrixC(T x,T y) { FG_STATIC_ASSERT(nrows*ncols == 2); m[0] = x; m[1] = y; }
FgMatrixC(T a,T b,T c,T d,T e,T f,T g,T h,T i,T j,T k,T l,T z,T n,T o,T p) { FG_STATIC_ASSERT(nrows*ncols == 16); m[0]=a; m[1]=b; m[2]=c; m[3]=d; m[4]=e; m[5]=f; m[6]=g; m[7]=h; m[8]=i; m[9]=j; m[10]=k; m[11]=l; m[12]=z; m[13]=n; m[14]=o; m[15]=p; }