1D matrices don't contain any information about how they are oriented. So you would need to supply this information in order to transpose it. For example, if you are using a row vector, you have a 1xm matrix, so you would need an mx1 column vector to contain the transpose.
Try this:
DoubleMatrix2D transpose = new DenseDoubleMatrix2D(4,1);
for (int i=0; i<4; i++) {
transpose.setQuick(i,0,array.getQuick(i));
}
If instead you have a column vector, the transpose would be a row vector:
DoubleMatrix2D transpose = new DenseDoubleMatrix2D(1,4);
for (int i=0; i<4; i++) {
transpose.setQuick(0,i,array.getQuick(i));
}