A function that optimizes weights for a given design using newton's method
weight1(opt, x, t, g_part, w0, infor_design, ...)A numeric vector of optimized weights.
Integer. opt=0 means D-optimal, opt=1 means A-optimal.
Matrix, the design at current stage.
Integer. Number of levels of treatment.
Matrix. Contrast matrix. Its column numbers must match the row number of information matrix.
Numeric Vector. Initial weights.
Function. A function for calculating information matrix.
other necessary control parameters