code: public static boolean cs_sprealloc(Dcs A, int nzmax) {
          if (A == null)
              return (false);
          if (nzmax <= 0)
              nzmax = (Dcs_util.CS_CSC(A)) ? (A.p[A.n]) : A.nz;
          int[] Ainew = new int[nzmax];
          int length = Math.min(nzmax, A.i.length);
          System.arraycopy(A.i, 0, Ainew, 0, length);
          A.i = Ainew;
          if (Dcs_util.CS_TRIPLET(A)) {
              int[] Apnew = new int[nzmax];
              length = Math.min(nzmax, A.p.length);
              System.arraycopy(A.p, 0, Apnew, 0, length);
              A.p = Apnew;
          }
          if (A.x != null) {
              double[] Axnew = new double[nzmax];
              length = Math.min(nzmax, A.x.length);
              System.arraycopy(A.x, 0, Axnew, 0, length);
              A.x = Axnew;
          }
          A.nzmax = nzmax;
          return (true);
      }
docs: Change the max # of entries a sparse matrix can hold.
  
  @param A
  column-compressed matrix
  @param nzmax
  new maximum number of entries
  @return true if successful, false on error