### Question:
OuterProductComboSymMatrix extends AbstractMatrix implements SymMatrix { public OuterProductComboSymMatrix(Matrix vectorData, Vector weights, boolean zeroDiag) { super(); if (vectorData.numCols() != weights.getSize()) { throw new MatricksException("inconsistent size, matrix cols must equal vector len"); } this.vectorData = vectorData; this.weights = weights; this.zeroDiag = zeroDiag; this.size = vectorData.numRows(); } OuterProductComboSymMatrix(Matrix vectorData, Vector weights, boolean zeroDiag); int numRows(); int numCols(); int nnz(); double get(int row, int col); DenseDoubleVector getDiagAsVector(); @Override void compact(); void set(int row, int col, double val); void scale(double a); void setAll(double a); MatrixCursor cursor(); void add(Matrix B); void add(double a, Matrix B); double elementSum(); double elementMultiplySum(Matrix m); void CG(Vector x, Vector y); void QR(Vector x, Vector y); Vector rowSums(); Vector columnSums(); void rowSums(double[] result); void columnSums(double[] result); void setToMaxTranspose(); void multAdd(double alpha, Vector x, Vector y); void mult(Vector x, Vector y); Matrix subMatrix(int[] rows, int[] cols); void add(int i, int j, double alpha); void transMult(double[] x, double[] y); void multAdd(double alpha, double[] x, double[] y); void mult(double[] x, double[] y); void multAdd(double[] x, double[] y); SymMatrix subMatrix(int[] rowcols); void setDiag(double alpha); void dotDivOuterProd(Vector x); void addOuterProd(double[] x); double sumDotMultOuterProd(double[] x);  }### Answer:
@Test public void testOuterProductComboSymMatrix() { FlexFloatMatrix a = new FlexFloatMatrix(4, 6); a.set(0, 1, 1); a.set(0, 2, 1); a.set(0, 5, 1); a.set(1, 1, 1); a.set(1, 2, 1); a.set(1, 3, 1); a.set(2, 1, 1); a.set(2, 2, 1); a.set(2, 4, 1); a.set(2, 5, 1); a.set(3, 0, 1); a.set(3, 2, 1); a.set(3, 3, 1); a.set(3, 4, 1); DenseDoubleVector w = new DenseDoubleVector(6); w.set(0, 0.18519); w.set(1, 0.70168); w.set(2, 0.57522); w.set(3, 0.56964); w.set(4, 0.59336); w.set(5, 0.99504); DenseDoubleVector ones = new DenseDoubleVector(4); ones.set(0, 1); ones.set(1, 1); ones.set(2, 1); ones.set(3, 1); DenseDoubleVector result = new DenseDoubleVector(4); OuterProductComboSymMatrix matrix = new OuterProductComboSymMatrix(a, w, true); assertEquals(4, matrix.numRows()); assertEquals(4, matrix.numCols()); assertEquals(0, matrix.get(0, 0), 0d); assertEquals(1.16858, matrix.get(2, 3), 0d); assertEquals(1.16858, matrix.get(3, 2), 0d); }